Commit f5812287 authored by commit-queue@webkit.org's avatar commit-queue@webkit.org
Browse files

2011-01-18 Helder Correia <helder@sencha.com>

        Reviewed by Dirk Schulze.

        REGRESSION(75139): SVG gradients are not applied to texts
        https://bugs.webkit.org/show_bug.cgi?id=52531

        r75139 caused a problem with filling and stroking text with a gradient
        fill in SVG. The order of CGContextConcatCTM and CGContextClipToRect
        was mixed up.

        * platform/mac/svg/css/text-gradient-shadow-expected.checksum: Added.
        * platform/mac/svg/css/text-gradient-shadow-expected.png: Added.
        * platform/mac/svg/css/text-gradient-shadow-expected.txt: Added.
        * svg/css/text-gradient-shadow.svg: Added.
2011-01-18  Helder Correia  <helder@sencha.com>

        Reviewed by Dirk Schulze.

        REGRESSION(75139): SVG gradients are not applied to texts
        https://bugs.webkit.org/show_bug.cgi?id=52531

        r75139 caused a problem with filling and stroking text with a gradient
        fill in SVG. The order of CGContextConcatCTM and CGContextClipToRect
        was mixed up.

        Test: svg/css/text-gradient-shadow.svg

        * platform/graphics/cg/GraphicsContextCG.cpp:
        (WebCore::GraphicsContext::fillRect):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@76029 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 964064a2
2011-01-18 Helder Correia <helder@sencha.com>
Reviewed by Dirk Schulze.
REGRESSION(75139): SVG gradients are not applied to texts
https://bugs.webkit.org/show_bug.cgi?id=52531
r75139 caused a problem with filling and stroking text with a gradient
fill in SVG. The order of CGContextConcatCTM and CGContextClipToRect
was mixed up.
* platform/mac/svg/css/text-gradient-shadow-expected.checksum: Added.
* platform/mac/svg/css/text-gradient-shadow-expected.png: Added.
* platform/mac/svg/css/text-gradient-shadow-expected.txt: Added.
* svg/css/text-gradient-shadow.svg: Added.
2011-01-18 John Knottenbelt <jknotten@chromium.org>
 
Reviewed by Jeremy Orlow.
......
28e820701fc837bb1b5d92175e7dfee8
\ No newline at end of file
layer at (0,0) size 800x600
RenderView at (0,0) size 800x600
layer at (0,0) size 800x600
RenderSVGRoot {svg} at (200,20) size 439x270
RenderSVGHiddenContainer {defs} at (0,0) size 0x0
RenderSVGResourceLinearGradient {linearGradient} [id="gradient"] [gradientUnits=objectBoundingBox] [start=(0,0)] [end=(1,0)]
RenderSVGGradientStop {stop} [offset=0.00] [color=#FF0000]
RenderSVGGradientStop {stop} [offset=1.00] [color=#0000FF]
RenderSVGText {text} at (200,20) size 399x230 contains 1 chunk(s)
RenderSVGInlineText {#text} at (0,0) size 399x230
chunk 1 text run 1 at (200.00,200.00) startOffset 0 endOffset 3 width 399.00: "SVG"
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" >
<defs>
<linearGradient id="gradient" x1="0%" y1="0%" x2="100%" y2="0%">
<stop offset="0%" stop-color="red"/>
<stop offset="100%" stop-color="blue"/>
</linearGradient>
</defs>
<text x="200" y="200" style="font-size: 200px; text-shadow: #000 20px 20px 20px;" fill="url(#gradient)">SVG</text>
</svg>
2011-01-18 Helder Correia <helder@sencha.com>
Reviewed by Dirk Schulze.
REGRESSION(75139): SVG gradients are not applied to texts
https://bugs.webkit.org/show_bug.cgi?id=52531
r75139 caused a problem with filling and stroking text with a gradient
fill in SVG. The order of CGContextConcatCTM and CGContextClipToRect
was mixed up.
Test: svg/css/text-gradient-shadow.svg
* platform/graphics/cg/GraphicsContextCG.cpp:
(WebCore::GraphicsContext::fillRect):
2011-01-18 Leo Yang <leo.yang@torchmobile.com.cn>
 
Reviewed by Nikolas Zimmermann.
......@@ -625,8 +625,8 @@ void GraphicsContext::fillRect(const FloatRect& rect)
if (m_state.fillGradient) {
CGContextSaveGState(context);
CGContextConcatCTM(context, m_state.fillGradient->gradientSpaceTransform());
if (hasShadow()) {
CGContextConcatCTM(context, m_state.fillGradient->gradientSpaceTransform());
CGLayerRef layer = CGLayerCreateWithContext(context, CGSizeMake(rect.width(), rect.height()), 0);
CGContextRef layerContext = CGLayerGetContext(layer);
m_state.fillGradient->paint(layerContext);
......@@ -634,6 +634,7 @@ void GraphicsContext::fillRect(const FloatRect& rect)
CGLayerRelease(layer);
} else {
CGContextClipToRect(context, rect);
CGContextConcatCTM(context, m_state.fillGradient->gradientSpaceTransform());
m_state.fillGradient->paint(this);
}
CGContextRestoreGState(context);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment