Changeset 215259 in webkit
- Timestamp:
- Apr 11, 2017 11:50:50 PM (7 years ago)
- Location:
- trunk/Source
- Files:
-
- 2 added
- 21 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WTF/ChangeLog
r215241 r215259 1 2017-04-11 Zan Dobersek <zdobersek@igalia.com> 2 3 [GTK] Use the DisplayRefreshMonitor facilities 4 https://bugs.webkit.org/show_bug.cgi?id=170599 5 6 Reviewed by Carlos Garcia Campos. 7 8 * wtf/Platform.h: Enable USE_REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR for the GTK+ port. 9 * wtf/glib/RunLoopSourcePriority.h: Add the DisplayRefreshMonitorTimer entry that 10 matches the value of LayerFlushTimer. 11 1 12 2017-04-11 Yusuke Suzuki <utatane.tea@gmail.com> 2 13 -
trunk/Source/WTF/wtf/Platform.h
r215220 r215259 1049 1049 #endif 1050 1050 1051 #if PLATFORM(COCOA) 1051 #if PLATFORM(COCOA) || PLATFORM(GTK) 1052 1052 #define USE_REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR 1 1053 1053 #endif -
trunk/Source/WTF/wtf/glib/RunLoopSourcePriority.h
r215088 r215259 65 65 LayerFlushTimer = -100, 66 66 67 // DisplayRefreshMonitor timer, should have the same value as the LayerFlushTimer. 68 DisplayRefreshMonitorTimer = -100, 69 67 70 // Rendering timer in the main thread when accelerated compositing is not used. 68 71 NonAcceleratedDrawingTimer = 100 -
trunk/Source/WebCore/CMakeLists.txt
r215131 r215259 2254 2254 platform/graphics/ComplexTextController.cpp 2255 2255 platform/graphics/CrossfadeGeneratedImage.cpp 2256 platform/graphics/DisplayRefreshMonitor.cpp 2256 2257 platform/graphics/DisplayRefreshMonitorClient.cpp 2258 platform/graphics/DisplayRefreshMonitorManager.cpp 2257 2259 platform/graphics/ExtendedColor.cpp 2258 2260 platform/graphics/FloatPoint.cpp -
trunk/Source/WebCore/ChangeLog
r215254 r215259 1 2017-04-11 Zan Dobersek <zdobersek@igalia.com> 2 3 [GTK] Use the DisplayRefreshMonitor facilities 4 https://bugs.webkit.org/show_bug.cgi?id=170599 5 6 Reviewed by Carlos Garcia Campos. 7 8 * CMakeLists.txt: Add missing files to the build. 9 * platform/graphics/DisplayRefreshMonitor.cpp: Build fixes. 10 (WebCore::DisplayRefreshMonitor::createDefaultDisplayRefreshMonitor): 11 * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp: 12 (WebCore::CoordinatedGraphicsLayer::updatePlatformLayer): Mark the 13 platform layer as updated in the layer's CoordinatedGraphicsState. 14 * platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h: 15 1 16 2017-04-11 Antoine Quint <graouts@apple.com> 2 17 -
trunk/Source/WebCore/platform/graphics/DisplayRefreshMonitor.cpp
r202399 r215259 34 34 #if PLATFORM(IOS) 35 35 #include "DisplayRefreshMonitorIOS.h" 36 #el se36 #elif PLATFORM(MAC) 37 37 #include "DisplayRefreshMonitorMac.h" 38 38 #endif … … 48 48 return DisplayRefreshMonitorIOS::create(displayID); 49 49 #endif 50 UNUSED_PARAM(displayID); 50 51 return nullptr; 51 52 } -
trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp
r215160 r215259 715 715 716 716 m_shouldUpdatePlatformLayer = false; 717 m_layerState.platformLayerUpdated = true; 717 718 if (m_platformLayer) 718 719 m_platformLayer->swapBuffersIfNeeded(); -
trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h
r213989 r215259 87 87 bool repaintCountChanged : 1; 88 88 bool platformLayerChanged: 1; 89 bool platformLayerUpdated: 1; 89 90 bool platformLayerShouldSwapBuffers: 1; 90 91 bool isScrollableChanged: 1; -
trunk/Source/WebKit2/ChangeLog
r215255 r215259 1 2017-04-11 Zan Dobersek <zdobersek@igalia.com> 2 3 [GTK] Use the DisplayRefreshMonitor facilities 4 https://bugs.webkit.org/show_bug.cgi?id=170599 5 6 Reviewed by Carlos Garcia Campos. 7 8 ThreadedCompositor gains a DisplayRefreshMonitor member that it can use 9 to better coordinate display refresh callbacks on the main thread. Still, 10 because currently the GTK+ port doesn't have a reliable way of notifying 11 the ThreadedCompositor of a vsync event, a timer targeting 60FPS is used 12 in order to keep the updates at a reasonable rate. When the timer is fired, 13 the ThreadedCompositor decides how to proceed based on state changes that 14 might have occurred during composition or whether there's any display 15 refresh callbacks that require handling on the main thread. 16 17 CompositingRunLoop now stores its state in an atomic variable that's then 18 inspected whenever a new update is scheduled or completed. When scheduled, 19 if there's no update in progress, a new update is requested through the 20 timer. If there's already an update in progress, a new update is marked 21 as pending after the current one completes. In that case, when the update 22 is completed, a new update is requested through the timer. 23 24 ThreadedDisplayRefreshMonitor is used to coordinate updates between the 25 main and the composition thread whenever the CoordinatedGraphics state 26 demands it, or whenever there are clients registered to that monitor that 27 require an update (e.g. a requestAnimationFrame() callback). After the 28 update on the composition thread is finished, and the DisplayRefreshMonitor 29 object requires an update, a callback at the same priority as the layer 30 flush timer is scheduled on the main thread. In that callback we handle 31 any clients registered for this DisplayRefreshMonitor before proceeding 32 to handle any changes to the CoordinatedGraphics scene. In case the 33 DisplayRefreshMonitor clients or the layer flushes already queued up 34 any changes to the state, we immediately ask the ThreadedCompositor for 35 an update. 36 37 * PlatformGTK.cmake: 38 * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp: 39 (WebKit::CoordinatedGraphicsScene::updateViewport): 40 (WebKit::CoordinatedGraphicsScene::commitSceneState): 41 * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h: 42 * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp: 43 (WebKit::CompositingRunLoop::CompositingRunLoop): 44 (WebKit::CompositingRunLoop::isActive): 45 (WebKit::CompositingRunLoop::scheduleUpdate): 46 (WebKit::CompositingRunLoop::stopUpdates): 47 (WebKit::CompositingRunLoop::updateCompleted): 48 (WebKit::CompositingRunLoop::updateTimerFired): 49 (WebKit::CompositingRunLoop::isCurrent): 50 (WebKit::CompositingRunLoop::startUpdateTimer): Deleted. 51 (WebKit::CompositingRunLoop::stopUpdateTimer): Deleted. 52 * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h: 53 (): Deleted. 54 * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp: 55 (WebKit::m_displayRefreshMonitor): 56 (WebKit::ThreadedCompositor::invalidate): 57 (WebKit::ThreadedCompositor::setNativeSurfaceHandleForCompositing): 58 (WebKit::ThreadedCompositor::updateViewport): 59 (WebKit::ThreadedCompositor::scheduleDisplayImmediately): 60 (WebKit::ThreadedCompositor::renderLayerTree): 61 (WebKit::ThreadedCompositor::sceneUpdateFinished): 62 (WebKit::ThreadedCompositor::updateSceneState): 63 (WebKit::ThreadedCompositor::displayRefreshMonitor): 64 (WebKit::ThreadedCompositor::renderNextFrameIfNeeded): 65 (WebKit::ThreadedCompositor::completeCoordinatedUpdateIfNeeded): 66 (WebKit::ThreadedCompositor::coordinateUpdateCompletionWithClient): 67 (WebKit::ThreadedCompositor::performFrameCompletion): 68 * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h: 69 * Shared/CoordinatedGraphics/threadedcompositor/ThreadedDisplayRefreshMonitor.cpp: Added. 70 (WebKit::ThreadedDisplayRefreshMonitor::ThreadedDisplayRefreshMonitor): 71 (WebKit::ThreadedDisplayRefreshMonitor::requestRefreshCallback): 72 (WebKit::ThreadedDisplayRefreshMonitor::requiresDisplayRefreshCallback): 73 (WebKit::ThreadedDisplayRefreshMonitor::dispatchDisplayRefreshCallback): 74 (WebKit::ThreadedDisplayRefreshMonitor::invalidate): 75 (WebKit::ThreadedDisplayRefreshMonitor::displayRefreshCallback): 76 * Shared/CoordinatedGraphics/threadedcompositor/ThreadedDisplayRefreshMonitor.h: Copied from Source/WebKit2/Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h. 77 * WebProcess/WebPage/AcceleratedDrawingArea.cpp: 78 (WebKit::AcceleratedDrawingArea::createDisplayRefreshMonitor): 79 * WebProcess/WebPage/AcceleratedDrawingArea.h: 80 * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp: 81 (WebKit::ThreadedCoordinatedLayerTreeHost::createDisplayRefreshMonitor): 82 * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h: 83 * WebProcess/WebPage/LayerTreeHost.h: 84 (WebKit::LayerTreeHost::createDisplayRefreshMonitor): 85 1 86 2017-04-11 Alex Christensen <achristensen@webkit.org> 2 87 -
trunk/Source/WebKit2/PlatformGTK.cmake
r214934 r215259 66 66 Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp 67 67 Shared/CoordinatedGraphics/threadedcompositor/ThreadSafeCoordinatedSurface.cpp 68 Shared/CoordinatedGraphics/threadedcompositor/ThreadedDisplayRefreshMonitor.cpp 68 69 Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp 69 70 -
trunk/Source/WebKit2/Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp
r213035 r215259 128 128 void CoordinatedGraphicsScene::updateViewport() 129 129 { 130 if (!m_client) 131 return; 132 dispatchOnClientRunLoop([this] { 133 if (m_client) 134 m_client->updateViewport(); 135 }); 130 if (m_client) 131 m_client->updateViewport(); 136 132 } 137 133 … … 548 544 commitPendingBackingStoreOperations(); 549 545 removeReleasedImageBackingsIfNeeded(); 550 551 // The pending tiles state is on its way for the screen, tell the web process to render the next one.552 renderNextFrame();553 546 } 554 547 -
trunk/Source/WebKit2/Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h
r213035 r215259 81 81 82 82 void commitSceneState(const WebCore::CoordinatedGraphicsState&); 83 void renderNextFrame(); 83 84 84 85 void setViewBackgroundColor(const WebCore::Color& color) { m_viewBackgroundColor = color; } … … 124 125 void dispatchOnClientRunLoop(Function<void()>&&); 125 126 void updateViewport(); 126 void renderNextFrame();127 127 128 128 void createLayer(WebCore::CoordinatedLayerID); -
trunk/Source/WebKit2/Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp
r215173 r215259 113 113 , m_updateFunction(WTFMove(updateFunction)) 114 114 { 115 m_updateState.store(UpdateState::Completed); 116 115 117 #if USE(GLIB_EVENT_LOOP) 116 118 m_updateTimer.setPriority(RunLoopSourcePriority::CompositingThreadUpdateTimer); … … 145 147 } 146 148 147 void CompositingRunLoop::startUpdateTimer(UpdateTiming timing)149 bool CompositingRunLoop::isActive() 148 150 { 149 if (m_updateTimer.isActive()) 151 return m_updateState.load() != UpdateState::Completed; 152 } 153 154 void CompositingRunLoop::scheduleUpdate() 155 { 156 if (m_updateState.compareExchangeStrong(UpdateState::Completed, UpdateState::InProgress) == UpdateState::Completed) { 157 m_updateTimer.startOneShot(0); 158 return; 159 } 160 161 if (m_updateState.compareExchangeStrong(UpdateState::InProgress, UpdateState::PendingAfterCompletion) == UpdateState::InProgress) 162 return; 163 } 164 165 void CompositingRunLoop::stopUpdates() 166 { 167 m_updateTimer.stop(); 168 m_updateState.store(UpdateState::Completed); 169 } 170 171 void CompositingRunLoop::updateCompleted() 172 { 173 if (m_updateState.compareExchangeStrong(UpdateState::InProgress, UpdateState::Completed) == UpdateState::InProgress) 150 174 return; 151 175 152 const static double targetFPS = 60;153 double nextUpdateTime = 0;154 if (timing == WaitUntilNextFrame)155 nextUpdateTime = std::max((1 / targetFPS) - (monotonicallyIncreasingTime() - m_lastUpdateTime), 0.0);176 if (m_updateState.compareExchangeStrong(UpdateState::PendingAfterCompletion, UpdateState::InProgress) == UpdateState::PendingAfterCompletion) { 177 m_updateTimer.startOneShot(0); 178 return; 179 } 156 180 157 m_updateTimer.startOneShot(1_s * nextUpdateTime); 158 } 159 160 void CompositingRunLoop::stopUpdateTimer() 161 { 162 m_updateTimer.stop(); 181 ASSERT_NOT_REACHED(); 163 182 } 164 183 … … 166 185 { 167 186 m_updateFunction(); 168 m_lastUpdateTime = monotonicallyIncreasingTime();169 187 } 170 188 -
trunk/Source/WebKit2/Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h
r203721 r215259 29 29 #if USE(COORDINATED_GRAPHICS_THREADED) 30 30 31 #include <wtf/Atomics.h> 31 32 #include <wtf/Condition.h> 32 33 #include <wtf/FastMalloc.h> … … 42 43 WTF_MAKE_FAST_ALLOCATED; 43 44 public: 44 enum UpdateTiming {45 Immediate,46 WaitUntilNextFrame,47 };48 49 45 CompositingRunLoop(std::function<void ()>&&); 50 46 ~CompositingRunLoop(); … … 53 49 void performTaskSync(Function<void ()>&&); 54 50 55 void startUpdateTimer(UpdateTiming = Immediate); 56 void stopUpdateTimer(); 51 bool isActive(); 52 void scheduleUpdate(); 53 void stopUpdates(); 54 55 void updateCompleted(); 56 57 #ifndef NDEBUG 58 bool isCurrent(); 59 #endif 57 60 58 61 private: 62 enum class UpdateState { 63 Completed, 64 InProgress, 65 PendingAfterCompletion, 66 }; 67 59 68 void updateTimerFired(); 60 69 61 70 RunLoop::Timer<CompositingRunLoop> m_updateTimer; 71 #ifndef NDEBUG 72 RunLoop& m_runLoop; 73 #endif 62 74 std::function<void ()> m_updateFunction; 75 Atomic<UpdateState> m_updateState; 63 76 Lock m_dispatchSyncConditionMutex; 64 77 Condition m_dispatchSyncCondition; 65 66 double m_lastUpdateTime { 0 };67 78 }; 68 79 -
trunk/Source/WebKit2/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp
r211281 r215259 30 30 31 31 #include "CompositingRunLoop.h" 32 #include "ThreadedDisplayRefreshMonitor.h" 32 33 #include <WebCore/PlatformDisplay.h> 33 34 #include <WebCore/TransformationMatrix.h> … … 57 58 , m_needsResize(!viewportSize.isEmpty()) 58 59 , m_compositingRunLoop(std::make_unique<CompositingRunLoop>([this] { renderLayerTree(); })) 59 { 60 #if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR) 61 , m_displayRefreshMonitor(ThreadedDisplayRefreshMonitor::create(*this)) 62 #endif 63 { 64 m_clientRendersNextFrame.store(false); 65 m_coordinateUpdateCompletionWithClient.store(false); 66 60 67 m_compositingRunLoop->performTaskSync([this, protectedThis = makeRef(*this)] { 61 68 m_scene = adoptRef(new CoordinatedGraphicsScene(this)); … … 90 97 { 91 98 m_scene->detach(); 92 m_compositingRunLoop->stopUpdate Timer();99 m_compositingRunLoop->stopUpdates(); 93 100 m_compositingRunLoop->performTaskSync([this, protectedThis = makeRef(*this)] { 94 101 m_scene->purgeGLResources(); … … 96 103 m_scene = nullptr; 97 104 }); 105 #if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR) 106 m_displayRefreshMonitor->invalidate(); 107 #endif 98 108 m_compositingRunLoop = nullptr; 99 109 } … … 101 111 void ThreadedCompositor::setNativeSurfaceHandleForCompositing(uint64_t handle) 102 112 { 103 m_compositingRunLoop->stopUpdate Timer();113 m_compositingRunLoop->stopUpdates(); 104 114 m_compositingRunLoop->performTaskSync([this, protectedThis = makeRef(*this), handle] { 105 115 // A new native handle can't be set without destroying the previous one first if any. … … 120 130 m_compositingRunLoop->performTask([this, protectedThis = makeRef(*this), scale] { 121 131 m_scaleFactor = scale; 122 scheduleDisplayImmediately();132 m_compositingRunLoop->scheduleUpdate(); 123 133 }); 124 134 } … … 129 139 m_scrollPosition = scrollPosition; 130 140 m_scaleFactor = scale; 131 scheduleDisplayImmediately();141 m_compositingRunLoop->scheduleUpdate(); 132 142 }); 133 143 } … … 139 149 m_scaleFactor = scale; 140 150 m_needsResize = true; 141 scheduleDisplayImmediately();151 m_compositingRunLoop->scheduleUpdate(); 142 152 }); 143 153 } … … 147 157 m_compositingRunLoop->performTask([this, protectedThis = Ref<ThreadedCompositor>(*this), drawsBackground] { 148 158 m_drawsBackground = drawsBackground; 149 scheduleDisplayImmediately();159 m_compositingRunLoop->scheduleUpdate(); 150 160 }); 151 161 } … … 165 175 void ThreadedCompositor::updateViewport() 166 176 { 167 m_compositingRunLoop->startUpdateTimer(CompositingRunLoop::WaitUntilNextFrame); 168 } 169 170 void ThreadedCompositor::scheduleDisplayImmediately() 171 { 172 m_compositingRunLoop->startUpdateTimer(CompositingRunLoop::Immediate); 177 m_compositingRunLoop->scheduleUpdate(); 173 178 } 174 179 … … 206 211 207 212 m_context->swapBuffers(); 213 214 sceneUpdateFinished(); 215 } 216 217 void ThreadedCompositor::sceneUpdateFinished() 218 { 219 bool shouldDispatchDisplayRefreshCallback = m_clientRendersNextFrame.load() 220 || m_displayRefreshMonitor->requiresDisplayRefreshCallback(); 221 bool shouldCoordinateUpdateCompletionWithClient = m_coordinateUpdateCompletionWithClient.load(); 222 223 if (shouldDispatchDisplayRefreshCallback) 224 m_displayRefreshMonitor->dispatchDisplayRefreshCallback(); 225 if (!shouldCoordinateUpdateCompletionWithClient) 226 m_compositingRunLoop->updateCompleted(); 208 227 } 209 228 … … 212 231 ASSERT(isMainThread()); 213 232 RefPtr<CoordinatedGraphicsScene> scene = m_scene; 214 m_scene->appendUpdate([ scene, state] {233 m_scene->appendUpdate([this, scene, state] { 215 234 scene->commitSceneState(state); 216 }); 217 218 scheduleDisplayImmediately(); 219 } 235 236 m_clientRendersNextFrame.store(true); 237 bool coordinateUpdate = std::any_of(state.layersToUpdate.begin(), state.layersToUpdate.end(), 238 [](const std::pair<CoordinatedLayerID, CoordinatedGraphicsLayerState>& it) { 239 return it.second.platformLayerChanged || it.second.platformLayerUpdated; 240 }); 241 m_coordinateUpdateCompletionWithClient.store(coordinateUpdate); 242 }); 243 244 m_compositingRunLoop->scheduleUpdate(); 245 } 246 247 #if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR) 248 RefPtr<WebCore::DisplayRefreshMonitor> ThreadedCompositor::displayRefreshMonitor(PlatformDisplayID) 249 { 250 return m_displayRefreshMonitor.copyRef(); 251 } 252 253 void ThreadedCompositor::renderNextFrameIfNeeded() 254 { 255 if (m_clientRendersNextFrame.compareExchangeStrong(true, false)) 256 m_scene->renderNextFrame(); 257 } 258 259 void ThreadedCompositor::completeCoordinatedUpdateIfNeeded() 260 { 261 if (m_coordinateUpdateCompletionWithClient.compareExchangeStrong(true, false)) 262 m_compositingRunLoop->updateCompleted(); 263 } 264 265 void ThreadedCompositor::coordinateUpdateCompletionWithClient() 266 { 267 m_coordinateUpdateCompletionWithClient.store(true); 268 if (!m_compositingRunLoop->isActive()) 269 m_compositingRunLoop->scheduleUpdate(); 270 } 271 #endif 220 272 221 273 } -
trunk/Source/WebKit2/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h
r211281 r215259 34 34 #include <WebCore/IntSize.h> 35 35 #include <WebCore/TextureMapper.h> 36 #include <wtf/Atomics.h> 36 37 #include <wtf/FastMalloc.h> 37 38 #include <wtf/Noncopyable.h> 38 39 #include <wtf/ThreadSafeRefCounted.h> 40 41 #if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR) 42 #include <WebCore/DisplayRefreshMonitor.h> 43 #endif 39 44 40 45 namespace WebCore { … … 46 51 class CoordinatedGraphicsScene; 47 52 class CoordinatedGraphicsSceneClient; 53 class ThreadedDisplayRefreshMonitor; 48 54 49 55 class ThreadedCompositor : public CoordinatedGraphicsSceneClient, public ThreadSafeRefCounted<ThreadedCompositor> { … … 74 80 void forceRepaint(); 75 81 82 #if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR) 83 RefPtr<WebCore::DisplayRefreshMonitor> displayRefreshMonitor(WebCore::PlatformDisplayID); 84 void renderNextFrameIfNeeded(); 85 void completeCoordinatedUpdateIfNeeded(); 86 void coordinateUpdateCompletionWithClient(); 87 #endif 88 76 89 private: 77 90 ThreadedCompositor(Client&, const WebCore::IntSize&, float scaleFactor, uint64_t nativeSurfaceHandle, ShouldDoFrameSync, WebCore::TextureMapper::PaintFlags); … … 83 96 84 97 void renderLayerTree(); 85 void sc heduleDisplayImmediately();98 void sceneUpdateFinished(); 86 99 87 100 void createGLContext(); … … 101 114 102 115 std::unique_ptr<CompositingRunLoop> m_compositingRunLoop; 116 117 #if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR) 118 Ref<ThreadedDisplayRefreshMonitor> m_displayRefreshMonitor; 119 #endif 120 121 Atomic<bool> m_clientRendersNextFrame; 122 Atomic<bool> m_coordinateUpdateCompletionWithClient; 103 123 }; 104 124 -
trunk/Source/WebKit2/WebProcess/WebPage/AcceleratedDrawingArea.cpp
r215173 r215259 224 224 } 225 225 226 #if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR) 227 RefPtr<WebCore::DisplayRefreshMonitor> AcceleratedDrawingArea::createDisplayRefreshMonitor(WebCore::PlatformDisplayID displayID) 228 { 229 if (!m_layerTreeHost || m_wantsToExitAcceleratedCompositingMode || exitAcceleratedCompositingModePending()) 230 return nullptr; 231 return m_layerTreeHost->createDisplayRefreshMonitor(displayID); 232 } 233 #endif 234 226 235 void AcceleratedDrawingArea::updateBackingStoreState(uint64_t stateID, bool respondImmediately, float deviceScaleFactor, const IntSize& size, const IntSize& scrollOffset) 227 236 { -
trunk/Source/WebKit2/WebProcess/WebPage/AcceleratedDrawingArea.h
r212608 r215259 59 59 void scheduleCompositingLayerFlush() override; 60 60 void scheduleCompositingLayerFlushImmediately() override; 61 62 #if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR) 63 virtual RefPtr<WebCore::DisplayRefreshMonitor> createDisplayRefreshMonitor(WebCore::PlatformDisplayID); 64 #endif 61 65 62 66 #if USE(TEXTURE_MAPPER_GL) && PLATFORM(GTK) && PLATFORM(X11) && !USE(REDIRECTED_XCOMPOSITE_WINDOW) -
trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp
r211365 r215259 75 75 // Rendering to the actual screen will happen later anyway since the UI process schedules a redraw for every update, 76 76 // the compositor will take care of syncing to vblank. 77 m_compositor = ThreadedCompositor::create(m_compositorClient, scaledSize, scaleFactor, m_surface->window(), ThreadedCompositor::ShouldDoFrameSync:: No, paintFlags);77 m_compositor = ThreadedCompositor::create(m_compositorClient, scaledSize, scaleFactor, m_surface->window(), ThreadedCompositor::ShouldDoFrameSync::Yes, paintFlags); 78 78 m_layerTreeContext.contextID = m_surface->surfaceID(); 79 79 } else … … 248 248 } 249 249 250 #if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR) 251 RefPtr<WebCore::DisplayRefreshMonitor> ThreadedCoordinatedLayerTreeHost::createDisplayRefreshMonitor(PlatformDisplayID displayID) 252 { 253 return m_compositor->displayRefreshMonitor(displayID); 254 } 255 #endif 256 250 257 } // namespace WebKit 251 258 -
trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h
r211365 r215259 102 102 void commitSceneState(const WebCore::CoordinatedGraphicsState&) override; 103 103 104 #if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR) 105 RefPtr<WebCore::DisplayRefreshMonitor> createDisplayRefreshMonitor(WebCore::PlatformDisplayID) override; 106 #endif 107 104 108 enum class DiscardableSyncActions { 105 109 UpdateSize = 1 << 1, -
trunk/Source/WebKit2/WebProcess/WebPage/LayerTreeHost.h
r212608 r215259 30 30 31 31 #include "LayerTreeContext.h" 32 #include <WebCore/DisplayRefreshMonitor.h> 33 #include <WebCore/PlatformScreen.h> 32 34 #include <wtf/Forward.h> 33 35 #include <wtf/RefCounted.h> … … 97 99 #endif 98 100 101 #if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR) 102 virtual RefPtr<WebCore::DisplayRefreshMonitor> createDisplayRefreshMonitor(WebCore::PlatformDisplayID) { return nullptr; } 103 #endif 104 99 105 virtual void setViewOverlayRootLayer(WebCore::GraphicsLayer* viewOverlayRootLayer) { m_viewOverlayRootLayer = viewOverlayRootLayer; } 100 106
Note: See TracChangeset
for help on using the changeset viewer.