Title: [139745] trunk
Revision
139745
Author
[email protected]
Date
2013-01-15 08:57:55 -0800 (Tue, 15 Jan 2013)

Log Message

[Chromium] Incorrect opaque region tracking for PlatformContextSkia::drawRRect
https://bugs.webkit.org/show_bug.cgi?id=106898

Reviewed by Stephen White.

Source/WebCore:

Since drawRRect() doesn't cover the whole bounding rect, it needs to pass a didDrawBounded
notification down to the opaque region tracker (instead of didDrawRect as it currently
does).

Test: platform/chromium/compositing/rounded-corners.html

* platform/graphics/skia/PlatformContextSkia.h:
(WebCore::PlatformContextSkia::drawRRect):

Source/WebKit/chromium:

* tests/PlatformContextSkiaTest.cpp:
(WebCore::TEST):
(WebCore):

LayoutTests:

* platform/chromium-linux/platform/chromium/compositing/rounded-corners-expected.png: Added.
* platform/chromium-linux/platform/chromium/compositing/rounded-corners-expected.txt: Added.
* platform/chromium/TestExpectations:
* platform/chromium/compositing/rounded-corners.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (139744 => 139745)


--- trunk/LayoutTests/ChangeLog	2013-01-15 16:35:41 UTC (rev 139744)
+++ trunk/LayoutTests/ChangeLog	2013-01-15 16:57:55 UTC (rev 139745)
@@ -1,3 +1,15 @@
+2013-01-15  Florin Malita  <[email protected]>
+
+        [Chromium] Incorrect opaque region tracking for PlatformContextSkia::drawRRect
+        https://bugs.webkit.org/show_bug.cgi?id=106898
+
+        Reviewed by Stephen White.
+
+        * platform/chromium-linux/platform/chromium/compositing/rounded-corners-expected.png: Added.
+        * platform/chromium-linux/platform/chromium/compositing/rounded-corners-expected.txt: Added.
+        * platform/chromium/TestExpectations:
+        * platform/chromium/compositing/rounded-corners.html: Added.
+
 2013-01-15  Vsevolod Vlasov  <[email protected]>
 
         Unreviewed failing test skip.

Modified: trunk/LayoutTests/platform/chromium/TestExpectations (139744 => 139745)


--- trunk/LayoutTests/platform/chromium/TestExpectations	2013-01-15 16:35:41 UTC (rev 139744)
+++ trunk/LayoutTests/platform/chromium/TestExpectations	2013-01-15 16:57:55 UTC (rev 139745)
@@ -4210,6 +4210,9 @@
 webkit.org/b/104489 [ Win ] http/tests/w3c/webperf/submission/Intel/user-timing/test_user_timing_clearMarks.html [ Failure Pass ]
 webkit.org/b/104489 [ Win ] http/tests/w3c/webperf/submission/Intel/user-timing/test_user_timing_measure_associate_with_navigation_timing.html [ Failure Pass ]
 
+# Needs platform-specific results
+webkit.org/b/106898 platform/chromium/compositing/rounded-corners.html [ Pass Missing ]
+
 # Flaky since r136945
 webkit.org/b/94002 [ Win Mac Debug ] inspector/debugger/live-edit-breakpoints.html [ Failure Timeout ]
 webkit.org/b/94002 [ Mac Debug ] inspector/debugger/live-edit.html [ Crash Pass Timeout ]

Added: trunk/LayoutTests/platform/chromium/compositing/rounded-corners.html (0 => 139745)


--- trunk/LayoutTests/platform/chromium/compositing/rounded-corners.html	                        (rev 0)
+++ trunk/LayoutTests/platform/chromium/compositing/rounded-corners.html	2013-01-15 16:57:55 UTC (rev 139745)
@@ -0,0 +1,7 @@
+<!DOCTYPE html>
+<html>
+<body>
+    <!-- Test for https://bugs.webkit.org/show_bug.cgi?id=106898 -->
+    <div style="width: 200px; height: 200px; background: green; border-radius: 25%; -webkit-transform: translateZ(0);"></div>
+</body>
+</html>

