[CG] Rasterized scaling of transformed SVG shapes with gradient fill and -webkit...
authortimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 18 Jan 2012 18:49:51 +0000 (18:49 +0000)
committertimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 18 Jan 2012 18:49:51 +0000 (18:49 +0000)
commit4f3713486bc3946ab3291c136a21b278d0eed077
tree11605ef903c61afddb1cda21d072bca359f08302
parentba72c185ba8a126ba264339c0d0d3c12f9cfbf59
[CG] Rasterized scaling of transformed SVG shapes with gradient fill and -webkit-svg-shadow applied
https://bugs.webkit.org/show_bug.cgi?id=76482
<rdar://problem/10415483>

Reviewed by Simon Fraser.

Scale the CGLayer used when filling or stroking a shadowed path or rect with
a gradient in GraphicsContextCG. Previously, the CGLayer was created and rendered
into at the untransformed size of the shape, leading to pixelation when it was
then scaled up and drawn into the destination.

Add AffineTransform::mapSize() to map a size through a transformation.

Test: svg/custom/transform-with-shadow-and-gradient.svg

* platform/graphics/cg/GraphicsContextCG.cpp:
(WebCore::GraphicsContext::fillPath):
(WebCore::GraphicsContext::strokePath):
(WebCore::GraphicsContext::fillRect):
(WebCore::GraphicsContext::strokeRect):
* platform/graphics/transforms/AffineTransform.cpp:
(WebCore::AffineTransform::mapSize): Added.
* platform/graphics/transforms/AffineTransform.h:

Add a test that ensures that SVG shapes are drawn crisply when transformed
if they have both a gradient fill and -webkit-svg-shadow applied.

* platform/mac/svg/custom/transform-with-shadow-and-gradient-expected.png: Added.
* platform/mac/svg/custom/transform-with-shadow-and-gradient-expected.txt: Added.
* svg/custom/transform-with-shadow-and-gradient.svg: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@105296 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/platform/mac/svg/custom/transform-with-shadow-and-gradient-expected.png [new file with mode: 0644]
LayoutTests/platform/mac/svg/custom/transform-with-shadow-and-gradient-expected.txt [new file with mode: 0644]
LayoutTests/svg/custom/transform-with-shadow-and-gradient.svg [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp
Source/WebCore/platform/graphics/transforms/AffineTransform.cpp
Source/WebCore/platform/graphics/transforms/AffineTransform.h