Title: [243983] releases/WebKitGTK/webkit-2.24/Source/WebKit
- Revision
- 243983
- Author
- [email protected]
- Date
- 2019-04-08 03:15:11 -0700 (Mon, 08 Apr 2019)
Log Message
Merge r242364 - [CoordinatedGraphics] The compositing loop is still running even after exiting AC mode
https://bugs.webkit.org/show_bug.cgi?id=195270
Patch by Carlos Garcia Campos <[email protected]> on 2019-03-04
Reviewed by Don Olmstead.
Suspend the threaded compositor when the painting is paused or layer flush disabled, and resume it again when
painting is resumed and layer flush enabled.
* Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
(WebKit::ThreadedCompositor::suspend): Increment the suspend counter and mark the scene as inactive if it was suspended.
(WebKit::ThreadedCompositor::resume): Decrement the suspend counter and mark the scene as active if it's now resumed.
* Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
* WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp:
(WebKit::DrawingAreaCoordinatedGraphics::forceRepaint): Return early if layer tree state is frozen.
(WebKit::DrawingAreaCoordinatedGraphics::forceRepaintAsync): Ditto.
* WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp:
(WebKit::LayerTreeHost::setLayerFlushSchedulingEnabled): Call ThreadedCompositor::suspend()/resume().
(WebKit::LayerTreeHost::pauseRendering): Call ThreadedCompositor::suspend.
(WebKit::LayerTreeHost::resumeRendering): Call ThreadedCompositor::resume().
Modified Paths
Diff
Modified: releases/WebKitGTK/webkit-2.24/Source/WebKit/ChangeLog (243982 => 243983)
--- releases/WebKitGTK/webkit-2.24/Source/WebKit/ChangeLog 2019-04-08 10:15:06 UTC (rev 243982)
+++ releases/WebKitGTK/webkit-2.24/Source/WebKit/ChangeLog 2019-04-08 10:15:11 UTC (rev 243983)
@@ -1,5 +1,27 @@
2019-03-04 Carlos Garcia Campos <[email protected]>
+ [CoordinatedGraphics] The compositing loop is still running even after exiting AC mode
+ https://bugs.webkit.org/show_bug.cgi?id=195270
+
+ Reviewed by Don Olmstead.
+
+ Suspend the threaded compositor when the painting is paused or layer flush disabled, and resume it again when
+ painting is resumed and layer flush enabled.
+
+ * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
+ (WebKit::ThreadedCompositor::suspend): Increment the suspend counter and mark the scene as inactive if it was suspended.
+ (WebKit::ThreadedCompositor::resume): Decrement the suspend counter and mark the scene as active if it's now resumed.
+ * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
+ * WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp:
+ (WebKit::DrawingAreaCoordinatedGraphics::forceRepaint): Return early if layer tree state is frozen.
+ (WebKit::DrawingAreaCoordinatedGraphics::forceRepaintAsync): Ditto.
+ * WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp:
+ (WebKit::LayerTreeHost::setLayerFlushSchedulingEnabled): Call ThreadedCompositor::suspend()/resume().
+ (WebKit::LayerTreeHost::pauseRendering): Call ThreadedCompositor::suspend.
+ (WebKit::LayerTreeHost::resumeRendering): Call ThreadedCompositor::resume().
+
+2019-03-04 Carlos Garcia Campos <[email protected]>
+
[CoordinatedGraphics] Unify DrawingArea classes
https://bugs.webkit.org/show_bug.cgi?id=195167
Modified: releases/WebKitGTK/webkit-2.24/Source/WebKit/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp (243982 => 243983)
--- releases/WebKitGTK/webkit-2.24/Source/WebKit/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp 2019-04-08 10:15:06 UTC (rev 243982)
+++ releases/WebKitGTK/webkit-2.24/Source/WebKit/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp 2019-04-08 10:15:11 UTC (rev 243983)
@@ -116,6 +116,28 @@
m_compositingRunLoop = nullptr;
}
+void ThreadedCompositor::suspend()
+{
+ if (++m_suspendedCount > 1)
+ return;
+
+ m_compositingRunLoop->stopUpdates();
+ m_compositingRunLoop->performTaskSync([this, protectedThis = makeRef(*this)] {
+ m_scene->setActive(false);
+ });
+}
+
+void ThreadedCompositor::resume()
+{
+ ASSERT(m_suspendedCount > 0);
+ if (--m_suspendedCount > 0)
+ return;
+
+ m_compositingRunLoop->performTaskSync([this, protectedThis = makeRef(*this)] {
+ m_scene->setActive(true);
+ });
+}
+
void ThreadedCompositor::setNativeSurfaceHandleForCompositing(uint64_t handle)
{
m_compositingRunLoop->stopUpdates();
Modified: releases/WebKitGTK/webkit-2.24/Source/WebKit/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h (243982 => 243983)
--- releases/WebKitGTK/webkit-2.24/Source/WebKit/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h 2019-04-08 10:15:06 UTC (rev 243982)
+++ releases/WebKitGTK/webkit-2.24/Source/WebKit/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h 2019-04-08 10:15:11 UTC (rev 243983)
@@ -84,6 +84,9 @@
void frameComplete();
+ void suspend();
+ void resume();
+
private:
ThreadedCompositor(Client&, ThreadedDisplayRefreshMonitor::Client&, WebCore::PlatformDisplayID, const WebCore::IntSize&, float scaleFactor, ShouldDoFrameSync, WebCore::TextureMapper::PaintFlags);
@@ -103,6 +106,7 @@
ShouldDoFrameSync m_doFrameSync;
WebCore::TextureMapper::PaintFlags m_paintFlags { 0 };
bool m_inForceRepaint { false };
+ unsigned m_suspendedCount { 0 };
std::unique_ptr<CompositingRunLoop> m_compositingRunLoop;
Modified: releases/WebKitGTK/webkit-2.24/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp (243982 => 243983)
--- releases/WebKitGTK/webkit-2.24/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp 2019-04-08 10:15:06 UTC (rev 243982)
+++ releases/WebKitGTK/webkit-2.24/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp 2019-04-08 10:15:11 UTC (rev 243983)
@@ -175,6 +175,9 @@
return;
}
+ if (m_layerTreeStateIsFrozen)
+ return;
+
setNeedsDisplay();
m_webPage.layoutIfNeeded();
if (!m_layerTreeHost)
@@ -195,6 +198,9 @@
bool DrawingAreaCoordinatedGraphics::forceRepaintAsync(CallbackID callbackID)
{
+ if (m_layerTreeStateIsFrozen)
+ return false;
+
return m_layerTreeHost && m_layerTreeHost->forceRepaintAsync(callbackID);
}
Modified: releases/WebKitGTK/webkit-2.24/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp (243982 => 243983)
--- releases/WebKitGTK/webkit-2.24/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp 2019-04-08 10:15:06 UTC (rev 243982)
+++ releases/WebKitGTK/webkit-2.24/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp 2019-04-08 10:15:11 UTC (rev 243983)
@@ -106,11 +106,13 @@
m_layerFlushSchedulingEnabled = layerFlushingEnabled;
if (m_layerFlushSchedulingEnabled) {
+ m_compositor->resume();
scheduleLayerFlush();
return;
}
cancelPendingLayerFlush();
+ m_compositor->suspend();
}
void LayerTreeHost::setShouldNotifyAfterNextScheduledLayerFlush(bool notifyAfterScheduledLayerFlush)
@@ -248,11 +250,13 @@
void LayerTreeHost::pauseRendering()
{
m_isSuspended = true;
+ m_compositor->suspend();
}
void LayerTreeHost::resumeRendering()
{
m_isSuspended = false;
+ m_compositor->resume();
scheduleLayerFlush();
}
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes