Skip to content
  • timothy_horton@apple.com's avatar
    Text rendered with a simple (i.e. 0px blur) shadow inside a transparency layer has a double shadow · b09bdbf3
    timothy_horton@apple.com authored
    https://bugs.webkit.org/show_bug.cgi?id=67543
    <rdar://problem/10070536>
    
    Reviewed by Darin Adler.
    
    Source/WebCore:
    
    Generalize (begin|end)TransparencyLayer, which now forward
    through to (begin|end)PlatformTransparencyLayer, so that
    isInTransparencyLayer can exist on every platform.
    
    Make use of isInTransparencyLayer in FontMac to disable
    "simple" shadow drawing when the text is being rendered
    into a transparency layer.
    
    Test: svg/custom/simple-text-double-shadow.svg
    
    * platform/graphics/GraphicsContext.cpp:
    (WebCore::GraphicsContext::GraphicsContext):
    (WebCore::GraphicsContext::~GraphicsContext):
    (WebCore::GraphicsContext::beginTransparencyLayer):
    (WebCore::GraphicsContext::endTransparencyLayer):
    (WebCore::GraphicsContext::isInTransparencyLayer):
    * platform/graphics/GraphicsContext.h:
    * platform/graphics/cairo/GraphicsContextCairo.cpp:
    (WebCore::GraphicsContext::beginPlatformTransparencyLayer):
    (WebCore::GraphicsContext::endPlatformTransparencyLayer):
    (WebCore::GraphicsContext::supportsTransparencyLayers):
    * platform/graphics/cairo/GraphicsContextPlatformPrivateCairo.h:
    * platform/graphics/cg/GraphicsContextCG.cpp:
    (WebCore::GraphicsContext::beginPlatformTransparencyLayer):
    (WebCore::GraphicsContext::endPlatformTransparencyLayer):
    (WebCore::GraphicsContext::supportsTransparencyLayers):
    * platform/graphics/cg/GraphicsContextPlatformPrivateCG.h:
    (WebCore::GraphicsContextPlatformPrivate::GraphicsContextPlatformPrivate):
    * platform/graphics/haiku/GraphicsContextHaiku.cpp:
    (WebCore::GraphicsContext::beginPlatformTransparencyLayer):
    (WebCore::GraphicsContext::endPlatformTransparencyLayer):
    (WebCore::GraphicsContext::supportsTransparencyLayers):
    * platform/graphics/mac/FontMac.mm:
    (WebCore::Font::drawGlyphs):
    * platform/graphics/openvg/GraphicsContextOpenVG.cpp:
    (WebCore::GraphicsContext::beginPlatformTransparencyLayer):
    (WebCore::GraphicsContext::endPlatformTransparencyLayer):
    (WebCore::GraphicsContext::supportsTransparencyLayers):
    * platform/graphics/qt/GraphicsContextQt.cpp:
    (WebCore::GraphicsContext::isInTransparencyLayer):
    (WebCore::GraphicsContext::beginPlatformTransparencyLayer):
    (WebCore::GraphicsContext::endPlatformTransparencyLayer):
    (WebCore::GraphicsContext::supportsTransparencyLayers):
    * platform/graphics/skia/GraphicsContextSkia.cpp:
    (WebCore::GraphicsContext::beginPlatformTransparencyLayer):
    (WebCore::GraphicsContext::endPlatformTransparencyLayer):
    (WebCore::GraphicsContext::supportsTransparencyLayers):
    * platform/graphics/win/FontCGWin.cpp:
    (WebCore::drawGDIGlyphs):
    * platform/graphics/win/GraphicsContextCGWin.cpp:
    (WebCore::GraphicsContext::releaseWindowsContext):
    * platform/graphics/win/GraphicsContextCairoWin.cpp:
    (WebCore::GraphicsContext::releaseWindowsContext):
    * platform/graphics/win/GraphicsContextWin.cpp:
    (WebCore::GraphicsContext::getWindowsContext):
    * platform/graphics/wince/GraphicsContextWinCE.cpp:
    (WebCore::GraphicsContext::beginPlatformTransparencyLayer):
    (WebCore::GraphicsContext::endPlatformTransparencyLayer):
    (WebCore::GraphicsContext::supportsTransparencyLayers):
    * platform/graphics/wx/GraphicsContextWx.cpp:
    (WebCore::GraphicsContext::beginPlatformTransparencyLayer):
    (WebCore::GraphicsContext::endPlatformTransparencyLayer):
    (WebCore::GraphicsContext::supportsTransparencyLayers):
    * platform/win/ScrollbarThemeWin.cpp:
    * plugins/win/PluginViewWin.cpp:
    * rendering/RenderThemeWin.cpp:
    
    LayoutTests:
    
    Add a test ensuring that text with 0px blur CSS shadow doesn't get rendered
    with a second shadow when inside a transparency layer.
    
    * platform/mac/svg/custom/simple-text-double-shadow-expected.png: Added.
    * platform/mac/svg/custom/simple-text-double-shadow-expected.txt: Added.
    * svg/custom/simple-text-double-shadow.svg: Added.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@94897 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    b09bdbf3