Skip to content
  • ariya@webkit.org's avatar
    [Qt] Shadow blur for rectangle fill · fa215186
    ariya@webkit.org authored
    https://bugs.webkit.org/show_bug.cgi?id=44025
    
    Patch by Ariya Hidayat <ariya@sencha.com> on 2010-08-16
    Reviewed by Kenneth Rohde Christiansen.
    
    WebCore:
    
    The blur implementation follows the approximation of Gaussian blur
    with three successive box blurs, working on the alpha channel only.
    (see http://www.w3.org/TR/SVG/filters.html#feGaussianBlur).
    
    * WebCore.pro: Refer to ContexShadow.* files.
    * platform/graphics/qt/ContextShadow.cpp: Added.
    (WebCore::ContextShadow::ContextShadow):
    (WebCore::ContextShadow::clear):
    (WebCore::blurHorizontal): Box blurs in horizontal direction, working
    on QImage (in-place).
    (WebCore::shadowBlur): Main blur function which just calls the
    above blurHorizontal function twice, once with transposed image
    (equivalent as it would have done vertical box blurs).
    (WebCore::ContextShadow::drawShadowRect):
    * platform/graphics/qt/ContextShadow.h: Added.
    (WebCore::ContextShadow::):
    * platform/graphics/qt/GraphicsContextQt.cpp:
    (WebCore::GraphicsContextPlatformPrivate::hasShadow):
    (WebCore::GraphicsContext::restorePlatformState):
    (WebCore::GraphicsContext::fillRect): Use ContextShadow for the shadow.
    (WebCore::GraphicsContext::setPlatformShadow):
    
    LayoutTests:
    
    Update pixel test reference after the blur support.
    
    * platform/qt/fast/box-shadow/basic-shadows-expected.checksum:
    * platform/qt/fast/box-shadow/basic-shadows-expected.png:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@65425 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    fa215186