Changeset 238394 in webkit
- Timestamp:
- Nov 20, 2018 1:02:25 AM (5 years ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r238389 r238394 1 2018-11-20 Antti Koivisto <antti@apple.com> 2 3 Avoid potential longer than expected layer flush delays 4 https://bugs.webkit.org/show_bug.cgi?id=191833 5 6 Reviewed by Dean Jackson. 7 8 Layer flush throttling also stops style recalcs and layouts. Layouts schedule layer flushes. Especially 9 on a slow network we can in principle end up in situation where layer flush timer fires but there is no 10 flush scheduled and so nothing happens. However there is a pending style recalc or layout that would 11 actually schedule a flush (in practice various things force style recalcs and this doesn't occur 12 commonly). 13 14 To avoid this we should flush unconditionally when the flush timer fires. This performs any pending 15 style recalc and layout too. If there is nothing to do the flush will be cheap. 16 17 PLT doesn't appear to hit cases affected by this patch and there shouldn't be any impact. 18 19 * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h: 20 21 Remove now unnecessary m_hasPendingFlush bit, simplifying the logic. 22 23 * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm: 24 (WebKit::TiledCoreAnimationDrawingArea::setLayerTreeStateIsFrozen): 25 26 Schedule unconditionally when unfreezing. 27 28 (WebKit::TiledCoreAnimationDrawingArea::scheduleCompositingLayerFlush): 29 30 Remove branch that starts the flush timer. It is not needed as either it was already running 31 or immediate flush is already scheduled and will start the timer anyway. 32 33 (WebKit::TiledCoreAnimationDrawingArea::flushLayers): 34 (WebKit::TiledCoreAnimationDrawingArea::adjustLayerFlushThrottling): 35 (WebKit::TiledCoreAnimationDrawingArea::layerFlushThrottlingTimerFired): 36 37 Flush unconditionally. 38 1 39 2018-11-19 Don Olmstead <don.olmstead@sony.com> 2 40 -
trunk/Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h
r238178 r238394 178 178 bool m_isThrottlingLayerFlushes { false }; 179 179 bool m_isLayerFlushThrottlingTemporarilyDisabledForInteraction { false }; 180 bool m_hasPendingFlush { false };181 180 182 181 WebCore::Timer m_layerFlushThrottlingTimer; -
trunk/Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm
r238178 r238394 181 181 } else { 182 182 // Immediate flush as any delay in unfreezing can result in flashes. 183 if (m_hasPendingFlush) 184 scheduleLayerFlushRunLoopObserver(); 183 scheduleLayerFlushRunLoopObserver(); 185 184 } 186 185 } … … 197 196 void TiledCoreAnimationDrawingArea::scheduleCompositingLayerFlush() 198 197 { 199 m_hasPendingFlush = true;200 201 198 if (m_layerTreeStateIsFrozen) { 202 199 m_isLayerFlushThrottlingTemporarilyDisabledForInteraction = false; … … 213 210 if (m_layerFlushThrottlingTimer.isActive()) { 214 211 ASSERT(m_isThrottlingLayerFlushes); 215 return;216 }217 218 if (m_isThrottlingLayerFlushes) {219 startLayerFlushThrottlingTimer();220 212 return; 221 213 } … … 488 480 } forPhase:kCATransactionPhasePostCommit]; 489 481 490 m_hasPendingFlush = !m_webPage.mainFrameView()->flushCompositingStateIncludingSubframes();482 bool didFlushAllFrames = m_webPage.mainFrameView()->flushCompositingStateIncludingSubframes(); 491 483 492 484 #if ENABLE(ASYNC_SCROLLING) … … 505 497 } 506 498 507 if ( !m_hasPendingFlush)499 if (didFlushAllFrames) 508 500 invalidateLayerFlushRunLoopObserver(); 509 501 … … 966 958 invalidateLayerFlushRunLoopObserver(); 967 959 startLayerFlushThrottlingTimer(); 968 } else if (m_hasPendingFlush)960 } else 969 961 scheduleLayerFlushRunLoopObserver(); 970 962 … … 989 981 if (m_layerTreeStateIsFrozen) 990 982 return; 991 if (!m_hasPendingFlush)992 return;993 983 scheduleLayerFlushRunLoopObserver(); 994 984 }
Note: See TracChangeset
for help on using the changeset viewer.