WebKit Bugzilla
Attachment 349834 Details for
Bug 189639
: Add support for dumping the GraphicsLayer tree via notifyutil
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-189639-20180914172201.patch (text/plain), 5.86 KB, created by
Simon Fraser (smfr)
on 2018-09-14 17:22:02 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Simon Fraser (smfr)
Created:
2018-09-14 17:22:02 PDT
Size:
5.86 KB
patch
obsolete
>Subversion Revision: 236016 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 35db68da5a6d694231ae50c4d7c52cc098fbc088..03076ef356720da602fe22ed3c435a871630576e 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,28 @@ >+2018-09-14 Simon Fraser <simon.fraser@apple.com> >+ >+ Add support for dumping the GraphicsLayer tree via notifyutil >+ https://bugs.webkit.org/show_bug.cgi?id=189639 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Make "notifyutil -p com.apple.WebKit.showGraphicsLayerTree" work. It dumps the GraphicsLayer tree >+ for each top-level document (GraphicsLayers are connected across frame boundaries, so this prints >+ the entire tree for each main frame). >+ >+ It uses WTFLogAlways rather than fprintf() so output shows on all platforms (other tree dumps should >+ be converted in the same way). >+ >+ * page/mac/PageMac.mm: >+ (WebCore::Page::platformInitialize): >+ * platform/graphics/GraphicsLayer.cpp: >+ (showGraphicsLayerTree): >+ * rendering/RenderLayerCompositor.cpp: >+ (showGraphicsLayerTreeForCompositor): >+ * rendering/RenderLayerCompositor.h: >+ * rendering/RenderObject.cpp: >+ (WebCore::printGraphicsLayerTreeForLiveDocuments): >+ * rendering/RenderObject.h: >+ > 2018-09-11 Simon Fraser <simon.fraser@apple.com> > > Make GraphicsLayers ref-counted, so their tree can persist when disconnected from RenderLayerBackings >diff --git a/Source/WebCore/page/mac/PageMac.mm b/Source/WebCore/page/mac/PageMac.mm >index 44e940c1ee45968ead1fc9234570d9d91dede833..f5e7a9a67bc9a233787d15314835d3154d057fb9 100644 >--- a/Source/WebCore/page/mac/PageMac.mm >+++ b/Source/WebCore/page/mac/PageMac.mm >@@ -58,6 +58,7 @@ void Page::platformInitialize() > #if ENABLE(TREE_DEBUGGING) > PAL::registerNotifyCallback("com.apple.WebKit.showRenderTree", printRenderTreeForLiveDocuments); > PAL::registerNotifyCallback("com.apple.WebKit.showLayerTree", printLayerTreeForLiveDocuments); >+ PAL::registerNotifyCallback("com.apple.WebKit.showGraphicsLayerTree", printGraphicsLayerTreeForLiveDocuments); > #if ENABLE(LAYOUT_FORMATTING_CONTEXT) > PAL::registerNotifyCallback("com.apple.WebKit.showLayoutTree", Layout::printLayoutTreeForLiveDocuments); > #endif >diff --git a/Source/WebCore/platform/graphics/GraphicsLayer.cpp b/Source/WebCore/platform/graphics/GraphicsLayer.cpp >index 88a136cb78c20e341c339e9f28b5261c1264d5f8..4a63fbaf9630dbf41d32e962a0af92ab47d601ca 100644 >--- a/Source/WebCore/platform/graphics/GraphicsLayer.cpp >+++ b/Source/WebCore/platform/graphics/GraphicsLayer.cpp >@@ -980,6 +980,6 @@ void showGraphicsLayerTree(const WebCore::GraphicsLayer* layer) > return; > > String output = layer->layerTreeAsText(WebCore::LayerTreeAsTextShowAll); >- fprintf(stderr, "%s\n", output.utf8().data()); >+ WTFLogAlways("%s\n", output.utf8().data()); > } > #endif >diff --git a/Source/WebCore/rendering/RenderLayerCompositor.cpp b/Source/WebCore/rendering/RenderLayerCompositor.cpp >index 01047e36a1e0395c2933cf3b6d1eaa5e98e7a538..ebb453a8ba973f39935ef45a5b32188b8ec781c3 100644 >--- a/Source/WebCore/rendering/RenderLayerCompositor.cpp >+++ b/Source/WebCore/rendering/RenderLayerCompositor.cpp >@@ -4146,3 +4146,10 @@ TextStream& operator<<(TextStream& ts, CompositingPolicy compositingPolicy) > } > > } // namespace WebCore >+ >+#if ENABLE(TREE_DEBUGGING) >+void showGraphicsLayerTreeForCompositor(WebCore::RenderLayerCompositor& compositor) >+{ >+ showGraphicsLayerTree(compositor.rootGraphicsLayer()); >+} >+#endif >diff --git a/Source/WebCore/rendering/RenderLayerCompositor.h b/Source/WebCore/rendering/RenderLayerCompositor.h >index a5d83b6f360d4e3bd35c9eb2ac08fedc072258e6..6494e6593ee393cd352bfb1db8b2cdd3536a98db 100644 >--- a/Source/WebCore/rendering/RenderLayerCompositor.h >+++ b/Source/WebCore/rendering/RenderLayerCompositor.h >@@ -580,3 +580,8 @@ WTF::TextStream& operator<<(WTF::TextStream&, CompositingUpdateType); > WTF::TextStream& operator<<(WTF::TextStream&, CompositingPolicy); > > } // namespace WebCore >+ >+#if ENABLE(TREE_DEBUGGING) >+// Outside the WebCore namespace for ease of invocation from the debugger. >+void showGraphicsLayerTreeForCompositor(WebCore::RenderLayerCompositor&); >+#endif >diff --git a/Source/WebCore/rendering/RenderObject.cpp b/Source/WebCore/rendering/RenderObject.cpp >index fa7ab44cd32f978ce8b1a6db348d5e393745a9b6..7e1b7615a3dafcb309ff5548b13176d5dfe09510 100644 >--- a/Source/WebCore/rendering/RenderObject.cpp >+++ b/Source/WebCore/rendering/RenderObject.cpp >@@ -52,6 +52,7 @@ > #include "RenderIterator.h" > #include "RenderLayer.h" > #include "RenderLayerBacking.h" >+#include "RenderLayerCompositor.h" > #include "RenderMultiColumnFlow.h" > #include "RenderRuby.h" > #include "RenderSVGBlock.h" >@@ -1937,6 +1938,18 @@ void printLayerTreeForLiveDocuments() > } > } > >+void printGraphicsLayerTreeForLiveDocuments() >+{ >+ for (const auto* document : Document::allDocuments()) { >+ if (!document->renderView()) >+ continue; >+ if (document->frame() && document->frame()->isMainFrame()) { >+ WTFLogAlways("Graphics layer tree for root document %p %s", document, document->url().string().utf8().data()); >+ showGraphicsLayerTreeForCompositor(document->renderView()->compositor()); >+ } >+ } >+} >+ > #endif // ENABLE(TREE_DEBUGGING) > > } // namespace WebCore >diff --git a/Source/WebCore/rendering/RenderObject.h b/Source/WebCore/rendering/RenderObject.h >index 7642f5846d7b9bede8b3794a711765f8445e6f4f..e88775b83540ba53dd168501411e493dc085cc4a 100644 >--- a/Source/WebCore/rendering/RenderObject.h >+++ b/Source/WebCore/rendering/RenderObject.h >@@ -1103,6 +1103,7 @@ inline bool RenderObject::needsSimplifiedNormalFlowLayoutOnly() const > #if ENABLE(TREE_DEBUGGING) > void printRenderTreeForLiveDocuments(); > void printLayerTreeForLiveDocuments(); >+void printGraphicsLayerTreeForLiveDocuments(); > #endif > > } // namespace WebCore
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
zalan
:
review+
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 189639
: 349834