WebCore: [CAIRO] shadow support for Canvas and SVG.
authorbfulgham@webkit.org <bfulgham@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 13 Nov 2009 01:47:45 +0000 (01:47 +0000)
committerbfulgham@webkit.org <bfulgham@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 13 Nov 2009 01:47:45 +0000 (01:47 +0000)
commit07e6c36cc42c05274c7d14ca1dd06865896fc60b
treea0b9a262e3d440a3c15b6044bc1222e82a679808
parent4a85b0480bcd117c7f9e16fcaf5bec6968630640
WebCore: [CAIRO] shadow support for Canvas and SVG.
[https://bugs.webkit.org/show_bug.cgi?id=30960]

Reviewed by Simon Fraser.

Implement Canvas/SVG shadow support for Cairo.  This patch
uses the filter code from SVG Filters.  That means that it is
necessary to activate filters to see the shadows.

Test: fast/canvas/canvas-shadow.html

* GNUmakefile.am:
* WebCore.vcproj/WebCore.vcproj: Add new ImageBufferFilter files.
* platform/graphics/GraphicsContext.h:
* platform/graphics/cairo/GraphicsContextCairo.cpp:
(GraphicsContext::calculateShadowBufferDimensions): New helper routine.
(WebCore::setPlatformFill):
(WebCore::setPlatformStroke):
(WebCore::copyContextProperties):
(WebCore::drawPathShadow):
(WebCore::GraphicsContext::fillPath):
(WebCore::GraphicsContext::strokePath):
(WebCore::GraphicsContext::drawPath):
(WebCore::GraphicsContext::setPlatformShadow):
(WebCore::GraphicsContext::createPlatformShadow):
* platform/graphics/cairo/ImageCairo.cpp:
(WebCore::BitmapImage::draw): Add filter effect.
* platform/graphics/filters/Filter.h: Correct 'const' signatures.
* platform/graphics/filters/ImageBufferFilter.cpp: Added.
* platform/graphics/filters/ImageBufferFilter.h: Added.
* svg/graphics/filters/SVGFilter.cpp: Correct 'const' signatures.
* svg/graphics/filters/SVGFilter.h: Correct 'const' signatures.

LayoutTests: Some tests for canvas shadow.

Patch by Dirk Schulze <krit@webkit.org> on 2009-11-11
Reviewed by Simon Fraser.

* fast/canvas/canvas-shadow-expected.txt: Added.
* fast/canvas/canvas-shadow.html: Added.
* fast/canvas/script-tests/canvas-shadow.js: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@50920 268f45cc-cd09-0410-ab3c-d52691b4dbfc
15 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/canvas/canvas-shadow-expected.txt [new file with mode: 0644]
LayoutTests/fast/canvas/canvas-shadow.html [new file with mode: 0644]
LayoutTests/fast/canvas/script-tests/canvas-shadow.js [new file with mode: 0644]
WebCore/ChangeLog
WebCore/GNUmakefile.am
WebCore/WebCore.vcproj/WebCore.vcproj
WebCore/platform/graphics/GraphicsContext.h
WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp
WebCore/platform/graphics/cairo/ImageCairo.cpp
WebCore/platform/graphics/filters/Filter.h
WebCore/platform/graphics/filters/ImageBufferFilter.cpp [new file with mode: 0644]
WebCore/platform/graphics/filters/ImageBufferFilter.h [new file with mode: 0644]
WebCore/svg/graphics/filters/SVGFilter.cpp
WebCore/svg/graphics/filters/SVGFilter.h