- Revision
- 119242
- Author
- [email protected]
- Date
- 2012-06-01 09:19:43 -0700 (Fri, 01 Jun 2012)
Log Message
[cairo] Pixel artifacts can be seen on reflections
https://bugs.webkit.org/show_bug.cgi?id=85483
Source/WebCore:
Antialiased clipping in the simple rectangular clip method
leads to edge artifacts when transformations are applied to the layer.
Explicitly disabling antialiased clipping for this function solves this issue.
Comparing Cairo GraphicsContext to Qt and Skia GC, it seems that these
backends do not expect the platform context to clip antialiased in this
case either.
Patch by Dominik Röttsches <[email protected]> on 2012-06-01
Reviewed by Martin Robinson.
No new tests, covered by fast/css/transformed-mask.html.
* platform/graphics/cairo/GraphicsContextCairo.cpp:
(WebCore::GraphicsContext::clip):
LayoutTests:
Patch by Dominik Röttsches <[email protected]> on 2012-06-01
Reviewed by Martin Robinson.
Rebaselining the relevant test case for GTK and EFL.
* platform/efl/fast/css/transformed-mask-expected.png:
* platform/efl/fast/css/transformed-mask-expected.txt:
* platform/efl/test_expectations.txt:
* platform/gtk/fast/css/transformed-mask-expected.png:
Modified Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (119241 => 119242)
--- trunk/LayoutTests/ChangeLog 2012-06-01 16:03:33 UTC (rev 119241)
+++ trunk/LayoutTests/ChangeLog 2012-06-01 16:19:43 UTC (rev 119242)
@@ -1,3 +1,17 @@
+2012-06-01 Dominik Röttsches <[email protected]>
+
+ [cairo] Pixel artifacts can be seen on reflections
+ https://bugs.webkit.org/show_bug.cgi?id=85483
+
+ Reviewed by Martin Robinson.
+
+ Rebaselining the relevant test case for GTK and EFL.
+
+ * platform/efl/fast/css/transformed-mask-expected.png:
+ * platform/efl/fast/css/transformed-mask-expected.txt:
+ * platform/efl/test_expectations.txt:
+ * platform/gtk/fast/css/transformed-mask-expected.png:
+
2012-06-01 Florin Malita <[email protected]>
http://shinydemos.com/clock/ doesn't seem to work
Modified: trunk/LayoutTests/platform/efl/fast/css/transformed-mask-expected.png
(Binary files differ)
Modified: trunk/LayoutTests/platform/efl/fast/css/transformed-mask-expected.txt (119241 => 119242)
--- trunk/LayoutTests/platform/efl/fast/css/transformed-mask-expected.txt 2012-06-01 16:03:33 UTC (rev 119241)
+++ trunk/LayoutTests/platform/efl/fast/css/transformed-mask-expected.txt 2012-06-01 16:19:43 UTC (rev 119242)
@@ -1,20 +1,20 @@
layer at (0,0) size 800x600
RenderView at (0,0) size 800x600
-layer at (0,0) size 800x225
- RenderBlock {HTML} at (0,0) size 800x225
- RenderBody {BODY} at (8,23) size 784x194
- RenderBlock {P} at (0,0) size 784x26
- RenderText {#text} at (0,0) size 567x26
- text run at (0,0) width 567: "You should not see any pixel artifacts around the reflections."
- RenderBlock (anonymous) at (0,49) size 784x145
- RenderText {#text} at (140,119) size 6x26
- text run at (140,119) width 6: " "
- RenderText {#text} at (286,119) size 6x26
- text run at (286,119) width 6: " "
+layer at (0,0) size 800x201
+ RenderBlock {HTML} at (0,0) size 800x201
+ RenderBody {BODY} at (8,16) size 784x177
+ RenderBlock {P} at (0,0) size 784x18
+ RenderText {#text} at (0,0) size 381x19
+ text run at (0,0) width 381: "You should not see any pixel artifacts around the reflections."
+ RenderBlock (anonymous) at (0,34) size 784x143
+ RenderText {#text} at (140,125) size 4x19
+ text run at (140,125) width 4: " "
+ RenderText {#text} at (284,125) size 4x19
+ text run at (284,125) width 4: " "
RenderText {#text} at (0,0) size 0x0
-layer at (28,92) size 100x100
+layer at (28,70) size 100x100
RenderBlock {DIV} at (20,20) size 100x100 [bgcolor=#000000]
-layer at (174,92) size 100x100
- RenderBlock {DIV} at (166,20) size 100x100 [bgcolor=#000000]
-layer at (320,92) size 100x100
- RenderBlock {DIV} at (312,20) size 100x100 [bgcolor=#000000]
+layer at (172,70) size 100x100
+ RenderBlock {DIV} at (164,20) size 100x100 [bgcolor=#000000]
+layer at (316,70) size 100x100
+ RenderBlock {DIV} at (308,20) size 100x100 [bgcolor=#000000]
Modified: trunk/LayoutTests/platform/efl/test_expectations.txt (119241 => 119242)
--- trunk/LayoutTests/platform/efl/test_expectations.txt 2012-06-01 16:03:33 UTC (rev 119241)
+++ trunk/LayoutTests/platform/efl/test_expectations.txt 2012-06-01 16:19:43 UTC (rev 119242)
@@ -518,8 +518,6 @@
BUGWK29359 : fast/css/pseudo-out-of-range.html = TEXT
BUGWK29359 : fast/css/pseudo-in-range-invalid-value.html = TEXT
-BUGWK85483 : fast/css/transformed-mask.html = TEXT
-
BUGWK85484 : fast/css/resize-corner-tracking-transformed.html = TEXT
BUGWK85484 : fast/css/resize-corner-tracking.html = TEXT
Modified: trunk/LayoutTests/platform/gtk/fast/css/transformed-mask-expected.png
(Binary files differ)
Modified: trunk/Source/WebCore/ChangeLog (119241 => 119242)
--- trunk/Source/WebCore/ChangeLog 2012-06-01 16:03:33 UTC (rev 119241)
+++ trunk/Source/WebCore/ChangeLog 2012-06-01 16:19:43 UTC (rev 119242)
@@ -1,3 +1,22 @@
+2012-06-01 Dominik Röttsches <[email protected]>
+
+ [cairo] Pixel artifacts can be seen on reflections
+ https://bugs.webkit.org/show_bug.cgi?id=85483
+
+ Antialiased clipping in the simple rectangular clip method
+ leads to edge artifacts when transformations are applied to the layer.
+ Explicitly disabling antialiased clipping for this function solves this issue.
+ Comparing Cairo GraphicsContext to Qt and Skia GC, it seems that these
+ backends do not expect the platform context to clip antialiased in this
+ case either.
+
+ Reviewed by Martin Robinson.
+
+ No new tests, covered by fast/css/transformed-mask.html.
+
+ * platform/graphics/cairo/GraphicsContextCairo.cpp:
+ (WebCore::GraphicsContext::clip):
+
2012-06-01 Florin Malita <[email protected]>
http://shinydemos.com/clock/ doesn't seem to work
Modified: trunk/Source/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp (119241 => 119242)
--- trunk/Source/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp 2012-06-01 16:03:33 UTC (rev 119241)
+++ trunk/Source/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp 2012-06-01 16:19:43 UTC (rev 119242)
@@ -6,6 +6,7 @@
* Copyright (C) 2009 Brent Fulgham <[email protected]>
* Copyright (C) 2010, 2011 Igalia S.L.
* Copyright (C) Research In Motion Limited 2010. All rights reserved.
+ * Copyright (C) 2012, Intel Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -526,8 +527,16 @@
cairo_rectangle(cr, rect.x(), rect.y(), rect.width(), rect.height());
cairo_fill_rule_t savedFillRule = cairo_get_fill_rule(cr);
cairo_set_fill_rule(cr, CAIRO_FILL_RULE_WINDING);
+ // The rectangular clip function is traditionally not expected to
+ // antialias. If we don't force antialiased clipping here,
+ // edge fringe artifacts may occur at the layer edges
+ // when a transformation is applied to the GraphicsContext
+ // while drawing the transformed layer.
+ cairo_antialias_t savedAntialiasRule = cairo_get_antialias(cr);
+ cairo_set_antialias(cr, CAIRO_ANTIALIAS_NONE);
cairo_clip(cr);
cairo_set_fill_rule(cr, savedFillRule);
+ cairo_set_antialias(cr, savedAntialiasRule);
m_data->clip(rect);
}