Added: trunk/LayoutTests/platform/chromium-linux/platform/chromium/compositing/rounded-corners-expected.png (0 => 139745)


--- trunk/LayoutTests/platform/chromium-linux/platform/chromium/compositing/rounded-corners-expected.png	                        (rev 0)
+++ trunk/LayoutTests/platform/chromium-linux/platform/chromium/compositing/rounded-corners-expected.png	2013-01-15 16:57:55 UTC (rev 139745)
@@ -0,0 +1,24 @@
+\x89PNG
+
+
+IHDR X')tEXtchecksumfb023a73ef30b97adb409d2d5d7b11ae7/ŋ\xAFIDATx\x9C\xEDݿ\x8Fw\xC7\xE1\xC9\xE9$\xB6\xF3P\xB1\x9D\x87n;\x9B\x8At\xBB\xA9\xAE\x8CS]\xB9\xA6J\xBA\xDD\xFC,e\xAA@w\xA90\xE5U1]\xA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0Xa L`\x84	,\x800\x81&\xB0\xC2@\x98\xC0Xa L`\x84	,\x800\x81&\xB0\xC2@\x98\xC0Xa L`\x84	,\x800\x81&\xB0\xC2@\x98\xC0Xa L`\x84	,\x800\x81&\xB0\xC2@\x98\xC0Xa L`\x84	,\x800\x81&\xB0\xC2@\x98\xC0Xa L`\x84	,\x800\x81&\xB0\xC2@\x98\xC0Xa L`\x84	,\x800\x81&\xB0\xC2@\x98\xC0Xa L`\x84	,\x800\x81&\xB0\xC2@\x98\xC0Xa L`\x84	,\x800\x81&\xB0\xC2@\x98\xC0Xa L`\x84	,\x800\x81&\xB0\xC2@\x98\xC0Xa L`\x84	,\x800\x81&\xB0\xC2@\x98\xC0Xa L`\x84	,\x800\x81&\xB0\xC2@\x98\xC0Xa L`\x84	,\x800\x81&\xB0\xC2@\x98\xC0Xa L`\x84	,\x800\x81&\xB0\xC2@\x98\xC0Xa L`\x84	,\x800\x81&\xB0\xC2@\x98\xC0Xa L`\x84	,\x800\x81&\xB0\xC2@\x98\xC0Xa L`\x84	,\x800\x81&\xB0\xC2@\x98\xC0Xa L`\x84	,\x800\x81&\xB0\xC2@\x98\xC0Xa L`\x84	,\x800\x81&\xB0\xC2@\x98\xC0Xa L`\x84	,\x800\x81&\xB0\xC2@\x98\xC0Xa L`\x84	,\x800\x81&\xB0\xC2@\x98\xC0Xa L`\x84	,\x800\x81&\xB0\xC2@\x98\xC0Xa L`\x84	,\x800\x81&\xB0\xC2@\x98\xC0Xa L`\x84	,\x800\x81&\xB0\xC2@\x98\xC0Xa L`\x84	,\x800\x81&\xB0\xC2@\x98\xC0Xa L`\x84	,\x800\x81&\xB0\xC2@\x98\xC0Xa L`\x84	,\x800\x81&\xB0\xC2@\x98\xC0Xa L`\x84	,\x800\x81&\xB0\xC2@\x98\xC0Xa L`\x84	,\x800\x81&\xB0\xC2@\x98\xC0Xa L`\x84	,\x800\x81&\xB0\xC2@\x98\xC0Xa L`\x84	,\x800\x81&\xB0\xC2@\x98\xC0Xa L`\x84	,\x800\x81&\xB0\xC2@\x98\xC0Xa L`\x84	,\x800\x81&\xB0\xC2@\x98\xC0Xa L`\x84	,\x800\x81&\xB0\xC2@\x98\xC0Xa \xEC\xFF\xB8\\x{1AADED}\xDD8IEND\xAEB`\x82
\ No newline at end of file

