Changeset 244291 in webkit
- Timestamp:
- Apr 15, 2019 2:34:10 PM (5 years ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r244288 r244291 1 2019-04-15 Zalan Bujtas <zalan@apple.com> 2 3 DrawingArea should only capture painting related milestones 4 https://bugs.webkit.org/show_bug.cgi?id=196926 5 <rdar://problem/48003845> 6 7 Reviewed by Tim Horton. 8 9 While dispatching layout milestones (mixture of layout and painting items), the associated drawing areas should only capture the painting related milestones. 10 These captured milestones get dispatched later in the commit handler to ensure that they are not forwarded prematurely. 11 However the truly layout related milestones (e.g. DidFirstVisuallyNonEmptyLayout) should be dispatched right away with no delay. 12 13 * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h: 14 (WebKit::RemoteLayerTreeTransaction::newlyReachedPaintingMilestones const): 15 (WebKit::RemoteLayerTreeTransaction::setNewlyReachedPaintingMilestones): 16 (WebKit::RemoteLayerTreeTransaction::newlyReachedLayoutMilestones const): Deleted. 17 (WebKit::RemoteLayerTreeTransaction::setNewlyReachedLayoutMilestones): Deleted. 18 * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm: 19 (WebKit::RemoteLayerTreeTransaction::encode const): 20 (WebKit::RemoteLayerTreeTransaction::decode): 21 * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm: 22 (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree): 23 * WebProcess/WebPage/DrawingArea.h: 24 (WebKit::DrawingArea::addMilestonesToDispatch): 25 (WebKit::DrawingArea::dispatchDidReachLayoutMilestone): Deleted. 26 * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h: 27 (WebKit::RemoteLayerTreeDrawingArea::addMilestonesToDispatch): 28 * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm: 29 (WebKit::RemoteLayerTreeDrawingArea::flushLayers): 30 (WebKit::RemoteLayerTreeDrawingArea::dispatchDidReachLayoutMilestone): Deleted. 31 * WebProcess/WebPage/WebPage.cpp: 32 (WebKit::WebPage::dispatchDidReachLayoutMilestone): 33 * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h: 34 (WebKit::TiledCoreAnimationDrawingArea::addMilestonesToDispatch): 35 * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm: 36 (WebKit::TiledCoreAnimationDrawingArea::sendPendingNewlyReachedPaintingMilestones): 37 (WebKit::TiledCoreAnimationDrawingArea::flushLayers): 38 (WebKit::TiledCoreAnimationDrawingArea::sendPendingNewlyReachedLayoutMilestones): Deleted. 39 (WebKit::TiledCoreAnimationDrawingArea::dispatchDidReachLayoutMilestone): Deleted. 40 1 41 2019-04-15 John Wilander <wilander@apple.com> 2 42 -
trunk/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h
r243962 r244291 272 272 void setCallbackIDs(Vector<TransactionCallbackID>&& callbackIDs) { m_callbackIDs = WTFMove(callbackIDs); } 273 273 274 OptionSet<WebCore::LayoutMilestone> newlyReached LayoutMilestones() const { return m_newlyReachedLayoutMilestones; }275 void setNewlyReached LayoutMilestones(OptionSet<WebCore::LayoutMilestone> milestones) { m_newlyReachedLayoutMilestones = milestones; }274 OptionSet<WebCore::LayoutMilestone> newlyReachedPaintingMilestones() const { return m_newlyReachedPaintingMilestones; } 275 void setNewlyReachedPaintingMilestones(OptionSet<WebCore::LayoutMilestone> milestones) { m_newlyReachedPaintingMilestones = milestones; } 276 276 277 277 bool hasEditorState() const { return !!m_editorState; } … … 309 309 uint64_t m_transactionID { 0 }; 310 310 ActivityStateChangeID m_activityStateChangeID { ActivityStateChangeAsynchronous }; 311 OptionSet<WebCore::LayoutMilestone> m_newlyReached LayoutMilestones;311 OptionSet<WebCore::LayoutMilestone> m_newlyReachedPaintingMilestones; 312 312 bool m_scaleWasSetByUIProcess { false }; 313 313 bool m_allowsUserScaling { false }; -
trunk/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm
r243962 r244291 563 563 encoder << m_activityStateChangeID; 564 564 565 encoder << m_newlyReached LayoutMilestones;565 encoder << m_newlyReachedPaintingMilestones; 566 566 567 567 encoder << m_scaleWasSetByUIProcess; … … 674 674 return false; 675 675 676 if (!decoder.decode(result.m_newlyReached LayoutMilestones))676 if (!decoder.decode(result.m_newlyReachedPaintingMilestones)) 677 677 return false; 678 678 -
trunk/Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm
r243847 r244291 256 256 #endif 257 257 258 if (auto milestones = layerTreeTransaction.newlyReached LayoutMilestones())258 if (auto milestones = layerTreeTransaction.newlyReachedPaintingMilestones()) 259 259 m_webPageProxy.didReachLayoutMilestone(milestones); 260 260 -
trunk/Source/WebKit/WebProcess/WebPage/DrawingArea.h
r242346 r244291 133 133 virtual void setShouldScaleViewToFitDocument(bool) { } 134 134 135 virtual bool dispatchDidReachLayoutMilestone(OptionSet<WebCore::LayoutMilestone>) { return false; }135 virtual bool addMilestonesToDispatch(OptionSet<WebCore::LayoutMilestone>) { return false; } 136 136 137 137 #if PLATFORM(COCOA) -
trunk/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h
r244198 r244291 110 110 bool adjustLayerFlushThrottling(WebCore::LayerFlushThrottleState::Flags) override; 111 111 112 bool dispatchDidReachLayoutMilestone(OptionSet<WebCore::LayoutMilestone>) override;112 bool addMilestonesToDispatch(OptionSet<WebCore::LayoutMilestone>) override; 113 113 114 114 void updateScrolledExposedRect(); … … 174 174 ActivityStateChangeID m_activityStateChangeID { ActivityStateChangeAsynchronous }; 175 175 176 OptionSet<WebCore::LayoutMilestone> m_pendingNewlyReached LayoutMilestones;176 OptionSet<WebCore::LayoutMilestone> m_pendingNewlyReachedPaintingMilestones; 177 177 178 178 RefPtr<WebCore::GraphicsLayer> m_contentLayer; … … 180 180 }; 181 181 182 inline bool RemoteLayerTreeDrawingArea::addMilestonesToDispatch(OptionSet<WebCore::LayoutMilestone> paintMilestones) 183 { 184 m_pendingNewlyReachedPaintingMilestones.add(paintMilestones); 185 return true; 186 } 187 182 188 } // namespace WebKit 183 189 -
trunk/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm
r244198 r244291 391 391 m_webPage.willCommitLayerTree(layerTransaction); 392 392 393 layerTransaction.setNewlyReached LayoutMilestones(m_pendingNewlyReachedLayoutMilestones);394 m_pendingNewlyReached LayoutMilestones = { };393 layerTransaction.setNewlyReachedPaintingMilestones(m_pendingNewlyReachedPaintingMilestones); 394 m_pendingNewlyReachedPaintingMilestones = { }; 395 395 396 396 layerTransaction.setActivityStateChangeID(m_activityStateChangeID); … … 533 533 } 534 534 535 bool RemoteLayerTreeDrawingArea::dispatchDidReachLayoutMilestone(OptionSet<WebCore::LayoutMilestone> layoutMilestones)536 {537 m_pendingNewlyReachedLayoutMilestones.add(layoutMilestones);538 return true;539 }540 541 535 void RemoteLayerTreeDrawingArea::adoptLayersFromDrawingArea(DrawingArea& oldDrawingArea) 542 536 { -
trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp
r244202 r244291 6226 6226 6227 6227 // The drawing area might want to defer dispatch of didLayout to the UI process. 6228 if (m_drawingArea && m_drawingArea->dispatchDidReachLayoutMilestone(milestones)) 6229 return; 6228 if (m_drawingArea) { 6229 static auto paintMilestones = OptionSet<WebCore::LayoutMilestone> { DidHitRelevantRepaintedObjectsAreaThreshold, DidFirstFlushForHeaderLayer, DidFirstPaintAfterSuppressedIncrementalRendering, DidRenderSignificantAmountOfText, DidFirstMeaningfulPaint }; 6230 auto drawingAreaRelatedMilestones = milestones & paintMilestones; 6231 if (drawingAreaRelatedMilestones && m_drawingArea->addMilestonesToDispatch(drawingAreaRelatedMilestones)) 6232 milestones.remove(drawingAreaRelatedMilestones); 6233 } 6230 6234 6231 6235 send(Messages::WebPageProxy::DidReachLayoutMilestone(milestones)); -
trunk/Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h
r243381 r244291 87 87 void attachViewOverlayGraphicsLayer(WebCore::GraphicsLayer*) override; 88 88 89 bool dispatchDidReachLayoutMilestone(OptionSet<WebCore::LayoutMilestone>) override;89 bool addMilestonesToDispatch(OptionSet<WebCore::LayoutMilestone> paintMilestones) override; 90 90 91 91 enum class FlushType { Normal, TransientZoom }; … … 126 126 void scaleViewToFitDocumentIfNeeded(); 127 127 128 void sendPendingNewlyReached LayoutMilestones();128 void sendPendingNewlyReachedPaintingMilestones(); 129 129 130 130 void layerFlushRunLoopCallback(); … … 164 164 RefPtr<WebCore::GraphicsLayer> m_viewOverlayRootLayer; 165 165 166 OptionSet<WebCore::LayoutMilestone> m_pendingNewlyReached LayoutMilestones;166 OptionSet<WebCore::LayoutMilestone> m_pendingNewlyReachedPaintingMilestones; 167 167 Vector<CallbackID> m_pendingCallbackIDs; 168 168 … … 179 179 }; 180 180 181 inline bool TiledCoreAnimationDrawingArea::addMilestonesToDispatch(OptionSet<WebCore::LayoutMilestone> paintMilestones) 182 { 183 m_pendingNewlyReachedPaintingMilestones.add(paintMilestones); 184 return true; 185 } 186 181 187 } // namespace WebKit 182 188 -
trunk/Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm
r244182 r244291 437 437 } 438 438 439 void TiledCoreAnimationDrawingArea::sendPendingNewlyReached LayoutMilestones()440 { 441 if (!m_pendingNewlyReached LayoutMilestones)442 return; 443 444 m_webPage.send(Messages::WebPageProxy::DidReachLayoutMilestone(m_pendingNewlyReached LayoutMilestones));445 m_pendingNewlyReached LayoutMilestones = { };439 void TiledCoreAnimationDrawingArea::sendPendingNewlyReachedPaintingMilestones() 440 { 441 if (!m_pendingNewlyReachedPaintingMilestones) 442 return; 443 444 m_webPage.send(Messages::WebPageProxy::DidReachLayoutMilestone(m_pendingNewlyReachedPaintingMilestones)); 445 m_pendingNewlyReachedPaintingMilestones = { }; 446 446 } 447 447 … … 485 485 } 486 486 if (auto drawingArea = static_cast<TiledCoreAnimationDrawingArea*>(retainedPage->drawingArea())) 487 drawingArea->sendPendingNewlyReached LayoutMilestones();487 drawingArea->sendPendingNewlyReachedPaintingMilestones(); 488 488 } forPhase:kCATransactionPhasePostCommit]; 489 489 … … 932 932 } 933 933 934 bool TiledCoreAnimationDrawingArea::dispatchDidReachLayoutMilestone(OptionSet<WebCore::LayoutMilestone> layoutMilestones)935 {936 m_pendingNewlyReachedLayoutMilestones.add(layoutMilestones);937 return true;938 }939 940 934 void TiledCoreAnimationDrawingArea::layerFlushRunLoopCallback() 941 935 {
Note: See TracChangeset
for help on using the changeset viewer.