Title: [269842] trunk/Source/WebKit
Revision
269842
Author
[email protected]
Date
2020-11-16 02:06:59 -0800 (Mon, 16 Nov 2020)

Log Message

[CoordinatedGraphics] Adjust client resizing, render-scope notifying in ThreadedCompositor::renderLayerTree()
https://bugs.webkit.org/show_bug.cgi?id=218701

Reviewed by Carlos Garcia Campos.

Rework the client operations in ThreadedCompositor::renderLayerTree() so
that client resizing is done before the will-render client notification
is dispatched. This ensures everything in the will-render-to-did-render
scope is done for a well-specified size from the client's point of view.

Similar to this change, the GL viewport update is split from the client
resize operation and moved into the aforementioned rendering scope. This
change is mostly cosmetic, but it's done to neatly package all the GL
operations into that scope.

* Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
(WebKit::ThreadedCompositor::renderLayerTree):

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (269841 => 269842)


--- trunk/Source/WebKit/ChangeLog	2020-11-16 10:05:32 UTC (rev 269841)
+++ trunk/Source/WebKit/ChangeLog	2020-11-16 10:06:59 UTC (rev 269842)
@@ -1,3 +1,23 @@
+2020-11-16  Zan Dobersek  <[email protected]>
+
+        [CoordinatedGraphics] Adjust client resizing, render-scope notifying in ThreadedCompositor::renderLayerTree()
+        https://bugs.webkit.org/show_bug.cgi?id=218701
+
+        Reviewed by Carlos Garcia Campos.
+
+        Rework the client operations in ThreadedCompositor::renderLayerTree() so
+        that client resizing is done before the will-render client notification
+        is dispatched. This ensures everything in the will-render-to-did-render
+        scope is done for a well-specified size from the client's point of view.
+
+        Similar to this change, the GL viewport update is split from the client
+        resize operation and moved into the aforementioned rendering scope. This
+        change is mostly cosmetic, but it's done to neatly package all the GL
+        operations into that scope.
+
+        * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
+        (WebKit::ThreadedCompositor::renderLayerTree):
+
 2020-11-15  Tim Horton  <[email protected]>
 
         Initial implementation of DOM rendering via the GPU process

Modified: trunk/Source/WebKit/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp (269841 => 269842)


--- trunk/Source/WebKit/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp	2020-11-16 10:05:32 UTC (rev 269841)
+++ trunk/Source/WebKit/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp	2020-11-16 10:06:59 UTC (rev 269842)
@@ -176,8 +176,6 @@
     if (!m_context || !m_context->makeContextCurrent())
         return;
 
-    m_client.willRenderFrame();
-
     // Retrieve the scene attributes in a thread-safe manner.
     WebCore::IntSize viewportSize;
     WebCore::IntPoint scrollPosition;
@@ -204,15 +202,23 @@
         m_attributes.needsResize = false;
     }
 
-    if (needsResize) {
-        m_client.resize(viewportSize);
-        glViewport(0, 0, viewportSize.width(), viewportSize.height());
-    }
-
     TransformationMatrix viewportTransform;
     viewportTransform.scale(scaleFactor);
     viewportTransform.translate(-scrollPosition.x(), -scrollPosition.y());
 
+    // Resize the client, if necessary, before the will-render-frame call is dispatched.
+    // GL viewport is updated separately, if necessary. This establishes sequencing where
+    // everything inside the will-render and did-render scope is done for a constant-sized scene,
+    // and similarly all GL operations are done inside that specific scope.
+
+    if (needsResize)
+        m_client.resize(viewportSize);
+
+    m_client.willRenderFrame();
+
+    if (needsResize)
+        glViewport(0, 0, viewportSize.width(), viewportSize.height());
+
     glClearColor(0, 0, 0, 0);
     glClear(GL_COLOR_BUFFER_BIT);
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to