Title: [198522] trunk/Source/WebKit2
Revision
198522
Author
[email protected]
Date
2016-03-22 00:28:06 -0700 (Tue, 22 Mar 2016)

Log Message

[CoordinatedGraphics] Prefer RunLoop::main().dispatch() over callOnMainThread()
https://bugs.webkit.org/show_bug.cgi?id=155725

Reviewed by Darin Adler.

Unify the CoordinatedGraphics code in the WebKit2 layer to use RunLoop
for dispatching tasks on either the main thread or the composition thread
in case of using the threaded compositor. The latter is already the default,
so this patch just replaces calls to callOnMainThread() with calls to
RunLoop::main().dispatch().

* Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
(WebKit::CoordinatedGraphicsScene::dispatchOnMainThread):
* Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
(WebKit::ThreadedCompositor::didChangeVisibleRect):

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (198521 => 198522)


--- trunk/Source/WebKit2/ChangeLog	2016-03-22 07:26:21 UTC (rev 198521)
+++ trunk/Source/WebKit2/ChangeLog	2016-03-22 07:28:06 UTC (rev 198522)
@@ -1,3 +1,21 @@
+2016-03-22  Zan Dobersek  <[email protected]>
+
+        [CoordinatedGraphics] Prefer RunLoop::main().dispatch() over callOnMainThread()
+        https://bugs.webkit.org/show_bug.cgi?id=155725
+
+        Reviewed by Darin Adler.
+
+        Unify the CoordinatedGraphics code in the WebKit2 layer to use RunLoop
+        for dispatching tasks on either the main thread or the composition thread
+        in case of using the threaded compositor. The latter is already the default,
+        so this patch just replaces calls to callOnMainThread() with calls to
+        RunLoop::main().dispatch().
+
+        * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
+        (WebKit::CoordinatedGraphicsScene::dispatchOnMainThread):
+        * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
+        (WebKit::ThreadedCompositor::didChangeVisibleRect):
+
 2016-03-18  Enrica Casucci  <[email protected]>
 
         Enable preview of images as attachments.

Modified: trunk/Source/WebKit2/Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp (198521 => 198522)


--- trunk/Source/WebKit2/Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp	2016-03-22 07:26:21 UTC (rev 198521)
+++ trunk/Source/WebKit2/Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp	2016-03-22 07:28:06 UTC (rev 198522)
@@ -29,7 +29,6 @@
 #include <WebCore/TextureMapperGL.h>
 #include <WebCore/TextureMapperLayer.h>
 #include <wtf/Atomics.h>
-#include <wtf/MainThread.h>
 
 using namespace WebCore;
 
@@ -40,7 +39,7 @@
     if (isMainThread())
         function();
     else
-        callOnMainThread(WTFMove(function));
+        RunLoop::main().dispatch(WTFMove(function));
 }
 
 void CoordinatedGraphicsScene::dispatchOnClientRunLoop(std::function<void()> function)

Modified: trunk/Source/WebKit2/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp (198521 => 198522)


--- trunk/Source/WebKit2/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp	2016-03-22 07:26:21 UTC (rev 198521)
+++ trunk/Source/WebKit2/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp	2016-03-22 07:28:06 UTC (rev 198522)
@@ -252,7 +252,7 @@
 {
     FloatRect visibleRect = viewportController()->visibleContentsRect();
     float scale = viewportController()->pageScaleFactor();
-    callOnMainThread([=] {
+    RunLoop::main().dispatch([=] {
         m_client->setVisibleContentsRect(visibleRect, FloatPoint::zero(), scale);
     });
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to