Changeset 242364 in webkit
- Timestamp:
- Mar 4, 2019 10:06:18 AM (5 years ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r242359 r242364 1 2019-03-04 Carlos Garcia Campos <cgarcia@igalia.com> 2 3 [CoordinatedGraphics] The compositing loop is still running even after exiting AC mode 4 https://bugs.webkit.org/show_bug.cgi?id=195270 5 6 Reviewed by Don Olmstead. 7 8 Suspend the threaded compositor when the painting is paused or layer flush disabled, and resume it again when 9 painting is resumed and layer flush enabled. 10 11 * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp: 12 (WebKit::ThreadedCompositor::suspend): Increment the suspend counter and mark the scene as inactive if it was suspended. 13 (WebKit::ThreadedCompositor::resume): Decrement the suspend counter and mark the scene as active if it's now resumed. 14 * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h: 15 * WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp: 16 (WebKit::DrawingAreaCoordinatedGraphics::forceRepaint): Return early if layer tree state is frozen. 17 (WebKit::DrawingAreaCoordinatedGraphics::forceRepaintAsync): Ditto. 18 * WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp: 19 (WebKit::LayerTreeHost::setLayerFlushSchedulingEnabled): Call ThreadedCompositor::suspend()/resume(). 20 (WebKit::LayerTreeHost::pauseRendering): Call ThreadedCompositor::suspend. 21 (WebKit::LayerTreeHost::resumeRendering): Call ThreadedCompositor::resume(). 22 1 23 2019-03-04 Simon Fraser <simon.fraser@apple.com> 2 24 -
trunk/Source/WebKit/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp
r242205 r242364 117 117 } 118 118 119 void ThreadedCompositor::suspend() 120 { 121 if (++m_suspendedCount > 1) 122 return; 123 124 m_compositingRunLoop->stopUpdates(); 125 m_compositingRunLoop->performTaskSync([this, protectedThis = makeRef(*this)] { 126 m_scene->setActive(false); 127 }); 128 } 129 130 void ThreadedCompositor::resume() 131 { 132 ASSERT(m_suspendedCount > 0); 133 if (--m_suspendedCount > 0) 134 return; 135 136 m_compositingRunLoop->performTaskSync([this, protectedThis = makeRef(*this)] { 137 m_scene->setActive(true); 138 }); 139 } 140 119 141 void ThreadedCompositor::setNativeSurfaceHandleForCompositing(uint64_t handle) 120 142 { -
trunk/Source/WebKit/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h
r242205 r242364 85 85 void frameComplete(); 86 86 87 void suspend(); 88 void resume(); 89 87 90 private: 88 91 ThreadedCompositor(Client&, ThreadedDisplayRefreshMonitor::Client&, WebCore::PlatformDisplayID, const WebCore::IntSize&, float scaleFactor, ShouldDoFrameSync, WebCore::TextureMapper::PaintFlags); … … 104 107 WebCore::TextureMapper::PaintFlags m_paintFlags { 0 }; 105 108 bool m_inForceRepaint { false }; 109 unsigned m_suspendedCount { 0 }; 106 110 107 111 std::unique_ptr<CompositingRunLoop> m_compositingRunLoop; -
trunk/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp
r242346 r242364 176 176 } 177 177 178 if (m_layerTreeStateIsFrozen) 179 return; 180 178 181 setNeedsDisplay(); 179 182 m_webPage.layoutIfNeeded(); … … 196 199 bool DrawingAreaCoordinatedGraphics::forceRepaintAsync(CallbackID callbackID) 197 200 { 201 if (m_layerTreeStateIsFrozen) 202 return false; 203 198 204 return m_layerTreeHost && m_layerTreeHost->forceRepaintAsync(callbackID); 199 205 } -
trunk/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp
r242205 r242364 107 107 108 108 if (m_layerFlushSchedulingEnabled) { 109 m_compositor->resume(); 109 110 scheduleLayerFlush(); 110 111 return; … … 112 113 113 114 cancelPendingLayerFlush(); 115 m_compositor->suspend(); 114 116 } 115 117 … … 249 251 { 250 252 m_isSuspended = true; 253 m_compositor->suspend(); 251 254 } 252 255 … … 254 257 { 255 258 m_isSuspended = false; 259 m_compositor->resume(); 256 260 scheduleLayerFlush(); 257 261 }
Note: See TracChangeset
for help on using the changeset viewer.