Changeset 215964 in webkit
- Timestamp:
- Apr 28, 2017, 5:48:11 PM (8 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r215963 r215964 1 2017-04-28 Simon Fraser <simon.fraser@apple.com> 2 3 Enhance showLayerTree() to show fragments 4 https://bugs.webkit.org/show_bug.cgi?id=171469 5 6 Reviewed by Zalan Bujtas. 7 8 Have showLayerTree() dump fragments, like: 9 10 normal flow list(1) 11 layer 0x11c1879c0 at (0,0) size 700x1858 backgroundClip at (0,0) size 2120x779 clip at (0,0) size 2120x779 12 fragment 0: bounds in layer at (0,0) size 700x1858 fragment bounds at (0,0) size 700x779 13 fragment 1: bounds in layer at (710,-779) size 700x1858 fragment bounds at (710,0) size 700x779 14 fragment 2: bounds in layer at (1420,-1558) size 700x1858 fragment bounds at (1420,0) size 700x300 15 RenderMultiColumnFlowThread 0x11f1f3340 at (0,0) size 700x1858 16 17 We want these to show before the child renderers, so factor that code into writeLayerRenderers(). 18 19 Overloading of write() for layers doesn't help anyone, so call it writeLayer() for searchability. 20 21 * rendering/RenderLayer.cpp: 22 (WebCore::showLayerTree): 23 * rendering/RenderLayer.h: 24 * rendering/RenderTreeAsText.cpp: 25 (WebCore::writeLayer): 26 (WebCore::writeLayerRenderers): 27 (WebCore::writeLayers): 28 * rendering/RenderTreeAsText.h: 29 1 30 2017-04-28 Simon Fraser <simon.fraser@apple.com> 2 31 -
trunk/Source/WebCore/rendering/RenderLayer.cpp
r214819 r215964 7205 7205 return; 7206 7206 7207 WTF::String output = externalRepresentation(&layer->renderer().frame(), WebCore::RenderAsTextShowAllLayers | WebCore::RenderAsTextShowLayerNesting | WebCore::RenderAsTextShowCompositedLayers | WebCore::RenderAsTextShowAddresses | WebCore::RenderAsTextShowIDAndClass | WebCore::RenderAsTextDontUpdateLayout | WebCore::RenderAsTextShowLayoutState | WebCore::RenderAsTextShowOverflow | WebCore::RenderAsTextShowSVGGeometry );7207 WTF::String output = externalRepresentation(&layer->renderer().frame(), WebCore::RenderAsTextShowAllLayers | WebCore::RenderAsTextShowLayerNesting | WebCore::RenderAsTextShowCompositedLayers | WebCore::RenderAsTextShowAddresses | WebCore::RenderAsTextShowIDAndClass | WebCore::RenderAsTextDontUpdateLayout | WebCore::RenderAsTextShowLayoutState | WebCore::RenderAsTextShowOverflow | WebCore::RenderAsTextShowSVGGeometry | WebCore::RenderAsTextShowLayerFragments); 7208 7208 fprintf(stderr, "%s\n", output.utf8().data()); 7209 7209 } -
trunk/Source/WebCore/rendering/RenderLayer.h
r213466 r215964 529 529 ClipRect& backgroundRect, ClipRect& foregroundRect, const LayoutSize& offsetFromRoot) const; 530 530 531 // Public just for RenderTreeAsText. 532 void collectFragments(LayerFragments&, const RenderLayer* rootLayer, const LayoutRect& dirtyRect, 533 PaginationInclusionMode, 534 ClipRectsType, OverlayScrollbarSizeRelevancy inOverlayScrollbarSizeRelevancy, ShouldRespectOverflowClip, const LayoutSize& offsetFromRoot, 535 const LayoutRect* layerBoundingBox = nullptr, ShouldApplyRootOffsetToFragments = IgnoreRootOffsetForFragments); 536 531 537 LayoutRect childrenClipRect() const; // Returns the foreground clip rect of the layer in the document's coordinate space. 532 538 LayoutRect selfClipRect() const; // Returns the background clip rect of the layer in the document's coordinate space. … … 831 837 void paintList(Vector<RenderLayer*>*, GraphicsContext&, const LayerPaintingInfo&, PaintLayerFlags); 832 838 833 void collectFragments(LayerFragments&, const RenderLayer* rootLayer, const LayoutRect& dirtyRect,834 PaginationInclusionMode,835 ClipRectsType, OverlayScrollbarSizeRelevancy inOverlayScrollbarSizeRelevancy, ShouldRespectOverflowClip, const LayoutSize& offsetFromRoot,836 const LayoutRect* layerBoundingBox = nullptr, ShouldApplyRootOffsetToFragments = IgnoreRootOffsetForFragments);837 839 void updatePaintingInfoForFragments(LayerFragments&, const LayerPaintingInfo&, PaintLayerFlags, bool shouldPaintContent, const LayoutSize& offsetFromRoot); 838 840 void paintBackgroundForFragments(const LayerFragments&, GraphicsContext&, GraphicsContext& transparencyLayerContext, -
trunk/Source/WebCore/rendering/RenderTreeAsText.cpp
r215963 r215964 611 611 }; 612 612 613 static void write (TextStream& ts, const RenderLayer& layer, const LayoutRect& layerBounds, const LayoutRect& backgroundClipRect, const LayoutRect& clipRect,613 static void writeLayer(TextStream& ts, const RenderLayer& layer, const LayoutRect& layerBounds, const LayoutRect& backgroundClipRect, const LayoutRect& clipRect, 614 614 LayerPaintPhase paintPhase = LayerPaintPhaseAll, int indent = 0, RenderAsTextBehavior behavior = RenderAsTextBehaviorNormal) 615 615 { … … 673 673 674 674 ts << "\n"; 675 675 } 676 677 static void writeLayerRenderers(TextStream& ts, const RenderLayer& layer, LayerPaintPhase paintPhase = LayerPaintPhaseAll, int indent = 0, RenderAsTextBehavior behavior = RenderAsTextBehaviorNormal) 678 { 676 679 if (paintPhase != LayerPaintPhaseBackground) 677 680 write(ts, layer.renderer(), indent + 1, behavior); … … 771 774 ClipRect damageRect; 772 775 ClipRect clipRectToApply; 773 layer.calculateRects(RenderLayer::ClipRectsContext(&rootLayer, TemporaryClipRects), paintDirtyRect, layerBounds, damageRect, clipRectToApply, layer.offsetFromAncestor(&rootLayer)); 776 LayoutSize offsetFromRoot = layer.offsetFromAncestor(&rootLayer); 777 layer.calculateRects(RenderLayer::ClipRectsContext(&rootLayer, TemporaryClipRects), paintDirtyRect, layerBounds, damageRect, clipRectToApply, offsetFromRoot); 774 778 775 779 // Ensure our lists are up-to-date. … … 779 783 Vector<RenderLayer*>* negativeZOrderList = layer.negZOrderList(); 780 784 bool paintsBackgroundSeparately = negativeZOrderList && negativeZOrderList->size() > 0; 781 if (shouldPaint && paintsBackgroundSeparately) 782 write(ts, layer, layerBounds, damageRect.rect(), clipRectToApply.rect(), LayerPaintPhaseBackground, indent, behavior); 783 785 if (shouldPaint && paintsBackgroundSeparately) { 786 writeLayer(ts, layer, layerBounds, damageRect.rect(), clipRectToApply.rect(), LayerPaintPhaseBackground, indent, behavior); 787 writeLayerRenderers(ts, layer, paintsBackgroundSeparately ? LayerPaintPhaseForeground : LayerPaintPhaseAll, indent, behavior); 788 } 789 784 790 if (negativeZOrderList) { 785 791 int currIndent = indent; … … 794 800 } 795 801 796 if (shouldPaint) 797 write(ts, layer, layerBounds, damageRect.rect(), clipRectToApply.rect(), paintsBackgroundSeparately ? LayerPaintPhaseForeground : LayerPaintPhaseAll, indent, behavior); 798 802 if (shouldPaint) { 803 writeLayer(ts, layer, layerBounds, damageRect.rect(), clipRectToApply.rect(), paintsBackgroundSeparately ? LayerPaintPhaseForeground : LayerPaintPhaseAll, indent, behavior); 804 805 if (behavior & RenderAsTextShowLayerFragments) { 806 LayerFragments layerFragments; 807 layer.collectFragments(layerFragments, &rootLayer, paintDirtyRect, RenderLayer::PaginationInclusionMode::ExcludeCompositedPaginatedLayers, TemporaryClipRects, IgnoreOverlayScrollbarSize, RespectOverflowClip, offsetFromRoot); 808 809 if (layerFragments.size() > 1) { 810 for (unsigned i = 0; i < layerFragments.size(); ++i) { 811 const auto& fragment = layerFragments[i]; 812 writeIndent(ts, indent + 2); 813 ts << " fragment " << i << ": bounds in layer " << fragment.layerBounds << " fragment bounds " << fragment.boundingBox << "\n"; 814 } 815 } 816 } 817 818 writeLayerRenderers(ts, layer, paintsBackgroundSeparately ? LayerPaintPhaseForeground : LayerPaintPhaseAll, indent, behavior); 819 } 820 799 821 if (Vector<RenderLayer*>* normalFlowList = layer.normalFlowList()) { 800 822 int currIndent = indent; -
trunk/Source/WebCore/rendering/RenderTreeAsText.h
r208668 r215964 47 47 RenderAsTextShowOverflow = 1 << 8, // Print layout and visual overflow. 48 48 RenderAsTextShowSVGGeometry = 1 << 9, // Print additional geometry for SVG objects. 49 RenderAsTextShowLayerFragments = 1 << 10, // Print additional info about fragmented RenderLayers 49 50 }; 50 51 typedef unsigned RenderAsTextBehavior;
Note:
See TracChangeset
for help on using the changeset viewer.