Added: trunk/LayoutTests/platform/chromium-linux/platform/chromium/compositing/rounded-corners-expected.txt (0 => 139745)


--- trunk/LayoutTests/platform/chromium-linux/platform/chromium/compositing/rounded-corners-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/chromium-linux/platform/chromium/compositing/rounded-corners-expected.txt	2013-01-15 16:57:55 UTC (rev 139745)
@@ -0,0 +1,7 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x216
+  RenderBlock {HTML} at (0,0) size 800x216
+    RenderBody {BODY} at (8,8) size 784x200
+layer at (8,8) size 200x200
+  RenderBlock {DIV} at (0,0) size 200x200 [bgcolor=#008000]

Modified: trunk/Source/WebCore/ChangeLog (139744 => 139745)


--- trunk/Source/WebCore/ChangeLog	2013-01-15 16:35:41 UTC (rev 139744)
+++ trunk/Source/WebCore/ChangeLog	2013-01-15 16:57:55 UTC (rev 139745)
@@ -1,3 +1,19 @@
+2013-01-15  Florin Malita  <[email protected]>
+
+        [Chromium] Incorrect opaque region tracking for PlatformContextSkia::drawRRect
+        https://bugs.webkit.org/show_bug.cgi?id=106898
+
+        Reviewed by Stephen White.
+
+        Since drawRRect() doesn't cover the whole bounding rect, it needs to pass a didDrawBounded
+        notification down to the opaque region tracker (instead of didDrawRect as it currently
+        does).
+
+        Test: platform/chromium/compositing/rounded-corners.html
+
+        * platform/graphics/skia/PlatformContextSkia.h:
+        (WebCore::PlatformContextSkia::drawRRect):
+
 2013-01-15  Allan Sandfeld Jensen  <[email protected]>
 
         [Qt] WebGL does not require accelerated compositing

Modified: trunk/Source/WebCore/platform/graphics/skia/PlatformContextSkia.h (139744 => 139745)


--- trunk/Source/WebCore/platform/graphics/skia/PlatformContextSkia.h	2013-01-15 16:35:41 UTC (rev 139744)
+++ trunk/Source/WebCore/platform/graphics/skia/PlatformContextSkia.h	2013-01-15 16:57:55 UTC (rev 139745)
@@ -489,7 +489,7 @@
     m_canvas->drawRRect(rect, paint);
 
     if (m_trackOpaqueRegion)
-        m_opaqueRegion.didDrawRect(this, rect.getBounds(), paint, 0);
+        m_opaqueRegion.didDrawBounded(this, rect.getBounds(), paint);
 }
 
 inline void PlatformContextSkia::drawPosText(const void* text, size_t byteLength,

Modified: trunk/Source/WebKit/chromium/ChangeLog (139744 => 139745)


--- trunk/Source/WebKit/chromium/ChangeLog	2013-01-15 16:35:41 UTC (rev 139744)
+++ trunk/Source/WebKit/chromium/ChangeLog	2013-01-15 16:57:55 UTC (rev 139745)
@@ -1,3 +1,14 @@
+2013-01-15  Florin Malita  <[email protected]>
+
+        [Chromium] Incorrect opaque region tracking for PlatformContextSkia::drawRRect
+        https://bugs.webkit.org/show_bug.cgi?id=106898
+
+        Reviewed by Stephen White.
+
+        * tests/PlatformContextSkiaTest.cpp:
+        (WebCore::TEST):
+        (WebCore):
+
 2012-12-28  Vsevolod Vlasov  <[email protected]>
 
         Web Inspector: Support inspector file system access with isolated file system through InspectorFrontendHost.

Modified: trunk/Source/WebKit/chromium/tests/PlatformContextSkiaTest.cpp (139744 => 139745)


--- trunk/Source/WebKit/chromium/tests/PlatformContextSkiaTest.cpp	2013-01-15 16:35:41 UTC (rev 139744)
+++ trunk/Source/WebKit/chromium/tests/PlatformContextSkiaTest.cpp	2013-01-15 16:57:55 UTC (rev 139745)
@@ -664,6 +664,53 @@
     EXPECT_PIXELS_MATCH(bitmap, platformContext.opaqueRegion().asRect());
 }
 
