Title: [201859] trunk/Source/WebKit2
Revision
201859
Author
[email protected]
Date
2016-06-09 05:07:38 -0700 (Thu, 09 Jun 2016)

Log Message

[Threaded Compositor] Remove ThreadedCompositor::setNeedsDisplay()
https://bugs.webkit.org/show_bug.cgi?id=158523

Reviewed by Michael Catanzaro.

ThreadedCompositor::setNeedsDisplay() is always called from the main thread and schedules a task to the
compositing thread to schedule an immediate update. But RunLoop::Timer is thread-safe so we don't really need to
schedule a task to the update the timer in the compositing thread, we can do that directly in the main
thread. And that's exactly what scheduleDisplayImmediately() does, so we can use it instead of setNeedsDisplay().

* Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
(WebKit::ThreadedCompositor::setNeedsDisplay(): Deleted.
(WebKit::ThreadedCompositor::updateSceneState):
* Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (201858 => 201859)


--- trunk/Source/WebKit2/ChangeLog	2016-06-09 09:09:50 UTC (rev 201858)
+++ trunk/Source/WebKit2/ChangeLog	2016-06-09 12:07:38 UTC (rev 201859)
@@ -1,3 +1,20 @@
+2016-06-09  Carlos Garcia Campos  <[email protected]>
+
+        [Threaded Compositor] Remove ThreadedCompositor::setNeedsDisplay()
+        https://bugs.webkit.org/show_bug.cgi?id=158523
+
+        Reviewed by Michael Catanzaro.
+
+        ThreadedCompositor::setNeedsDisplay() is always called from the main thread and schedules a task to the
+        compositing thread to schedule an immediate update. But RunLoop::Timer is thread-safe so we don't really need to
+        schedule a task to the update the timer in the compositing thread, we can do that directly in the main
+        thread. And that's exactly what scheduleDisplayImmediately() does, so we can use it instead of setNeedsDisplay().
+
+        * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
+        (WebKit::ThreadedCompositor::setNeedsDisplay(): Deleted.
+        (WebKit::ThreadedCompositor::updateSceneState):
+        * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
+
 2016-06-08  Antti Koivisto  <[email protected]>
 
         Increase disk cache capacity when there is lots of free space

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


--- trunk/Source/WebKit2/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp	2016-06-09 09:09:50 UTC (rev 201858)
+++ trunk/Source/WebKit2/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp	2016-06-09 12:07:38 UTC (rev 201859)
@@ -61,14 +61,6 @@
     terminateCompositingThread();
 }
 
-void ThreadedCompositor::setNeedsDisplay()
-{
-    RefPtr<ThreadedCompositor> protector(this);
-    callOnCompositingThread([protector] {
-        protector->scheduleDisplayImmediately();
-    });
-}
-
 void ThreadedCompositor::setNativeSurfaceHandleForCompositing(uint64_t handle)
 {
     RefPtr<ThreadedCompositor> protector(this);
@@ -221,7 +213,7 @@
         scene->commitSceneState(state);
     });
 
-    setNeedsDisplay();
+    scheduleDisplayImmediately();
 }
 
 void ThreadedCompositor::callOnCompositingThread(std::function<void()>&& function)

Modified: trunk/Source/WebKit2/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h (201858 => 201859)


--- trunk/Source/WebKit2/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h	2016-06-09 09:09:50 UTC (rev 201858)
+++ trunk/Source/WebKit2/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h	2016-06-09 12:07:38 UTC (rev 201859)
@@ -64,8 +64,6 @@
     static Ref<ThreadedCompositor> create(Client*);
     virtual ~ThreadedCompositor();
 
-    void setNeedsDisplay();
-
     void setNativeSurfaceHandleForCompositing(uint64_t);
     void setDeviceScaleFactor(float);
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to