Changeset 73379 in webkit


Ignore:
Timestamp:
Dec 6, 2010 11:31:12 AM (13 years ago)
Author:
Simon Fraser
Message:

2010-12-06 Simon Fraser <Simon Fraser>

Reviewed by Dan Bernstein.

Font antialiasing (smoothing) changes when elements are rendered into compositing layers
https://bugs.webkit.org/show_bug.cgi?id=23364

Text rendered by Core Graphics over a transparent background looks bad because of
font smoothing, so turn off smoothing when rendering text into compositing layers.

  • platform/graphics/GraphicsContext.h:
  • platform/graphics/cg/GraphicsContextCG.cpp: (WebCore::GraphicsContext::setAllowsFontSmoothing):
  • platform/graphics/mac/WebLayer.mm: (drawLayerContents):
Location:
trunk/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r73378 r73379  
     12010-12-06  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Reviewed by Dan Bernstein.
     4
     5        Font antialiasing (smoothing) changes when elements are rendered into compositing layers
     6        https://bugs.webkit.org/show_bug.cgi?id=23364
     7
     8        Text rendered by Core Graphics over a transparent background looks bad because of
     9        font smoothing, so turn off smoothing when rendering text into compositing layers.
     10
     11        * platform/graphics/GraphicsContext.h:
     12        * platform/graphics/cg/GraphicsContextCG.cpp:
     13        (WebCore::GraphicsContext::setAllowsFontSmoothing):
     14        * platform/graphics/mac/WebLayer.mm:
     15        (drawLayerContents):
     16
    1172010-12-06  Patrick Gansterer  <paroga@webkit.org>
    218
  • trunk/WebCore/platform/graphics/GraphicsContext.h

    r73330 r73379  
    194194        void applyFillPattern();
    195195        void drawPath(const Path&);
     196       
     197        // Allow font smoothing (LCD antialiasing). Not part of the graphics state.
     198        void setAllowsFontSmoothing(bool);
    196199#endif
    197200
  • trunk/WebCore/platform/graphics/cg/GraphicsContextCG.cpp

    r73284 r73379  
    11171117}
    11181118
     1119void GraphicsContext::setAllowsFontSmoothing(bool allowsFontSmoothing)
     1120{
     1121    CGContextRef context = platformContext();
     1122    CGContextSetAllowsFontSmoothing(context, allowsFontSmoothing);
     1123}
     1124
    11191125void GraphicsContext::setPlatformTextDrawingMode(TextDrawingModeFlags mode)
    11201126{
  • trunk/WebCore/platform/graphics/mac/WebLayer.mm

    r73237 r73379  
    6363        GraphicsContext graphicsContext(context);
    6464
     65        // Turn off font smoothing to improve the appearance of text rendered onto a transparent background.
     66        graphicsContext.setAllowsFontSmoothing(false);
     67       
    6568        // It's important to get the clip from the context, because it may be significantly
    6669        // smaller than the layer bounds (e.g. tiled layers)
Note: See TracChangeset for help on using the changeset viewer.