+TEST(PlatformContextSkiaTest, trackOpaqueRoundedRectTest)
+{
+    SkBitmap bitmap;
+    bitmap.setConfig(SkBitmap::kARGB_8888_Config, 200, 200);
+    bitmap.allocPixels();
+    bitmap.eraseColor(0);
+    SkCanvas canvas(bitmap);
+
+    PlatformContextSkia platformContext(&canvas);
+    platformContext.setTrackOpaqueRegion(true);
+    GraphicsContext context(&platformContext);
+
+    Color opaque(1.0f, 0.0f, 0.0f, 1.0f);
+    Color alpha(0.0f, 0.0f, 0.0f, 0.0f);
+    IntSize radii(10, 10);
+
+    EXPECT_EQ_RECT(IntRect(0, 0, 0, 0), platformContext.opaqueRegion().asRect());
+    EXPECT_PIXELS_MATCH(bitmap, platformContext.opaqueRegion().asRect());
+
+    context.fillRoundedRect(IntRect(10, 10, 90, 90), radii, radii, radii, radii, opaque, ColorSpaceDeviceRGB);
+    EXPECT_EQ_RECT(IntRect(0, 0, 0, 0), platformContext.opaqueRegion().asRect());
+    EXPECT_PIXELS_MATCH(bitmap, platformContext.opaqueRegion().asRect());
+
+    context.fillRect(FloatRect(10, 10, 90, 90), opaque, ColorSpaceDeviceRGB, CompositeSourceOver);
+    EXPECT_EQ_RECT(IntRect(10, 10, 90, 90), platformContext.opaqueRegion().asRect());
+    EXPECT_PIXELS_MATCH(bitmap, platformContext.opaqueRegion().asRect());
+
+    context.setCompositeOperation(CompositeSourceIn);
+    context.setShouldAntialias(false);
+
+    context.fillRoundedRect(IntRect(10, 10, 50, 30), radii, radii, radii, radii, opaque, ColorSpaceDeviceRGB);
+    EXPECT_EQ_RECT(IntRect(10, 10, 90, 90), platformContext.opaqueRegion().asRect());
+    EXPECT_PIXELS_MATCH(bitmap, platformContext.opaqueRegion().asRect());
+
+    context.fillRoundedRect(IntRect(10, 10, 30, 50), radii, radii, radii, radii, alpha, ColorSpaceDeviceRGB);
+    EXPECT_EQ_RECT(IntRect(40, 10, 60, 90), platformContext.opaqueRegion().asRect());
+    EXPECT_PIXELS_MATCH(bitmap, platformContext.opaqueRegion().asRect());
+
+    context.fillRoundedRect(IntRect(10, 0, 50, 30), radii, radii, radii, radii, alpha, ColorSpaceDeviceRGB);
+    EXPECT_EQ_RECT(IntRect(40, 30, 60, 70), platformContext.opaqueRegion().asRect());
+    EXPECT_PIXELS_MATCH(bitmap, platformContext.opaqueRegion().asRect());
+
+    context.fillRoundedRect(IntRect(30, 0, 70, 50), radii, radii, radii, radii, opaque, ColorSpaceDeviceRGB);
+    EXPECT_EQ_RECT(IntRect(40, 30, 60, 70), platformContext.opaqueRegion().asRect());
+    EXPECT_PIXELS_MATCH(bitmap, platformContext.opaqueRegion().asRect());
+}
+
 TEST(PlatformContextSkiaTest, trackOpaqueIRectTest)
 {
     SkBitmap bitmap;
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to