2010-12-18 Helder Correia <helder@sencha.com> and Martin Robinson <mrobinson@igali...
authormrobinson@webkit.org <mrobinson@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 18 Dec 2010 18:44:48 +0000 (18:44 +0000)
committermrobinson@webkit.org <mrobinson@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 18 Dec 2010 18:44:48 +0000 (18:44 +0000)
commit8f6c0810347ca2b7af14ad26c025b1329d1aa65d
tree040215daf07645d1a9750125ab45da1422ab9f94
parenta3c5128a209d4014751d827dc1725204e2f94d4a
2010-12-18  Helder Correia  <helder@sencha.com> and Martin Robinson  <mrobinson@igalia.com>

        Reviewed by Ariya Hidayat.

        [Qt] Canvas shadow offset should not be affected by any transformation
        https://bugs.webkit.org/show_bug.cgi?id=50422

        On a canvas context, shadows are currently affected by all
        transformations except scaling. According to the spec:
        http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#shadows

        "The shadowOffsetX and shadowOffsetY attributes specify the distance
        that the shadow will be offset in the positive horizontal and positive
        vertical distance respectively. Their values are in coordinate space
        units. They are not affected by the current transformation matrix."

        NOTE: this applies only to canvas, not to box shadows.

        Add new test to ensure that shadows are correctly transformed keeping
        the relative offset to the shape.

        * fast/canvas/canvas-scale-strokePath-shadow-expected.txt: See strokePath below.
        * fast/canvas/canvas-transforms-fillRect-shadow-expected.txt: Added.
        * fast/canvas/canvas-transforms-fillRect-shadow.html: Added.
        * fast/canvas/script-tests/canvas-scale-fillPath-shadow.js:
        * fast/canvas/script-tests/canvas-scale-fillRect-shadow.js:
        * fast/canvas/script-tests/canvas-scale-strokePath-shadow.js: Now using
          a lineWidth > 1 to make it easier to test and more fair among all
          ports, since there can be different transformation smoothness or
          aliasing settings.
        * fast/canvas/script-tests/canvas-transforms-fillRect-shadow.js: Added.
        * platform/gtk/Skipped: GTK port needs to implement this feature.
        * platform/gtk/fast/canvas/canvas-scale-fillPath-shadow-expected.txt: Removed.
        * platform/gtk/fast/canvas/canvas-scale-fillRect-shadow-expected.txt: Removed.
        * platform/gtk/fast/canvas/canvas-scale-strokePath-shadow-expected.txt: Removed.
2010-12-18  Helder Correia  <helder@sencha.com> and Martin Robinson  <mrobinson@igalia.com>

        Reviewed by Ariya Hidayat.

        [Qt] Canvas shadow offset should not be affected by any transformation
        https://bugs.webkit.org/show_bug.cgi?id=50422

        On a canvas context, shadows are currently affected by all
        transformations except scaling. According to the spec:
        http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#shadows

        "The shadowOffsetX and shadowOffsetY attributes specify the distance
        that the shadow will be offset in the positive horizontal and positive
        vertical distance respectively. Their values are in coordinate space
        units. They are not affected by the current transformation matrix."

        NOTE: this applies only to canvas, not to box shadows.

        Test: fast/canvas/canvas-transforms-fillRect-shadow.html

        * platform/graphics/ContextShadow.cpp:
        (WebCore::ContextShadow::ContextShadow):
        (WebCore::ContextShadow::calculateLayerBoundingRect):
        * platform/graphics/ContextShadow.h:
        (WebCore::ContextShadow::setShadowsIgnoreTransforms):
        (WebCore::ContextShadow::shadowsIgnoreTransforms):
        (WebCore::ContextShadow::offset):
        * platform/graphics/qt/ContextShadowQt.cpp:
        (WebCore::ContextShadow::beginShadowLayer):
        (WebCore::ContextShadow::endShadowLayer):
        * platform/graphics/qt/GraphicsContextQt.cpp:
        (WebCore::mustUseContextShadow):
        (WebCore::GraphicsContext::fillPath):
        (WebCore::GraphicsContext::strokePath):
        (WebCore::GraphicsContext::fillRect):
        (WebCore::GraphicsContext::fillRoundedRect):
        (WebCore::GraphicsContext::setPlatformShadow):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@74317 268f45cc-cd09-0410-ab3c-d52691b4dbfc
21 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/canvas/canvas-scale-strokePath-shadow-expected.txt
LayoutTests/fast/canvas/canvas-transforms-fillRect-shadow-expected.txt [moved from LayoutTests/platform/gtk/fast/canvas/canvas-scale-fillRect-shadow-expected.txt with 60% similarity]
LayoutTests/fast/canvas/canvas-transforms-fillRect-shadow.html [new file with mode: 0644]
LayoutTests/fast/canvas/script-tests/canvas-scale-fillPath-shadow.js
LayoutTests/fast/canvas/script-tests/canvas-scale-fillRect-shadow.js
LayoutTests/fast/canvas/script-tests/canvas-scale-strokePath-shadow.js
LayoutTests/fast/canvas/script-tests/canvas-transforms-fillRect-shadow.js [new file with mode: 0644]
LayoutTests/platform/gtk/Skipped
LayoutTests/platform/gtk/fast/canvas/canvas-scale-fillPath-shadow-expected.txt [deleted file]
LayoutTests/platform/gtk/fast/canvas/canvas-scale-strokePath-shadow-expected.txt [deleted file]
WebCore/ChangeLog
WebCore/platform/graphics/ContextShadow.cpp
WebCore/platform/graphics/ContextShadow.h
WebCore/platform/graphics/cairo/ContextShadowCairo.cpp
WebCore/platform/graphics/cairo/FontCairo.cpp
WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp
WebCore/platform/graphics/gtk/FontGtk.cpp
WebCore/platform/graphics/qt/ContextShadowQt.cpp
WebCore/platform/graphics/qt/FontQt.cpp
WebCore/platform/graphics/qt/GraphicsContextQt.cpp