Nonopaque layers double-paint with UI-side compositing
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 24 Apr 2014 03:31:28 +0000 (03:31 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 24 Apr 2014 03:31:28 +0000 (03:31 +0000)
https://bugs.webkit.org/show_bug.cgi?id=132101

Reviewed by Tim Horton.

The non-IOSurface code path was failing to clear the backing store
before painting.

* Shared/mac/RemoteLayerBackingStore.mm:
(WebKit::RemoteLayerBackingStore::display):
(WebKit::RemoteLayerBackingStore::drawInContext):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@167739 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit2/ChangeLog
Source/WebKit2/Shared/mac/RemoteLayerBackingStore.mm

index 3b4172e..2bd5e25 100644 (file)
@@ -1,3 +1,17 @@
+2014-04-23  Simon Fraser  <simon.fraser@apple.com>
+
+        Nonopaque layers double-paint with UI-side compositing
+        https://bugs.webkit.org/show_bug.cgi?id=132101
+
+        Reviewed by Tim Horton.
+        
+        The non-IOSurface code path was failing to clear the backing store
+        before painting.
+
+        * Shared/mac/RemoteLayerBackingStore.mm:
+        (WebKit::RemoteLayerBackingStore::display):
+        (WebKit::RemoteLayerBackingStore::drawInContext):
+
 2014-04-23  Benjamin Poulain  <bpoulain@apple.com>
 
         [iOS][WK2] Image and text documents sometime gets the webpage viewport configuration
index a722667..ba76f68 100644 (file)
@@ -212,14 +212,6 @@ bool RemoteLayerBackingStore::display()
 
         GraphicsContext& context = m_frontSurface->ensureGraphicsContext();
 
-        if (!m_isOpaque)
-            context.clearRect(expandedScaledLayerBounds);
-
-#ifndef NDEBUG
-        if (m_isOpaque)
-            context.fillRect(expandedScaledLayerBounds, Color(255, 0, 0), ColorSpaceDeviceRGB);
-#endif
-
         context.scale(FloatSize(1, -1));
         context.translate(0, -expandedScaledSize.height());
         drawInContext(context, backImage.get());
@@ -251,6 +243,14 @@ void RemoteLayerBackingStore::drawInContext(GraphicsContext& context, CGImageRef
     IntRect layerBounds(IntPoint(), m_size);
     IntRect scaledLayerBounds(IntPoint(), expandedIntSize(m_size * m_scale));
 
+    if (!m_isOpaque)
+        context.clearRect(scaledLayerBounds);
+
+#ifndef NDEBUG
+    if (m_isOpaque)
+        context.fillRect(scaledLayerBounds, Color(255, 0, 0), ColorSpaceDeviceRGB);
+#endif
+
     CGContextRef cgContext = context.platformContext();
 
     // If we have less than webLayerMaxRectsToPaint rects to paint and they cover less