Changeset 208328 in webkit
- Timestamp:
- Nov 3, 2016, 9:19:48 AM (9 years ago)
- Location:
- trunk/Source
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r208327 r208328 1 2016-11-03 Dan Bernstein <mitz@apple.com> 2 3 REGRESSION (r206247): Painting milestones can be delayed until the next layer flush 4 https://bugs.webkit.org/show_bug.cgi?id=164340 5 <rdar://problem/29074344> 6 7 Reviewed by Tim Horton. 8 9 To give WebKit a chance to deliver the painting milestones to its client after the commit, 10 we must tell it about them before or during the commit. To that end, we should not defer 11 the call to firePaintRelatedMilestonesIfNeeded until after the commit. 12 13 * rendering/RenderLayerCompositor.cpp: 14 (WebCore::RenderLayerCompositor::RenderLayerCompositor): Removed 15 m_paintRelatedMilestonesTimer initializer. 16 (WebCore::RenderLayerCompositor::didPaintBacking): Call 17 FrameView::firePaintRelatedMilestonesIfNeeded directly from here. 18 (WebCore::RenderLayerCompositor::paintRelatedMilestonesTimerFired): Deleted. 19 * rendering/RenderLayerCompositor.h: 20 1 21 2016-11-03 Antti Koivisto <antti@apple.com> 2 22 -
trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp
r208213 r208328 275 275 : m_renderView(renderView) 276 276 , m_updateCompositingLayersTimer(*this, &RenderLayerCompositor::updateCompositingLayersTimerFired) 277 , m_paintRelatedMilestonesTimer(*this, &RenderLayerCompositor::paintRelatedMilestonesTimerFired)278 277 , m_layerFlushTimer(*this, &RenderLayerCompositor::layerFlushTimerFired) 279 278 { … … 570 569 FrameView& frameView = m_renderView.frameView(); 571 570 frameView.setLastPaintTime(monotonicallyIncreasingTime()); 572 if (frameView.milestonesPendingPaint() && !m_paintRelatedMilestonesTimer.isActive())573 m_paintRelatedMilestonesTimer.startOneShot(0);571 if (frameView.milestonesPendingPaint()) 572 frameView.firePaintRelatedMilestonesIfNeeded(); 574 573 } 575 574 … … 4201 4200 } 4202 4201 4203 void RenderLayerCompositor::paintRelatedMilestonesTimerFired()4204 {4205 Frame& frame = m_renderView.frameView().frame();4206 Page* page = frame.page();4207 if (!page)4208 return;4209 4210 // If the layer tree is frozen, we'll paint when it's unfrozen and schedule the timer again.4211 if (page->chrome().client().layerTreeStateIsFrozen())4212 return;4213 4214 m_renderView.frameView().firePaintRelatedMilestonesIfNeeded();4215 }4216 4217 4202 #if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR) 4218 4203 RefPtr<DisplayRefreshMonitor> RenderLayerCompositor::createDisplayRefreshMonitor(PlatformDisplayID displayID) const -
trunk/Source/WebCore/rendering/RenderLayerCompositor.h
r206538 r208328 476 476 void layerFlushTimerFired(); 477 477 478 void paintRelatedMilestonesTimerFired();479 480 478 #if !LOG_DISABLED 481 479 const char* logReasonsForCompositing(const RenderLayer&); … … 549 547 std::unique_ptr<GraphicsLayerUpdater> m_layerUpdater; // Updates tiled layer visible area periodically while animations are running. 550 548 551 Timer m_paintRelatedMilestonesTimer;552 549 Timer m_layerFlushTimer; 553 550 -
trunk/Source/WebKit2/ChangeLog
r208307 r208328 1 2016-11-03 Dan Bernstein <mitz@apple.com> 2 3 REGRESSION (r206247): Painting milestones can be delayed until the next layer flush 4 https://bugs.webkit.org/show_bug.cgi?id=164340 5 <rdar://problem/29074344> 6 7 Reviewed by Tim Horton. 8 9 * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h: Declared new helper function. 10 * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm: 11 (WebKit::TiledCoreAnimationDrawingArea::sendPendingNewlyReachedLayoutMilestones): Helper 12 function that sends the message to the UI process and resets 13 m_pendingNewlyReachedLayoutMilestones. 14 (WebKit::TiledCoreAnimationDrawingArea::flushLayers): Wait until after the commit to get the 15 pending milestones and send them to the UI process. This way we don’t miss milestones that 16 fire during the commit. 17 1 18 2016-11-02 David Kilzer <ddkilzer@apple.com> 2 19 -
trunk/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h
r208225 r208328 123 123 void scaleViewToFitDocumentIfNeeded(); 124 124 125 void sendPendingNewlyReachedLayoutMilestones(); 126 125 127 bool m_layerTreeStateIsFrozen; 126 128 WebCore::LayerFlushScheduler m_layerFlushScheduler; -
trunk/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm
r208225 r208328 395 395 } 396 396 397 void TiledCoreAnimationDrawingArea::sendPendingNewlyReachedLayoutMilestones() 398 { 399 if (!m_pendingNewlyReachedLayoutMilestones) 400 return; 401 402 m_webPage.send(Messages::WebPageProxy::DidReachLayoutMilestone(m_pendingNewlyReachedLayoutMilestones)); 403 m_pendingNewlyReachedLayoutMilestones = 0; 404 } 405 397 406 bool TiledCoreAnimationDrawingArea::flushLayers() 398 407 { … … 419 428 m_viewOverlayRootLayer->flushCompositingState(visibleRect, m_webPage.mainFrameView()->viewportIsStable()); 420 429 430 RefPtr<WebPage> retainedPage = &m_webPage; 421 431 #if TARGET_OS_IPHONE || (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101100) 422 RefPtr<WebPage> retainedPage = &m_webPage;423 432 [CATransaction addCommitHandler:[retainedPage] { 424 433 if (Page* corePage = retainedPage->corePage()) { … … 426 435 corePage->inspectorController().didComposite(*coreFrame); 427 436 } 437 if (auto drawingArea = static_cast<TiledCoreAnimationDrawingArea*>(retainedPage->drawingArea())) 438 drawingArea->sendPendingNewlyReachedLayoutMilestones(); 428 439 } forPhase:kCATransactionPhasePostCommit]; 440 #else 441 dispatch_async(dispatch_get_main_queue(), [retainedPage] { 442 if (auto drawingArea = static_cast<TiledCoreAnimationDrawingArea*>(retainedPage->drawingArea())) 443 drawingArea->sendPendingNewlyReachedLayoutMilestones(); 444 }); 429 445 #endif 430 446 … … 439 455 if (m_transientZoomScale != 1) 440 456 applyTransientZoomToLayers(m_transientZoomScale, m_transientZoomOrigin); 441 442 if (m_pendingNewlyReachedLayoutMilestones)443 m_webPage.send(Messages::WebPageProxy::DidReachLayoutMilestone(m_pendingNewlyReachedLayoutMilestones));444 m_pendingNewlyReachedLayoutMilestones = 0;445 457 446 458 return returnValue;
Note:
See TracChangeset
for help on using the changeset viewer.