Changeset 242597 in webkit
- Timestamp:
- Mar 7, 2019 9:17:16 AM (5 years ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r242596 r242597 1 2019-03-07 Carlos Garcia Campos <cgarcia@igalia.com> 2 3 REGRESSION(r242364): [WPE] Do not stop the compositing run loop update timer on suspend 4 https://bugs.webkit.org/show_bug.cgi?id=195410 5 6 Reviewed by Žan Doberšek. 7 8 Calling CompositingRunLoop::stopUpdates() on suspend is leaving the threaded compositor in an inconsistent 9 state, failing to resume and stopping the updates forever. This is causing timeouts in WPE layout tests. Instead 10 of calling stopUpdates(), a new suspend() is called, that stops the update timer, without changing the current 11 updae tha compositing state. A new method resume() is also added to schedule an update if needed. 12 13 * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp: 14 (WebKit::CompositingRunLoop::suspend): Set state as suspended and stop the update timer. 15 (WebKit::CompositingRunLoop::resume): Set state as not suspended and start the update timer if it was scheduled 16 while suspended. 17 (WebKit::CompositingRunLoop::scheduleUpdate): Do not start the update timer when suspended. 18 (WebKit::CompositingRunLoop::compositionCompleted): Ditto. 19 (WebKit::CompositingRunLoop::updateCompleted): Ditto. 20 (WebKit::CompositingRunLoop::updateTimerFired): Add an assert to ensure the update timer is not fired while suspended. 21 * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h: 22 * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp: 23 (WebKit::ThreadedCompositor::suspend): Call CompositingRunLoop::suspend() instead of stopUpdates(). 24 (WebKit::ThreadedCompositor::resume): Call CompositingRunLoop::resume(). 25 1 26 2019-03-06 Mark Lam <mark.lam@apple.com> 2 27 -
trunk/Source/WebKit/Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp
r242266 r242597 95 95 } 96 96 97 void CompositingRunLoop::suspend() 98 { 99 LockHolder stateLocker(m_state.lock); 100 m_state.isSuspended = true; 101 m_updateTimer.stop(); 102 } 103 104 void CompositingRunLoop::resume() 105 { 106 LockHolder stateLocker(m_state.lock); 107 m_state.isSuspended = false; 108 if (m_state.update == UpdateState::Scheduled) 109 m_updateTimer.startOneShot(0_s); 110 } 111 97 112 void CompositingRunLoop::scheduleUpdate() 98 113 { … … 114 129 case UpdateState::Idle: 115 130 m_state.update = UpdateState::Scheduled; 116 m_updateTimer.startOneShot(0_s); 131 if (!m_state.isSuspended) 132 m_updateTimer.startOneShot(0_s); 117 133 return; 118 134 case UpdateState::Scheduled: … … 157 173 m_state.pendingUpdate = false; 158 174 m_state.update = UpdateState::Scheduled; 159 m_updateTimer.startOneShot(0_s); 175 if (!m_state.isSuspended) 176 m_updateTimer.startOneShot(0_s); 160 177 return; 161 178 } … … 189 206 m_state.pendingUpdate = false; 190 207 m_state.update = UpdateState::Scheduled; 191 m_updateTimer.startOneShot(0_s); 208 if (!m_state.isSuspended) 209 m_updateTimer.startOneShot(0_s); 192 210 return; 193 211 } … … 205 223 // Both composition and scene update are now in progress. 206 224 LockHolder locker(m_state.lock); 225 ASSERT(!m_state.isSuspended); 207 226 m_state.composition = CompositionState::InProgress; 208 227 m_state.update = UpdateState::InProgress; -
trunk/Source/WebKit/Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h
r242266 r242597 48 48 void performTaskSync(Function<void ()>&&); 49 49 50 void suspend(); 51 void resume(); 52 50 53 Lock& stateLock() { return m_state.lock; } 51 54 … … 82 85 UpdateState update { UpdateState::Idle }; 83 86 bool pendingUpdate { false }; 87 bool isSuspended { false }; 84 88 } m_state; 85 89 }; -
trunk/Source/WebKit/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp
r242364 r242597 122 122 return; 123 123 124 m_compositingRunLoop->s topUpdates();124 m_compositingRunLoop->suspend(); 125 125 m_compositingRunLoop->performTaskSync([this, protectedThis = makeRef(*this)] { 126 126 m_scene->setActive(false); … … 137 137 m_scene->setActive(true); 138 138 }); 139 m_compositingRunLoop->resume(); 139 140 } 140 141
Note: See TracChangeset
for help on using the changeset viewer.