Title: [282154] branches/safari-612-branch/Source/WebKit
Revision
282154
Author
[email protected]
Date
2021-09-08 10:22:37 -0700 (Wed, 08 Sep 2021)

Log Message

Cherry-pick r282090. rdar://problem/82877535

    Post-layout `EditorState` updates should be scheduled using `RenderingUpdateScheduler`
    https://bugs.webkit.org/show_bug.cgi?id=229905

    Reviewed by Simon Fraser.

    Use `Page::scheduleRenderingUpdate` rather than `DrawingArea::triggerRenderingUpdate` to ensure that we schedule
    a layer tree flush when sending a full post-layout `EditorState` update to the UI process. On macOS, the latter
    method on DrawingArea will immediately install a runloop observer for the next CA commit, while the former only
    does so after a zero-delay timer fires, courtesy of RenderingUpdateScheduler.

    This prevents us from triggering unnecessary layer tree flushes in the case where the selection changes
    frequently during a single rendering update; in particular, in Speedometer 2 on macOS, this decreases the total
    number of rendering updates performed over the course of the benchmark by roughly 30%.

    * WebProcess/WebPage/WebPage.cpp:
    (WebKit::WebPage::scheduleFullEditorStateUpdate):

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

Modified Paths

Diff

Modified: branches/safari-612-branch/Source/WebKit/ChangeLog (282153 => 282154)


--- branches/safari-612-branch/Source/WebKit/ChangeLog	2021-09-08 17:22:34 UTC (rev 282153)
+++ branches/safari-612-branch/Source/WebKit/ChangeLog	2021-09-08 17:22:37 UTC (rev 282154)
@@ -1,5 +1,48 @@
 2021-09-08  Alan Coon  <[email protected]>
 
+        Cherry-pick r282090. rdar://problem/82877535
+
+    Post-layout `EditorState` updates should be scheduled using `RenderingUpdateScheduler`
+    https://bugs.webkit.org/show_bug.cgi?id=229905
+    
+    Reviewed by Simon Fraser.
+    
+    Use `Page::scheduleRenderingUpdate` rather than `DrawingArea::triggerRenderingUpdate` to ensure that we schedule
+    a layer tree flush when sending a full post-layout `EditorState` update to the UI process. On macOS, the latter
+    method on DrawingArea will immediately install a runloop observer for the next CA commit, while the former only
+    does so after a zero-delay timer fires, courtesy of RenderingUpdateScheduler.
+    
+    This prevents us from triggering unnecessary layer tree flushes in the case where the selection changes
+    frequently during a single rendering update; in particular, in Speedometer 2 on macOS, this decreases the total
+    number of rendering updates performed over the course of the benchmark by roughly 30%.
+    
+    * WebProcess/WebPage/WebPage.cpp:
+    (WebKit::WebPage::scheduleFullEditorStateUpdate):
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@282090 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2021-09-07  Wenson Hsieh  <[email protected]>
+
+            Post-layout `EditorState` updates should be scheduled using `RenderingUpdateScheduler`
+            https://bugs.webkit.org/show_bug.cgi?id=229905
+
+            Reviewed by Simon Fraser.
+
+            Use `Page::scheduleRenderingUpdate` rather than `DrawingArea::triggerRenderingUpdate` to ensure that we schedule
+            a layer tree flush when sending a full post-layout `EditorState` update to the UI process. On macOS, the latter
+            method on DrawingArea will immediately install a runloop observer for the next CA commit, while the former only
+            does so after a zero-delay timer fires, courtesy of RenderingUpdateScheduler.
+
+            This prevents us from triggering unnecessary layer tree flushes in the case where the selection changes
+            frequently during a single rendering update; in particular, in Speedometer 2 on macOS, this decreases the total
+            number of rendering updates performed over the course of the benchmark by roughly 30%.
+
+            * WebProcess/WebPage/WebPage.cpp:
+            (WebKit::WebPage::scheduleFullEditorStateUpdate):
+
+2021-09-08  Alan Coon  <[email protected]>
+
         Cherry-pick r281965. rdar://problem/82877374
 
     Gracefully recover from WebAuthnProcess crashes

Modified: branches/safari-612-branch/Source/WebKit/WebProcess/WebPage/WebPage.cpp (282153 => 282154)


--- branches/safari-612-branch/Source/WebKit/WebProcess/WebPage/WebPage.cpp	2021-09-08 17:22:34 UTC (rev 282153)
+++ branches/safari-612-branch/Source/WebKit/WebProcess/WebPage/WebPage.cpp	2021-09-08 17:22:37 UTC (rev 282154)
@@ -6514,9 +6514,7 @@
     else
         m_pendingEditorStateUpdateStatus = PendingEditorStateUpdateStatus::Scheduled;
 
-    // FIXME: Scheduling a compositing layer flush here can be more expensive than necessary.
-    // Instead, we should just compute and send post-layout editor state during the next frame.
-    m_drawingArea->triggerRenderingUpdate();
+    m_page->scheduleRenderingUpdate(RenderingUpdateStep::LayerFlush);
 }
 
 #if HAVE(TOUCH_BAR)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to