Title: [89397] trunk
Revision
89397
Author
mdela...@apple.com
Date
2011-06-21 17:40:41 -0700 (Tue, 21 Jun 2011)

Log Message

2011-06-21  Matthew Delaney  <mdela...@apple.com>

        Reviewed by Simon Fraser.

        beginTransparencyLayer leaves context color out of sync, bleeds color into text
        https://bugs.webkit.org/show_bug.cgi?id=63093

        Test: fast/css/color-leakage.html

        * platform/graphics/cg/GraphicsContextCG.cpp: Swap out CGContextSave/Restore with
        GraphicsContext::save/restore to keep the context in sync with its CG context
        (WebCore::GraphicsContext::beginTransparencyLayer): Added save(), removed redundant calls.
        (WebCore::GraphicsContext::endTransparencyLayer): Added restore(), removed redundant calls.
2011-06-21  Matthew Delaney  <mdela...@apple.com>

        Reviewed by Simon Fraser.

        beginTransparencyLayer leaves context color out of sync, bleeds color into text
        https://bugs.webkit.org/show_bug.cgi?id=63093

        * fast/css/color-leakage.html: Added pixel regression test that previously would have the
          border's color spilling into the text.
        * platform/mac/fast/css/color-leakage-expected.png: Added.
        * platform/mac/fast/css/color-leakage-expected.txt: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (89396 => 89397)


--- trunk/LayoutTests/ChangeLog	2011-06-22 00:26:01 UTC (rev 89396)
+++ trunk/LayoutTests/ChangeLog	2011-06-22 00:40:41 UTC (rev 89397)
@@ -1,3 +1,15 @@
+2011-06-21  Matthew Delaney  <mdela...@apple.com>
+
+        Reviewed by Simon Fraser.
+
+        beginTransparencyLayer leaves context color out of sync, bleeds color into text
+        https://bugs.webkit.org/show_bug.cgi?id=63093
+
+        * fast/css/color-leakage.html: Added pixel regression test that previously would have the
+          border's color spilling into the text.
+        * platform/mac/fast/css/color-leakage-expected.png: Added.
+        * platform/mac/fast/css/color-leakage-expected.txt: Added.
+
 2011-06-21  Tony Chang  <t...@chromium.org>
 
         Reviewed by Eric Seidel.

Added: trunk/LayoutTests/fast/css/color-leakage.html (0 => 89397)


--- trunk/LayoutTests/fast/css/color-leakage.html	                        (rev 0)
+++ trunk/LayoutTests/fast/css/color-leakage.html	2011-06-22 00:40:41 UTC (rev 89397)
@@ -0,0 +1,25 @@
+<html>
+  <head>
+  <!-- The Ahem font rendered in this test should be displayed black, not blue. -->
+    <style>
+      @font-face {
+        font-family: 'Ahem';
+        src: url('resources/Ahem.ttf');
+      }
+      div {
+        display: block;
+        font-family: Ahem;
+        font-size: 30px;
+        color: black;
+        border-top: 5px solid blue;
+        border-bottom: 5px solid rgba(0,0,0,0.9);
+        width: 650px;
+      }
+    </style>
+</head>
+<body>
+  <div>
+    This should be black.
+  </div>
+</body>
+</html>

Added: trunk/LayoutTests/platform/mac/fast/css/color-leakage-expected.png


(Binary files differ)
Property changes on: trunk/LayoutTests/platform/mac/fast/css/color-leakage-expected.png ___________________________________________________________________

Added: svn:mime-type

Added: trunk/LayoutTests/platform/mac/fast/css/color-leakage-expected.txt (0 => 89397)


--- trunk/LayoutTests/platform/mac/fast/css/color-leakage-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/mac/fast/css/color-leakage-expected.txt	2011-06-22 00:40:41 UTC (rev 89397)
@@ -0,0 +1,8 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  RenderBlock {HTML} at (0,0) size 800x600
+    RenderBody {BODY} at (8,8) size 784x584
+      RenderBlock {DIV} at (0,0) size 650x40 [border: (5px solid #0000FF) none (5px solid #000000E6) none]
+        RenderText {#text} at (0,5) size 630x30
+          text run at (0,5) width 630: "This should be black."

Modified: trunk/Source/WebCore/ChangeLog (89396 => 89397)


--- trunk/Source/WebCore/ChangeLog	2011-06-22 00:26:01 UTC (rev 89396)
+++ trunk/Source/WebCore/ChangeLog	2011-06-22 00:40:41 UTC (rev 89397)
@@ -1,3 +1,17 @@
+2011-06-21  Matthew Delaney  <mdela...@apple.com>
+
+        Reviewed by Simon Fraser.
+
+        beginTransparencyLayer leaves context color out of sync, bleeds color into text
+        https://bugs.webkit.org/show_bug.cgi?id=63093
+
+        Test: fast/css/color-leakage.html
+
+        * platform/graphics/cg/GraphicsContextCG.cpp: Swap out CGContextSave/Restore with
+        GraphicsContext::save/restore to keep the context in sync with its CG context
+        (WebCore::GraphicsContext::beginTransparencyLayer): Added save(), removed redundant calls.
+        (WebCore::GraphicsContext::endTransparencyLayer): Added restore(), removed redundant calls.
+
 2011-06-21  Tony Chang  <t...@chromium.org>
 
         Reviewed by Eric Seidel.

Modified: trunk/Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp (89396 => 89397)


--- trunk/Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp	2011-06-22 00:26:01 UTC (rev 89396)
+++ trunk/Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp	2011-06-22 00:40:41 UTC (rev 89397)
@@ -894,8 +894,10 @@
 {
     if (paintingDisabled())
         return;
+
+    save();
+
     CGContextRef context = platformContext();
-    CGContextSaveGState(context);
     CGContextSetAlpha(context, opacity);
     CGContextBeginTransparencyLayer(context, 0);
     m_data->beginTransparencyLayer();
@@ -908,9 +910,9 @@
         return;
     CGContextRef context = platformContext();
     CGContextEndTransparencyLayer(context);
-    CGContextRestoreGState(context);
     m_data->endTransparencyLayer();
-    m_data->m_userToDeviceTransformKnownToBeIdentity = false;
+
+    restore();
 }
 
 void GraphicsContext::setPlatformShadow(const FloatSize& offset, float blur, const Color& color, ColorSpace colorSpace)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to