Changeset 202037 in webkit
- Timestamp:
- Jun 14, 2016 12:48:54 AM (8 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r202036 r202037 1 2016-06-14 Carlos Garcia Campos <cgarcia@igalia.com> 2 3 [Threaded Compositor] Flickering and rendering artifacts when resizing the web view 4 https://bugs.webkit.org/show_bug.cgi?id=154070 5 6 Reviewed by Žan Doberšek. 7 8 Resizing the web view is expected to be a sync operation, the UI process creates a new backing store state ID, 9 sends UpdateBackingStoreState message with the flag RespondImmediately to the web process and waits up to 500ms 10 for the reply (DidUpdateBackingStoreState message). When using the threaded compositor, we schedule a task in 11 the compositing thread to update the viewport size, and return immediately, so that we reply to the UI process 12 before the compositing thread has actually updated its size. There's a moment in which sizes are out of sync 13 causing the flickering and rendering artifacts, the UI process continues rendering at the new size, while the 14 web process is still rendering at the previous size. We can prevent this from happening just by making the 15 resize task synchronous in the threaded compositor. 16 17 * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp: 18 (WebKit::CompositingRunLoop::performTaskSync): Add sync version of performTask(). 19 * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h: 20 * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp: 21 (WebKit::ThreadedCompositor::didChangeViewportSize): Use performTaskSync(). 22 1 23 2016-06-14 Carlos Garcia Campos <cgarcia@igalia.com> 2 24 -
trunk/Source/WebKit2/Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp
r201922 r202037 38 38 , m_updateTimer(m_runLoop, this, &CompositingRunLoop::updateTimerFired) 39 39 , m_updateFunction(WTFMove(updateFunction)) 40 , m_lastUpdateTime(0)41 40 { 42 41 } … … 46 45 ASSERT(isMainThread()); 47 46 m_runLoop.dispatch(WTFMove(function)); 47 } 48 49 void CompositingRunLoop::performTaskSync(std::function<void ()>&& function) 50 { 51 ASSERT(isMainThread()); 52 LockHolder locker(m_dispatchSyncConditionMutex); 53 m_runLoop.dispatch([this, function = WTFMove(function)] { 54 LockHolder locker(m_dispatchSyncConditionMutex); 55 function(); 56 m_dispatchSyncCondition.notifyOne(); 57 }); 58 m_dispatchSyncCondition.wait(m_dispatchSyncConditionMutex); 48 59 } 49 60 -
trunk/Source/WebKit2/Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h
r201922 r202037 48 48 49 49 void performTask(std::function<void ()>&&); 50 void performTaskSync(std::function<void ()>&&); 50 51 51 52 void setUpdateTimer(UpdateTiming timing = Immediate); … … 60 61 RunLoop::Timer<CompositingRunLoop> m_updateTimer; 61 62 std::function<void ()> m_updateFunction; 63 Lock m_dispatchSyncConditionMutex; 64 Condition m_dispatchSyncCondition; 62 65 63 double m_lastUpdateTime ;66 double m_lastUpdateTime { 0 }; 64 67 }; 65 68 -
trunk/Source/WebKit2/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp
r201922 r202037 83 83 { 84 84 RefPtr<ThreadedCompositor> protector(this); 85 m_compositingRunLoop->performTask ([protector, size] {85 m_compositingRunLoop->performTaskSync([protector, size] { 86 86 protector->viewportController()->didChangeViewportSize(size); 87 87 });
Note: See TracChangeset
for help on using the changeset viewer.