- Revision
- 113496
- Author
- timothy_hor...@apple.com
- Date
- 2012-04-06 14:31:02 -0700 (Fri, 06 Apr 2012)
Log Message
[cg] REGRESSION (r101517): Animating the transform of a <rect> with shape-rendering: crispEdges leaves behind garbage
https://bugs.webkit.org/show_bug.cgi?id=82963
<rdar://problem/11170476>
Reviewed by Simon Fraser.
CoreGraphics can inflate the stroke by 1px when drawing a rectangle
with antialiasing disabled at non-integer coordinates, we need to
compensate by inflating the RenderSVGRect repaint bounds by 1px.
No new tests, as this is not reproducible in DRT or WKTR.
* rendering/svg/RenderSVGRect.cpp:
(WebCore::RenderSVGRect::createShape):
(WebCore::RenderSVGRect::strokeBoundingBox):
* rendering/svg/RenderSVGRect.h:
(RenderSVGRect):
New Mac baselines for two tests which have SVG <rect>s with shape-rendering: crispEdges.
* platform/mac/svg/W3C-SVG-1.1/filters-composite-02-b-expected.txt:
* platform/mac/svg/custom/shape-rendering-expected.txt:
Modified Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (113495 => 113496)
--- trunk/LayoutTests/ChangeLog 2012-04-06 21:19:26 UTC (rev 113495)
+++ trunk/LayoutTests/ChangeLog 2012-04-06 21:31:02 UTC (rev 113496)
@@ -1,3 +1,16 @@
+2012-04-06 Tim Horton <timothy_hor...@apple.com>
+
+ [cg] REGRESSION (r101517): Animating the transform of a <rect> with shape-rendering: crispEdges leaves behind garbage
+ https://bugs.webkit.org/show_bug.cgi?id=82963
+ <rdar://problem/11170476>
+
+ Reviewed by Simon Fraser.
+
+ New Mac baselines for two tests which have SVG <rect>s with shape-rendering: crispEdges.
+
+ * platform/mac/svg/W3C-SVG-1.1/filters-composite-02-b-expected.txt:
+ * platform/mac/svg/custom/shape-rendering-expected.txt:
+
2012-04-06 Aaron Colwell <acolw...@chromium.org>
Fix MediaSource LayoutTests to work with the new XHR behavior
Modified: trunk/LayoutTests/platform/mac/svg/W3C-SVG-1.1/filters-composite-02-b-expected.txt (113495 => 113496)
--- trunk/LayoutTests/platform/mac/svg/W3C-SVG-1.1/filters-composite-02-b-expected.txt 2012-04-06 21:19:26 UTC (rev 113495)
+++ trunk/LayoutTests/platform/mac/svg/W3C-SVG-1.1/filters-composite-02-b-expected.txt 2012-04-06 21:31:02 UTC (rev 113496)
@@ -2,7 +2,7 @@
RenderView at (0,0) size 480x360
layer at (0,0) size 480x360
RenderSVGRoot {svg} at (0,0) size 480x360
- RenderSVGContainer {g} at (20,10) size 440x290 [transform={m=((1.00,0.00)(0.00,1.00)) t=(15.00,-60.00)}]
+ RenderSVGContainer {g} at (19,9) size 442x292 [transform={m=((1.00,0.00)(0.00,1.00)) t=(15.00,-60.00)}]
RenderSVGHiddenContainer {defs} at (0,0) size 0x0
RenderSVGPath {path} at (15,0) size 150x90 [fill={[type=SOLID] [color=#00FFFF]}] [data="" 0 0 L 150 0 L 150 150 Z"]
RenderSVGPath {path} at (15,0) size 150x90 [fill={[type=SOLID] [color=#FF00FF]}] [data="" 0 0 L 0 150 L 150 0 Z"]
@@ -56,8 +56,8 @@
[feComposite operation="ARITHMETIC" k1="0.50" k2="0.50" k3="0.50" k4="0.50"]
[feImage image-size="150x150"]
[feImage image-size="150x150"]
- RenderSVGContainer {g} at (20,10) size 440x290 [transform={m=((0.40,0.00)(0.00,0.40)) t=(5.00,70.00)}]
- RenderSVGRect {rect} at (20,10) size 440x290 [stroke={[type=SOLID] [color=#0000FF]}] [x=1.00] [y=1.00] [width=1098.00] [height=723.00]
+ RenderSVGContainer {g} at (19,9) size 442x292 [transform={m=((0.40,0.00)(0.00,0.40)) t=(5.00,70.00)}]
+ RenderSVGRect {rect} at (19,9) size 442x292 [stroke={[type=SOLID] [color=#0000FF]}] [x=1.00] [y=1.00] [width=1098.00] [height=723.00]
RenderSVGText {text} at (100,14) size 765x73 contains 1 chunk(s)
RenderSVGInlineText {#text} at (0,0) size 765x73
chunk 1 text run 1 at (100.00,75.00) startOffset 0 endOffset 26 width 765.00: "on first Row : opacity 1.0"
Modified: trunk/LayoutTests/platform/mac/svg/custom/shape-rendering-expected.txt (113495 => 113496)
--- trunk/LayoutTests/platform/mac/svg/custom/shape-rendering-expected.txt 2012-04-06 21:19:26 UTC (rev 113495)
+++ trunk/LayoutTests/platform/mac/svg/custom/shape-rendering-expected.txt 2012-04-06 21:31:02 UTC (rev 113496)
@@ -1,9 +1,9 @@
layer at (0,0) size 800x600
RenderView at (0,0) size 800x600
layer at (0,0) size 800x600
- RenderSVGRoot {svg} at (0,10) size 744x194
+ RenderSVGRoot {svg} at (0,8) size 744x196
RenderSVGRect {rect} at (30,10) size 140x140 [transform={m=((0.82,0.57)(-0.57,0.82)) t=(87.72,10.36)}] [fill={[type=SOLID] [color=#008000]}] [x=0.00] [y=0.00] [width=100.00] [height=100.00]
- RenderSVGRect {rect} at (180,10) size 140x140 [transform={m=((0.82,0.57)(-0.57,0.82)) t=(237.72,10.36)}] [fill={[type=SOLID] [color=#008000]}] [x=0.00] [y=0.00] [width=100.00] [height=100.00]
+ RenderSVGRect {rect} at (178,8) size 144x144 [transform={m=((0.82,0.57)(-0.57,0.82)) t=(237.72,10.36)}] [fill={[type=SOLID] [color=#008000]}] [x=0.00] [y=0.00] [width=100.00] [height=100.00]
RenderSVGContainer {g} at (0,166) size 744x38
RenderSVGText {text} at (0,166) size 297x18 contains 1 chunk(s)
RenderSVGInlineText {#text} at (0,0) size 297x18
Modified: trunk/Source/WebCore/ChangeLog (113495 => 113496)
--- trunk/Source/WebCore/ChangeLog 2012-04-06 21:19:26 UTC (rev 113495)
+++ trunk/Source/WebCore/ChangeLog 2012-04-06 21:31:02 UTC (rev 113496)
@@ -1,3 +1,23 @@
+2012-04-06 Tim Horton <timothy_hor...@apple.com>
+
+ [cg] REGRESSION (r101517): Animating the transform of a <rect> with shape-rendering: crispEdges leaves behind garbage
+ https://bugs.webkit.org/show_bug.cgi?id=82963
+ <rdar://problem/11170476>
+
+ Reviewed by Simon Fraser.
+
+ CoreGraphics can inflate the stroke by 1px when drawing a rectangle
+ with antialiasing disabled at non-integer coordinates, we need to
+ compensate by inflating the RenderSVGRect repaint bounds by 1px.
+
+ No new tests, as this is not reproducible in DRT or WKTR.
+
+ * rendering/svg/RenderSVGRect.cpp:
+ (WebCore::RenderSVGRect::createShape):
+ (WebCore::RenderSVGRect::strokeBoundingBox):
+ * rendering/svg/RenderSVGRect.h:
+ (RenderSVGRect):
+
2012-04-05 Simon Fraser <simon.fra...@apple.com>
Avoid trying to set filters on transform layers
Modified: trunk/Source/WebCore/rendering/svg/RenderSVGRect.cpp (113495 => 113496)
--- trunk/Source/WebCore/rendering/svg/RenderSVGRect.cpp 2012-04-06 21:19:26 UTC (rev 113495)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGRect.cpp 2012-04-06 21:31:02 UTC (rev 113496)
@@ -80,6 +80,14 @@
m_innerStrokeRect.inflate(-strokeWidth / 2);
m_outerStrokeRect.inflate(strokeWidth / 2);
}
+
+ m_strokeBoundingRect = m_outerStrokeRect;
+
+#if USE(CG)
+ // CoreGraphics can inflate the stroke by 1px when drawing a rectangle with antialiasing disabled at non-integer coordinates, we need to compensate.
+ if (style()->svgStyle()->shapeRendering() == SR_CRISPEDGES)
+ m_strokeBoundingRect.inflate(1);
+#endif
}
FloatRect RenderSVGRect::objectBoundingBox() const
@@ -93,7 +101,7 @@
{
if (isPaintingFallback())
return RenderSVGShape::strokeBoundingBox();
- return m_outerStrokeRect;
+ return m_strokeBoundingRect;
}
void RenderSVGRect::fillShape(GraphicsContext* context) const
Modified: trunk/Source/WebCore/rendering/svg/RenderSVGRect.h (113495 => 113496)
--- trunk/Source/WebCore/rendering/svg/RenderSVGRect.h 2012-04-06 21:19:26 UTC (rev 113495)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGRect.h 2012-04-06 21:31:02 UTC (rev 113496)
@@ -56,6 +56,7 @@
FloatRect m_boundingBox;
FloatRect m_innerStrokeRect;
FloatRect m_outerStrokeRect;
+ FloatRect m_strokeBoundingRect;
};
}