Changeset 216103 in webkit
- Timestamp:
- May 2, 2017, 4:06:09 PM (8 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r216102 r216103 1 2017-05-02 Simon Fraser <simon.fraser@apple.com> 2 3 Improve scrolling tree logging 4 https://bugs.webkit.org/show_bug.cgi?id=171574 5 6 Reviewed by Tim Horton. 7 8 Make a call to showScrollingStateTree() print debugging-related information like node and layer IDs. 9 Required fixing scrolling state tree nodes to respect ScrollingStateTreeAsTextBehavior, and fixing 10 fixed and sticky nodes to call super. 11 12 Also enhance compositing logging to show layer IDs, and to log for layer scrolling tree registration. 13 14 * page/scrolling/AsyncScrollingCoordinator.cpp: 15 (WebCore::AsyncScrollingCoordinator::scrollingStateTreeAsText): 16 * page/scrolling/AsyncScrollingCoordinator.h: 17 * page/scrolling/ScrollingCoordinator.cpp: 18 (WebCore::ScrollingCoordinator::scrollingStateTreeAsText): 19 * page/scrolling/ScrollingCoordinator.h: 20 * page/scrolling/ScrollingStateFixedNode.cpp: 21 (WebCore::ScrollingStateFixedNode::dumpProperties): 22 * page/scrolling/ScrollingStateNode.cpp: 23 (WebCore::ScrollingStateNode::dumpProperties): 24 (WebCore::ScrollingStateNode::scrollingStateTreeAsText): 25 * page/scrolling/ScrollingStateNode.h: 26 * page/scrolling/ScrollingStateScrollingNode.cpp: 27 (WebCore::ScrollingStateScrollingNode::dumpProperties): 28 * page/scrolling/ScrollingStateStickyNode.cpp: 29 (WebCore::ScrollingStateStickyNode::dumpProperties): 30 * page/scrolling/ScrollingStateTree.cpp: 31 (showScrollingStateTree): 32 * page/scrolling/mac/ScrollingCoordinatorMac.mm: 33 (WebCore::ScrollingCoordinatorMac::commitTreeState): 34 * rendering/RenderLayerBacking.cpp: 35 (WebCore::RenderLayerBacking::detachFromScrollingCoordinator): 36 * rendering/RenderLayerCompositor.cpp: 37 (WebCore::RenderLayerCompositor::logLayerInfo): 38 (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer): 39 1 40 2017-05-02 Daniel Bates <dabates@apple.com> 2 41 -
trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp
r215160 r216103 627 627 } 628 628 629 String AsyncScrollingCoordinator::scrollingStateTreeAsText( ) const629 String AsyncScrollingCoordinator::scrollingStateTreeAsText(ScrollingStateTreeAsTextBehavior behavior) const 630 630 { 631 631 if (m_scrollingStateTree->rootStateNode()) { 632 632 if (m_eventTrackingRegionsDirty) 633 633 m_scrollingStateTree->rootStateNode()->setEventTrackingRegions(absoluteEventTrackingRegions()); 634 return m_scrollingStateTree->rootStateNode()->scrollingStateTreeAsText( );634 return m_scrollingStateTree->rootStateNode()->scrollingStateTreeAsText(behavior); 635 635 } 636 636 -
trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.h
r211033 r216103 77 77 void updateScrollPositionAfterAsyncScroll(ScrollingNodeID, const FloatPoint&, std::optional<FloatPoint> layoutViewportOrigin, bool programmaticScroll, ScrollingLayerPositionAction); 78 78 79 WEBCORE_EXPORT String scrollingStateTreeAsText( ) const override;79 WEBCORE_EXPORT String scrollingStateTreeAsText(ScrollingStateTreeAsTextBehavior = ScrollingStateTreeAsTextBehaviorNormal) const override; 80 80 WEBCORE_EXPORT void willCommitTree() override; 81 81 -
trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.cpp
r214082 r216103 389 389 } 390 390 391 String ScrollingCoordinator::scrollingStateTreeAsText( ) const391 String ScrollingCoordinator::scrollingStateTreeAsText(ScrollingStateTreeAsTextBehavior) const 392 392 { 393 393 return String(); -
trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.h
r210560 r216103 54 54 enum ScrollingNodeType { FrameScrollingNode, OverflowScrollingNode, FixedNode, StickyNode }; 55 55 56 enum ScrollingStateTreeAsTextBehaviorFlags { 57 ScrollingStateTreeAsTextBehaviorNormal = 0, 58 ScrollingStateTreeAsTextBehaviorIncludeLayerIDs = 1 << 0, 59 ScrollingStateTreeAsTextBehaviorIncludeNodeIDs = 1 << 1, 60 ScrollingStateTreeAsTextBehaviorIncludeLayerPositions = 1 << 2, 61 ScrollingStateTreeAsTextBehaviorDebug = ScrollingStateTreeAsTextBehaviorIncludeLayerIDs | ScrollingStateTreeAsTextBehaviorIncludeNodeIDs | ScrollingStateTreeAsTextBehaviorIncludeLayerPositions 62 }; 63 typedef unsigned ScrollingStateTreeAsTextBehavior; 64 56 65 class Document; 57 66 class Frame; … … 182 191 virtual void updateOverflowScrollingNode(ScrollingNodeID, GraphicsLayer* /*scrollLayer*/, GraphicsLayer* /*scrolledContentsLayer*/, const ScrollingGeometry* = nullptr) { } 183 192 virtual void reconcileViewportConstrainedLayerPositions(const LayoutRect&, ScrollingLayerPositionAction) { } 184 virtual String scrollingStateTreeAsText( ) const;193 virtual String scrollingStateTreeAsText(ScrollingStateTreeAsTextBehavior = ScrollingStateTreeAsTextBehaviorNormal) const; 185 194 virtual bool isRubberBandInProgress() const { return false; } 186 195 virtual bool isScrollSnapInProgress() const { return false; } -
trunk/Source/WebCore/page/scrolling/ScrollingStateFixedNode.cpp
r208927 r216103 94 94 } 95 95 96 void ScrollingStateFixedNode::dumpProperties(TextStream& ts, int indent, ScrollingStateTreeAsTextBehavior ) const96 void ScrollingStateFixedNode::dumpProperties(TextStream& ts, int indent, ScrollingStateTreeAsTextBehavior behavior) const 97 97 { 98 98 ts << "(" << "Fixed node" << "\n"; 99 ScrollingStateNode::dumpProperties(ts, indent, behavior); 99 100 100 101 if (m_constraints.anchorEdges()) { -
trunk/Source/WebCore/page/scrolling/ScrollingStateNode.cpp
r211033 r216103 113 113 } 114 114 115 void ScrollingStateNode::dumpProperties(TextStream& ts, int indent, ScrollingStateTreeAsTextBehavior behavior) const 116 { 117 if (behavior & ScrollingStateTreeAsTextBehaviorIncludeNodeIDs) { 118 writeIndent(ts, indent + 1); 119 ts << "(nodeID " << scrollingNodeID() << ")\n"; 120 } 121 122 if (behavior & ScrollingStateTreeAsTextBehaviorIncludeLayerIDs) { 123 writeIndent(ts, indent + 1); 124 ts << "(layerID " << layer().layerID() << ")\n"; 125 } 126 } 127 115 128 void ScrollingStateNode::dump(TextStream& ts, int indent, ScrollingStateTreeAsTextBehavior behavior) const 116 129 { … … 132 145 } 133 146 134 String ScrollingStateNode::scrollingStateTreeAsText( ) const147 String ScrollingStateNode::scrollingStateTreeAsText(ScrollingStateTreeAsTextBehavior behavior) const 135 148 { 136 149 TextStream ts(TextStream::LineMode::MultipleLine, TextStream::Formatting::SVGStyleRect); 137 150 138 dump(ts, 0, ScrollingStateTreeAsTextBehaviorNormal);151 dump(ts, 0, behavior); 139 152 return ts.release(); 140 153 } -
trunk/Source/WebCore/page/scrolling/ScrollingStateNode.h
r211033 r216103 40 40 class TextStream; 41 41 42 enum ScrollingStateTreeAsTextBehaviorFlags {43 ScrollingStateTreeAsTextBehaviorNormal = 0,44 ScrollingStateTreeAsTextBehaviorIncludeLayerIDs = 1 << 0,45 ScrollingStateTreeAsTextBehaviorIncludeNodeIDs = 1 << 1,46 ScrollingStateTreeAsTextBehaviorIncludeLayerPositions = 1 << 2,47 ScrollingStateTreeAsTextBehaviorDebug = ScrollingStateTreeAsTextBehaviorIncludeLayerIDs | ScrollingStateTreeAsTextBehaviorIncludeNodeIDs | ScrollingStateTreeAsTextBehaviorIncludeLayerPositions48 };49 typedef unsigned ScrollingStateTreeAsTextBehavior;50 51 42 // Used to allow ScrollingStateNodes to refer to layers in various contexts: 52 43 // a) Async scrolling, main thread: ScrollingStateNode holds onto a GraphicsLayer, and uses m_layerID … … 241 232 void appendChild(Ref<ScrollingStateNode>&&); 242 233 243 String scrollingStateTreeAsText( ) const;234 String scrollingStateTreeAsText(ScrollingStateTreeAsTextBehavior = ScrollingStateTreeAsTextBehaviorNormal) const; 244 235 245 236 protected: 246 237 ScrollingStateNode(const ScrollingStateNode&, ScrollingStateTree&); 247 238 239 virtual void dumpProperties(TextStream&, int indent, ScrollingStateTreeAsTextBehavior) const; 240 248 241 private: 249 242 void dump(TextStream&, int indent, ScrollingStateTreeAsTextBehavior) const; 250 251 virtual void dumpProperties(TextStream&, int indent, ScrollingStateTreeAsTextBehavior) const = 0;252 243 253 244 const ScrollingNodeType m_nodeType; -
trunk/Source/WebCore/page/scrolling/ScrollingStateScrollingNode.cpp
r210560 r216103 186 186 } 187 187 188 void ScrollingStateScrollingNode::dumpProperties(TextStream& ts, int indent, ScrollingStateTreeAsTextBehavior) const 189 { 188 void ScrollingStateScrollingNode::dumpProperties(TextStream& ts, int indent, ScrollingStateTreeAsTextBehavior behavior) const 189 { 190 ScrollingStateNode::dumpProperties(ts, indent, behavior); 191 190 192 if (m_scrollPosition != FloatPoint()) { 191 193 writeIndent(ts, indent + 1); -
trunk/Source/WebCore/page/scrolling/ScrollingStateStickyNode.cpp
r208927 r216103 94 94 } 95 95 96 void ScrollingStateStickyNode::dumpProperties(TextStream& ts, int indent, ScrollingStateTreeAsTextBehavior ) const96 void ScrollingStateStickyNode::dumpProperties(TextStream& ts, int indent, ScrollingStateTreeAsTextBehavior behavior) const 97 97 { 98 98 ts << "(" << "Sticky node" << "\n"; 99 ScrollingStateNode::dumpProperties(ts, indent, behavior); 99 100 100 101 if (m_constraints.anchorEdges()) { -
trunk/Source/WebCore/page/scrolling/ScrollingStateTree.cpp
r211033 r216103 277 277 } 278 278 279 String output = rootNode->scrollingStateTreeAsText( );279 String output = rootNode->scrollingStateTreeAsText(WebCore::ScrollingStateTreeAsTextBehaviorDebug); 280 280 fprintf(stderr, "%s\n", output.utf8().data()); 281 281 } -
trunk/Source/WebCore/page/scrolling/mac/ScrollingCoordinatorMac.mm
r215160 r216103 118 118 return; 119 119 120 LOG(Scrolling, "%s", scrollingStateTreeAsText( ).utf8().data());120 LOG(Scrolling, "%s", scrollingStateTreeAsText(ScrollingStateTreeAsTextBehaviorDebug).utf8().data()); 121 121 122 122 RefPtr<ThreadedScrollingTree> threadedScrollingTree = downcast<ThreadedScrollingTree>(scrollingTree()); -
trunk/Source/WebCore/rendering/RenderLayerBacking.cpp
r215181 r216103 45 45 #include "InspectorInstrumentation.h" 46 46 #include "KeyframeList.h" 47 #include "Logging.h" 47 48 #include "MainFrame.h" 48 49 #include "Page.h" … … 1781 1782 1782 1783 if ((roles & Scrolling) && m_scrollingNodeID) { 1784 LOG(Compositing, "Detaching Scrolling node %llu", m_scrollingNodeID); 1783 1785 scrollingCoordinator->detachFromStateTree(m_scrollingNodeID); 1784 1786 m_scrollingNodeID = 0; … … 1786 1788 1787 1789 if ((roles & ViewportConstrained) && m_viewportConstrainedNodeID) { 1790 LOG(Compositing, "Detaching ViewportConstrained node %llu", m_viewportConstrainedNodeID); 1788 1791 scrollingCoordinator->detachFromStateTree(m_viewportConstrainedNodeID); 1789 1792 m_viewportConstrainedNodeID = 0; -
trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp
r216047 r216103 811 811 812 812 StringBuilder logString; 813 logString.append(String::format("%*p (%.3f,%.3f-%.3f,%.3f) %.2fKB", 12 + depth * 2, &layer,813 logString.append(String::format("%*p id %llu (%.3f,%.3f-%.3f,%.3f) %.2fKB", 12 + depth * 2, &layer, backing->graphicsLayer()->primaryLayerID(), 814 814 absoluteBounds.x().toFloat(), absoluteBounds.y().toFloat(), absoluteBounds.maxX().toFloat(), absoluteBounds.maxY().toFloat(), 815 815 backing->backingStoreMemoryEstimate() / 1024)); … … 3905 3905 if (!nodeID) 3906 3906 return; 3907 3908 LOG(Compositing, "Registering ViewportConstrained scrolling node %llu (layer %llu) as child of %llu", nodeID, backing->graphicsLayer()->primaryLayerID(), parentNodeID); 3907 3909 3908 3910 switch (nodeType) { … … 3921 3923 } else 3922 3924 detachScrollCoordinatedLayer(layer, ViewportConstrained); 3923 3925 3924 3926 if (reasons & Scrolling) { 3925 3927 if (isRootLayer) … … 3949 3951 scrollingGeometry.currentVerticalSnapPointIndex = layer.currentVerticalSnapPointIndex(); 3950 3952 #endif 3953 3954 LOG(Compositing, "Registering Scrolling scrolling node %llu (layer %llu) as child of %llu", nodeID, backing->graphicsLayer()->primaryLayerID(), parentNodeID); 3955 3951 3956 scrollingCoordinator->updateOverflowScrollingNode(nodeID, backing->scrollingLayer(), backing->scrollingContentsLayer(), &scrollingGeometry); 3952 3957 }
Note:
See TracChangeset
for help on using the changeset viewer.