Title: [269895] trunk
Revision
269895
Author
[email protected]
Date
2020-11-17 00:28:31 -0800 (Tue, 17 Nov 2020)

Log Message

REGRESSION (r269824): YouTube media control bar sometimes flickers
https://bugs.webkit.org/show_bug.cgi?id=219017
<rdar://problem/71454799>

Reviewed by Simon Fraser.

Source/WebKit:

Test: compositing/repaint/transparent-layer-repaint.html

* Shared/RemoteLayerTree/RemoteLayerBackingStore.mm:
(WebKit::RemoteLayerBackingStore::display):
I accidentally lost the Copy composite operator in r269824, causing
the repaint copy-forward to blend instead of just copying.
This wreaks havoc on layers with contents with colors that have 0 < alpha < 1,
because every repaint means the colors intensify.

LayoutTests:

* compositing/repaint/transparent-layer-repaint-expected.html: Added.
* compositing/repaint/transparent-layer-repaint.html: Added.
Add a test that:
    - repaints a backingstoreful compositing layer
    - more than once
    - in a small enough area that we use partial repaint
    - with partially-transparent pixels

And then ensures that the background of that layer (the non-repainted part)
remains the color that it should.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (269894 => 269895)


--- trunk/LayoutTests/ChangeLog	2020-11-17 08:22:08 UTC (rev 269894)
+++ trunk/LayoutTests/ChangeLog	2020-11-17 08:28:31 UTC (rev 269895)
@@ -1,3 +1,22 @@
+2020-11-17  Tim Horton  <[email protected]>
+
+        REGRESSION (r269824): YouTube media control bar sometimes flickers
+        https://bugs.webkit.org/show_bug.cgi?id=219017
+        <rdar://problem/71454799>
+
+        Reviewed by Simon Fraser.
+
+        * compositing/repaint/transparent-layer-repaint-expected.html: Added.
+        * compositing/repaint/transparent-layer-repaint.html: Added.
+        Add a test that:
+            - repaints a backingstoreful compositing layer
+            - more than once
+            - in a small enough area that we use partial repaint
+            - with partially-transparent pixels
+
+        And then ensures that the background of that layer (the non-repainted part)
+        remains the color that it should.
+
 2020-11-17  Rob Buis  <[email protected]>
 
         Check whether destination still can be selected

Added: trunk/LayoutTests/compositing/repaint/transparent-layer-repaint-expected.html (0 => 269895)


--- trunk/LayoutTests/compositing/repaint/transparent-layer-repaint-expected.html	                        (rev 0)
+++ trunk/LayoutTests/compositing/repaint/transparent-layer-repaint-expected.html	2020-11-17 08:28:31 UTC (rev 269895)
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html>
+<head>
+  <style>
+    .container {
+        border: 1px solid black; /* Needed to disable simple color layer compositing. */
+        height: 200px;
+        width: 200px;
+        transform: translateZ(0);
+        background-color: rgba(0, 255, 0, 0.2);
+    }
+  </style>
+</head>
+<body>
+    <p>Test for repaint in a transparent composited layer. The two squares below should be identical, green @ 20% alpha.</p>
+  <div class="container"></div>
+  <div class="container"></div>
+</body>
+</html>

Added: trunk/LayoutTests/compositing/repaint/transparent-layer-repaint.html (0 => 269895)


--- trunk/LayoutTests/compositing/repaint/transparent-layer-repaint.html	                        (rev 0)
+++ trunk/LayoutTests/compositing/repaint/transparent-layer-repaint.html	2020-11-17 08:28:31 UTC (rev 269895)
@@ -0,0 +1,45 @@
+<!DOCTYPE html>
+<html>
+<head>
+  <style>
+    .container {
+        border: 1px solid black; /* Needed to disable simple color layer compositing. */
+        height: 200px;
+        width: 200px;
+        transform: translateZ(0);
+        background-color: rgba(0, 255, 0, 0.2);
+    }
+    
+    #test {
+        margin: 5px;
+        height: 5px;
+        width: 5px;
+        background-color: red;
+    }
+  </style>
+  <script src=""
+  <script>
+    async function doTest() {
+        for (var i = 0; i < 5; i++) {
+            document.getElementById('test').style.backgroundColor = 'red';
+            await UIHelper.renderingUpdate();
+            document.getElementById('test').style.backgroundColor = 'transparent';
+            await UIHelper.renderingUpdate();
+        }
+        if (window.testRunner)
+            testRunner.notifyDone();
+    }
+    if (window.testRunner)
+        testRunner.waitUntilDone();
+    window.addEventListener('load', doTest);
+  </script>
+</head>
+<body>
+    <p>Test for repaint in a transparent composited layer. The two squares below should be identical, green @ 20% alpha.</p>
+    <div class="container">
+        <div id="test"></div>
+    </div>
+    <div class="container">
+    </div>
+</body>
+</html>

Modified: trunk/Source/WebKit/ChangeLog (269894 => 269895)


--- trunk/Source/WebKit/ChangeLog	2020-11-17 08:22:08 UTC (rev 269894)
+++ trunk/Source/WebKit/ChangeLog	2020-11-17 08:28:31 UTC (rev 269895)
@@ -1,3 +1,20 @@
+2020-11-17  Tim Horton  <[email protected]>
+
+        REGRESSION (r269824): YouTube media control bar sometimes flickers
+        https://bugs.webkit.org/show_bug.cgi?id=219017
+        <rdar://problem/71454799>
+
+        Reviewed by Simon Fraser.
+
+        Test: compositing/repaint/transparent-layer-repaint.html
+
+        * Shared/RemoteLayerTree/RemoteLayerBackingStore.mm:
+        (WebKit::RemoteLayerBackingStore::display):
+        I accidentally lost the Copy composite operator in r269824, causing
+        the repaint copy-forward to blend instead of just copying.
+        This wreaks havoc on layers with contents with colors that have 0 < alpha < 1,
+        because every repaint means the colors intensify.
+
 2020-11-16  Brent Fulgham  <[email protected]>
 
         [macOS] Remove access to the unused AppleIntelMEUserClient IOKit class

Modified: trunk/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerBackingStore.mm (269894 => 269895)


--- trunk/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerBackingStore.mm	2020-11-17 08:22:08 UTC (rev 269894)
+++ trunk/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerBackingStore.mm	2020-11-17 08:28:31 UTC (rev 269895)
@@ -251,7 +251,7 @@
 
     if (!m_dirtyRegion.contains(layerBounds)) {
         ASSERT(m_backBuffer.imageBuffer);
-        context.drawImageBuffer(*m_backBuffer.imageBuffer, { 0, 0 });
+        context.drawImageBuffer(*m_backBuffer.imageBuffer, { 0, 0 }, { WebCore::CompositeOperator::Copy });
     }
 
     if (m_paintingRects.size() == 1) {
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to