Title: [273990] branches/safari-612.1.5-branch/Source/WebKit
Revision
273990
Author
rubent...@apple.com
Date
2021-03-05 11:51:22 -0800 (Fri, 05 Mar 2021)

Log Message

Cherry-pick r273543. rdar://problem/75101709

    REGRESSION (r269824): macCatalyst WKWebView shows chunks of other tiles in the middle of content
    https://bugs.webkit.org/show_bug.cgi?id=222460
    <rdar://problem/74102753>

    Reviewed by Simon Fraser.

    * Shared/RemoteLayerTree/RemoteLayerBackingStore.mm:
    (WebKit::RemoteLayerBackingStore::swapToValidFrontBuffer):
    Reinstate some code that was accidentally deleted in r269824 that ensures
    that we do not use an in-use IOSurface as our front buffer, so that
    we don't paint into it while it's being composited in the render server.

    Also, add some comments, since this code is all a little confusing
    with its fronts and backs.

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

Modified Paths

Diff

Modified: branches/safari-612.1.5-branch/Source/WebKit/ChangeLog (273989 => 273990)


--- branches/safari-612.1.5-branch/Source/WebKit/ChangeLog	2021-03-05 19:51:19 UTC (rev 273989)
+++ branches/safari-612.1.5-branch/Source/WebKit/ChangeLog	2021-03-05 19:51:22 UTC (rev 273990)
@@ -1,5 +1,44 @@
 2021-03-05  Ruben Turcios  <rubent...@apple.com>
 
+        Cherry-pick r273543. rdar://problem/75101709
+
+    REGRESSION (r269824): macCatalyst WKWebView shows chunks of other tiles in the middle of content
+    https://bugs.webkit.org/show_bug.cgi?id=222460
+    <rdar://problem/74102753>
+    
+    Reviewed by Simon Fraser.
+    
+    * Shared/RemoteLayerTree/RemoteLayerBackingStore.mm:
+    (WebKit::RemoteLayerBackingStore::swapToValidFrontBuffer):
+    Reinstate some code that was accidentally deleted in r269824 that ensures
+    that we do not use an in-use IOSurface as our front buffer, so that
+    we don't paint into it while it's being composited in the render server.
+    
+    Also, add some comments, since this code is all a little confusing
+    with its fronts and backs.
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@273543 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2021-02-26  Tim Horton  <timothy_hor...@apple.com>
+
+            REGRESSION (r269824): macCatalyst WKWebView shows chunks of other tiles in the middle of content
+            https://bugs.webkit.org/show_bug.cgi?id=222460
+            <rdar://problem/74102753>
+
+            Reviewed by Simon Fraser.
+
+            * Shared/RemoteLayerTree/RemoteLayerBackingStore.mm:
+            (WebKit::RemoteLayerBackingStore::swapToValidFrontBuffer):
+            Reinstate some code that was accidentally deleted in r269824 that ensures
+            that we do not use an in-use IOSurface as our front buffer, so that
+            we don't paint into it while it's being composited in the render server.
+
+            Also, add some comments, since this code is all a little confusing
+            with its fronts and backs.
+
+2021-03-05  Ruben Turcios  <rubent...@apple.com>
+
         Cherry-pick r273286. rdar://problem/75101889
 
     [Cocoa] Send sandbox extensions for Network Extension services in load parameters

Modified: branches/safari-612.1.5-branch/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerBackingStore.mm (273989 => 273990)


--- branches/safari-612.1.5-branch/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerBackingStore.mm	2021-03-05 19:51:19 UTC (rev 273989)
+++ branches/safari-612.1.5-branch/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerBackingStore.mm	2021-03-05 19:51:22 UTC (rev 273990)
@@ -175,6 +175,21 @@
 
 void RemoteLayerBackingStore::swapToValidFrontBuffer()
 {
+    // Sometimes, we can get two swaps ahead of the render server.
+    // If we're using shared IOSurfaces, we must wait to modify
+    // a surface until it no longer has outstanding clients.
+    if (m_acceleratesDrawing) {
+        if (!m_backBuffer.imageBuffer || m_backBuffer.imageBuffer->isInUse()) {
+            std::swap(m_backBuffer, m_secondaryBackBuffer);
+
+            // When pulling the secondary back buffer out of hibernation (to become
+            // the new front buffer), if it is somehow still in use (e.g. we got
+            // three swaps ahead of the render server), just give up and discard it.
+            if (m_backBuffer.imageBuffer && m_backBuffer.imageBuffer->isInUse())
+                m_backBuffer.discard();
+        }
+    }
+
     std::swap(m_frontBuffer, m_backBuffer);
 
     if (m_frontBuffer.imageBuffer)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to