Changeset 277358 in webkit
- Timestamp:
- May 11, 2021, 11:04:18 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/fast/harness/render-tree-as-text-options-expected.txt (modified) (1 diff)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/rendering/RenderLayerCompositor.cpp (modified) (3 diffs)
-
Source/WebCore/rendering/RenderLayerCompositor.h (modified) (2 diffs)
-
Source/WebCore/rendering/RenderTreeAsText.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r277345 r277358 1 2021-05-11 Cameron McCormack <heycam@apple.com> 2 3 Include reasons for compositing in showLayerTree output 4 https://bugs.webkit.org/show_bug.cgi?id=225640 5 6 Reviewed by Simon Fraser. 7 8 * fast/harness/render-tree-as-text-options-expected.txt: 9 1 10 2021-05-11 Toshio Ogasawara <toshio.ogasawara@access-company.com> 2 11 -
trunk/LayoutTests/fast/harness/render-tree-as-text-options-expected.txt
r244599 r277358 1 layer at (0,0) size 800x600 (composited , bounds=at (0,0) size 800x600, drawsContent=1, paints into ancestor=0)1 layer at (0,0) size 800x600 (composited [root], bounds=at (0,0) size 800x600, drawsContent=1, paints into ancestor=0) 2 2 RenderView at (0,0) size 800x600 3 3 positive z-order list (1) 4 layer at (0,0) size 800x516 layerType: background only (composited , bounds=at (0,0) size 800x600, drawsContent=1, paints into ancestor=0)4 layer at (0,0) size 800x516 layerType: background only (composited [negative z-index children], bounds=at (0,0) size 800x600, drawsContent=1, paints into ancestor=0) 5 5 negative z-order list (1) 6 layer at (8,258) size 102x52 (composited , bounds=at (0,0) size 102x52, drawsContent=1, paints into ancestor=0)6 layer at (8,258) size 102x52 (composited [3D transform], bounds=at (0,0) size 102x52, drawsContent=1, paints into ancestor=0) 7 7 RenderBlock (positioned) zI: -1 {DIV} at (8,258) size 102x52 [border: (1px solid #000000)] 8 layer at (0,0) size 800x516 layerType: foreground only (composited , bounds=at (0,0) size 800x600, drawsContent=1, paints into ancestor=0)8 layer at (0,0) size 800x516 layerType: foreground only (composited [negative z-index children], bounds=at (0,0) size 800x600, drawsContent=1, paints into ancestor=0) 9 9 RenderBlock {HTML} at (0,0) size 800x516 10 10 RenderBody {BODY} at (8,8) size 784x500 -
trunk/Source/WebCore/ChangeLog
r277357 r277358 1 2021-05-11 Cameron McCormack <heycam@apple.com> 2 3 Include reasons for compositing in showLayerTree output 4 https://bugs.webkit.org/show_bug.cgi?id=225640 5 6 Reviewed by Simon Fraser. 7 8 Since it seems useful to know why a layer is composited. 9 10 The logging code was only including one reason, rather than the 11 whole set of reasons, and that's unchanged (except for the function 12 name to make that clearer), although we could also just make that 13 include all of the reasons too. 14 15 There were two reason strings missing, which are also added -- 16 OverflowScrollPositioning and WillChange -- which the use of a 17 switch should help catch in the future. 18 19 * rendering/RenderLayerCompositor.cpp: 20 (WebCore::RenderLayerCompositor::logLayerInfo): 21 (WebCore::compositingReasonToString): 22 (WebCore::RenderLayerCompositor::logReasonsForCompositing): 23 (WebCore::operator<<): 24 * rendering/RenderLayerCompositor.h: 25 * rendering/RenderTreeAsText.cpp: 26 1 27 2021-05-11 Chris Dumez <cdumez@apple.com> 2 28 -
trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp
r276744 r277358 1538 1538 logString.append(" z-index: ", layer.renderer().style().usedZIndex()); 1539 1539 1540 logString.append(" (", log ReasonsForCompositing(layer), ") ");1540 logString.append(" (", logOneReasonForCompositing(layer), ") "); 1541 1541 1542 1542 if (backing->graphicsLayer()->contentsOpaque() || backing->paintsIntoCompositedAncestor() || backing->foregroundLayer() || backing->backgroundLayer()) { … … 2771 2771 } 2772 2772 2773 static const char* compositingReasonToString(CompositingReason reason) 2774 { 2775 switch (reason) { 2776 case CompositingReason::Transform3D: return "3D transform"; 2777 case CompositingReason::Video: return "video"; 2778 case CompositingReason::Canvas: return "canvas"; 2779 case CompositingReason::Plugin: return "plugin"; 2780 case CompositingReason::IFrame: return "iframe"; 2781 case CompositingReason::BackfaceVisibilityHidden: return "backface-visibility: hidden"; 2782 case CompositingReason::ClipsCompositingDescendants: return "clips compositing descendants"; 2783 case CompositingReason::Animation: return "animation"; 2784 case CompositingReason::Filters: return "filters"; 2785 case CompositingReason::PositionFixed: return "position: fixed"; 2786 case CompositingReason::PositionSticky: return "position: sticky"; 2787 case CompositingReason::OverflowScrolling: return "async overflow scrolling"; 2788 case CompositingReason::Stacking: return "stacking"; 2789 case CompositingReason::Overlap: return "overlap"; 2790 case CompositingReason::OverflowScrollPositioning: return "overflow scroll positioning"; 2791 case CompositingReason::NegativeZIndexChildren: return "negative z-index children"; 2792 case CompositingReason::TransformWithCompositedDescendants: return "transform with composited descendants"; 2793 case CompositingReason::OpacityWithCompositedDescendants: return "opacity with composited descendants"; 2794 case CompositingReason::MaskWithCompositedDescendants: return "mask with composited descendants"; 2795 case CompositingReason::ReflectionWithCompositedDescendants: return "reflection with composited descendants"; 2796 case CompositingReason::FilterWithCompositedDescendants: return "filter with composited descendants"; 2797 case CompositingReason::BlendingWithCompositedDescendants: return "blending with composited descendants"; 2798 case CompositingReason::IsolatesCompositedBlendingDescendants: return "isolates composited blending descendants"; 2799 case CompositingReason::Perspective: return "perspective"; 2800 case CompositingReason::Preserve3D: return "preserve-3d"; 2801 case CompositingReason::WillChange: return "will-change"; 2802 case CompositingReason::Root: return "root"; 2803 case CompositingReason::Model: return "model"; 2804 } 2805 return ""; 2806 } 2807 2773 2808 #if !LOG_DISABLED 2774 const char* RenderLayerCompositor::logReasonsForCompositing(const RenderLayer& layer) 2775 { 2776 OptionSet<CompositingReason> reasons = reasonsForCompositing(layer); 2777 2778 if (reasons & CompositingReason::Transform3D) 2779 return "3D transform"; 2780 2781 if (reasons & CompositingReason::Video) 2782 return "video"; 2783 2784 if (reasons & CompositingReason::Canvas) 2785 return "canvas"; 2786 2787 if (reasons & CompositingReason::Plugin) 2788 return "plugin"; 2789 2790 if (reasons & CompositingReason::IFrame) 2791 return "iframe"; 2792 2793 if (reasons & CompositingReason::BackfaceVisibilityHidden) 2794 return "backface-visibility: hidden"; 2795 2796 if (reasons & CompositingReason::ClipsCompositingDescendants) 2797 return "clips compositing descendants"; 2798 2799 if (reasons & CompositingReason::Animation) 2800 return "animation"; 2801 2802 if (reasons & CompositingReason::Filters) 2803 return "filters"; 2804 2805 if (reasons & CompositingReason::PositionFixed) 2806 return "position: fixed"; 2807 2808 if (reasons & CompositingReason::PositionSticky) 2809 return "position: sticky"; 2810 2811 if (reasons & CompositingReason::OverflowScrolling) 2812 return "async overflow scrolling"; 2813 2814 if (reasons & CompositingReason::Stacking) 2815 return "stacking"; 2816 2817 if (reasons & CompositingReason::Overlap) 2818 return "overlap"; 2819 2820 if (reasons & CompositingReason::NegativeZIndexChildren) 2821 return "negative z-index children"; 2822 2823 if (reasons & CompositingReason::TransformWithCompositedDescendants) 2824 return "transform with composited descendants"; 2825 2826 if (reasons & CompositingReason::OpacityWithCompositedDescendants) 2827 return "opacity with composited descendants"; 2828 2829 if (reasons & CompositingReason::MaskWithCompositedDescendants) 2830 return "mask with composited descendants"; 2831 2832 if (reasons & CompositingReason::ReflectionWithCompositedDescendants) 2833 return "reflection with composited descendants"; 2834 2835 if (reasons & CompositingReason::FilterWithCompositedDescendants) 2836 return "filter with composited descendants"; 2837 2838 #if ENABLE(CSS_COMPOSITING) 2839 if (reasons & CompositingReason::BlendingWithCompositedDescendants) 2840 return "blending with composited descendants"; 2841 2842 if (reasons & CompositingReason::IsolatesCompositedBlendingDescendants) 2843 return "isolates composited blending descendants"; 2844 #endif 2845 2846 if (reasons & CompositingReason::Perspective) 2847 return "perspective"; 2848 2849 if (reasons & CompositingReason::Preserve3D) 2850 return "preserve-3d"; 2851 2852 if (reasons & CompositingReason::Root) 2853 return "root"; 2854 2855 if (reasons & CompositingReason::Model) 2856 return "model"; 2857 2809 const char* RenderLayerCompositor::logOneReasonForCompositing(const RenderLayer& layer) 2810 { 2811 for (auto reason : reasonsForCompositing(layer)) 2812 return compositingReasonToString(reason); 2858 2813 return ""; 2859 2814 } … … 5056 5011 } 5057 5012 5013 TextStream& operator<<(TextStream& ts, CompositingReason compositingReason) 5014 { 5015 return ts << compositingReasonToString(compositingReason); 5016 } 5017 5058 5018 #if PLATFORM(IOS_FAMILY) 5059 5019 typedef HashMap<PlatformLayer*, std::unique_ptr<ViewportConstraints>> LayerMap; -
trunk/Source/WebCore/rendering/RenderLayerCompositor.h
r276085 r277358 570 570 571 571 #if !LOG_DISABLED 572 const char* log ReasonsForCompositing(const RenderLayer&);572 const char* logOneReasonForCompositing(const RenderLayer&); 573 573 void logLayerInfo(const RenderLayer&, const char*, int depth); 574 574 #endif … … 655 655 WTF::TextStream& operator<<(WTF::TextStream&, CompositingUpdateType); 656 656 WTF::TextStream& operator<<(WTF::TextStream&, CompositingPolicy); 657 WTF::TextStream& operator<<(WTF::TextStream&, CompositingReason); 657 658 658 659 } // namespace WebCore -
trunk/Source/WebCore/rendering/RenderTreeAsText.cpp
r276576 r277358 690 690 if (behavior.contains(RenderAsTextFlag::ShowCompositedLayers)) { 691 691 if (layer.isComposited()) { 692 ts << " (composited, bounds=" << layer.backing()->compositedBounds() << ", drawsContent=" << layer.backing()->graphicsLayer()->drawsContent() 692 ts << " (composited " << layer.compositor().reasonsForCompositing(layer) 693 << ", bounds=" << layer.backing()->compositedBounds() 694 << ", drawsContent=" << layer.backing()->graphicsLayer()->drawsContent() 693 695 << ", paints into ancestor=" << layer.backing()->paintsIntoCompositedAncestor() << ")"; 694 696 } else if (layer.paintsIntoProvidedBacking())
Note:
See TracChangeset
for help on using the changeset viewer.