[Threaded Compositor] SHOULD NEVER BE REACHED in WebKit::CompositingRunLoop::updateCo...
authorcarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 4 May 2017 12:42:13 +0000 (12:42 +0000)
committercarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 4 May 2017 12:42:13 +0000 (12:42 +0000)
https://bugs.webkit.org/show_bug.cgi?id=171336

Reviewed by Michael Catanzaro.

We are assuming that all calls to ThreadedCompositor::renderLayerTree() happen because of an scheduled update,
but that's not true in the case of ThreadedCompositor::forceRepaint(). In that case we never want to call
CompositingRunLoop::updateCompleted().

* Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
(WebKit::ThreadedCompositor::forceRepaint):
(WebKit::ThreadedCompositor::sceneUpdateFinished):
* Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:

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

Source/WebKit2/ChangeLog
Source/WebKit2/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp
Source/WebKit2/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h

index b1c7359..5fb0e04 100644 (file)
@@ -1,3 +1,19 @@
+2017-05-04  Carlos Garcia Campos  <cgarcia@igalia.com>
+
+        [Threaded Compositor] SHOULD NEVER BE REACHED in WebKit::CompositingRunLoop::updateCompleted
+        https://bugs.webkit.org/show_bug.cgi?id=171336
+
+        Reviewed by Michael Catanzaro.
+
+        We are assuming that all calls to ThreadedCompositor::renderLayerTree() happen because of an scheduled update,
+        but that's not true in the case of ThreadedCompositor::forceRepaint(). In that case we never want to call
+        CompositingRunLoop::updateCompleted().
+
+        * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
+        (WebKit::ThreadedCompositor::forceRepaint):
+        (WebKit::ThreadedCompositor::sceneUpdateFinished):
+        * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
+
 2017-05-04  David Kilzer  <ddkilzer@apple.com>
 
         check-webkit-style exits with an error while parsing Source/WebKit2/Scripts/webkit/ directory: KeyError: 'st'
index 6ffeb3d..b820844 100644 (file)
@@ -32,6 +32,7 @@
 #include "ThreadedDisplayRefreshMonitor.h"
 #include <WebCore/PlatformDisplay.h>
 #include <WebCore/TransformationMatrix.h>
+#include <wtf/SetForScope.h>
 
 #if USE(OPENGL_ES_2)
 #include <GLES2/gl2.h>
@@ -180,6 +181,7 @@ void ThreadedCompositor::updateViewport()
 void ThreadedCompositor::forceRepaint()
 {
     m_compositingRunLoop->performTaskSync([this, protectedThis = makeRef(*this)] {
+        SetForScope<bool> change(m_inForceRepaint, true);
         renderLayerTree();
     });
 }
@@ -222,7 +224,7 @@ void ThreadedCompositor::sceneUpdateFinished()
 
     if (shouldDispatchDisplayRefreshCallback)
         m_displayRefreshMonitor->dispatchDisplayRefreshCallback();
-    if (!shouldCoordinateUpdateCompletionWithClient)
+    if (!shouldCoordinateUpdateCompletionWithClient && !m_inForceRepaint)
         m_compositingRunLoop->updateCompleted();
 }
 
index 683d987..c892acb 100644 (file)
@@ -112,6 +112,7 @@ private:
     ShouldDoFrameSync m_doFrameSync;
     WebCore::TextureMapper::PaintFlags m_paintFlags { 0 };
     bool m_needsResize { false };
+    bool m_inForceRepaint { false };
 
     std::unique_ptr<CompositingRunLoop> m_compositingRunLoop;