Changeset 236087 in webkit


Ignore:
Timestamp:
Sep 17, 2018, 3:05:42 PM (7 years ago)
Author:
Simon Fraser
Message:

Add support for dumping the GraphicsLayer tree via notifyutil
https://bugs.webkit.org/show_bug.cgi?id=189639

Reviewed by Zalan Bujtas.

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:
Location:
trunk/Source/WebCore
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r236085 r236087  
     12018-09-14  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Add support for dumping the GraphicsLayer tree via notifyutil
     4        https://bugs.webkit.org/show_bug.cgi?id=189639
     5
     6        Reviewed by Zalan Bujtas.
     7
     8        Make "notifyutil -p com.apple.WebKit.showGraphicsLayerTree" work. It dumps the GraphicsLayer tree
     9        for each top-level document (GraphicsLayers are connected across frame boundaries, so this prints
     10        the entire tree for each main frame).
     11       
     12        It uses WTFLogAlways rather than fprintf() so output shows on all platforms (other tree dumps should
     13        be converted in the same way).
     14
     15        * page/mac/PageMac.mm:
     16        (WebCore::Page::platformInitialize):
     17        * platform/graphics/GraphicsLayer.cpp:
     18        (showGraphicsLayerTree):
     19        * rendering/RenderLayerCompositor.cpp:
     20        (showGraphicsLayerTreeForCompositor):
     21        * rendering/RenderLayerCompositor.h:
     22        * rendering/RenderObject.cpp:
     23        (WebCore::printGraphicsLayerTreeForLiveDocuments):
     24        * rendering/RenderObject.h:
     25
    1262018-09-17  Christopher Reid  <chris.reid@sony.com>
    227
  • trunk/Source/WebCore/page/mac/PageMac.mm

    r235393 r236087  
    5959        PAL::registerNotifyCallback("com.apple.WebKit.showRenderTree", printRenderTreeForLiveDocuments);
    6060        PAL::registerNotifyCallback("com.apple.WebKit.showLayerTree", printLayerTreeForLiveDocuments);
     61        PAL::registerNotifyCallback("com.apple.WebKit.showGraphicsLayerTree", printGraphicsLayerTreeForLiveDocuments);
    6162#if ENABLE(LAYOUT_FORMATTING_CONTEXT)
    6263        PAL::registerNotifyCallback("com.apple.WebKit.showLayoutTree", Layout::printLayoutTreeForLiveDocuments);
  • trunk/Source/WebCore/platform/graphics/GraphicsLayer.cpp

    r236016 r236087  
    981981
    982982    String output = layer->layerTreeAsText(WebCore::LayerTreeAsTextShowAll);
    983     fprintf(stderr, "%s\n", output.utf8().data());
    984 }
    985 #endif
     983    WTFLogAlways("%s\n", output.utf8().data());
     984}
     985#endif
  • trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp

    r236016 r236087  
    41474147
    41484148} // namespace WebCore
     4149
     4150#if ENABLE(TREE_DEBUGGING)
     4151void showGraphicsLayerTreeForCompositor(WebCore::RenderLayerCompositor& compositor)
     4152{
     4153    showGraphicsLayerTree(compositor.rootGraphicsLayer());
     4154}
     4155#endif
  • trunk/Source/WebCore/rendering/RenderLayerCompositor.h

    r236016 r236087  
    581581
    582582} // namespace WebCore
     583
     584#if ENABLE(TREE_DEBUGGING)
     585// Outside the WebCore namespace for ease of invocation from the debugger.
     586void showGraphicsLayerTreeForCompositor(WebCore::RenderLayerCompositor&);
     587#endif
  • trunk/Source/WebCore/rendering/RenderObject.cpp

    r235749 r236087  
    5353#include "RenderLayer.h"
    5454#include "RenderLayerBacking.h"
     55#include "RenderLayerCompositor.h"
    5556#include "RenderMultiColumnFlow.h"
    5657#include "RenderRuby.h"
     
    19381939}
    19391940
     1941void printGraphicsLayerTreeForLiveDocuments()
     1942{
     1943    for (const auto* document : Document::allDocuments()) {
     1944        if (!document->renderView())
     1945            continue;
     1946        if (document->frame() && document->frame()->isMainFrame()) {
     1947            WTFLogAlways("Graphics layer tree for root document %p %s", document, document->url().string().utf8().data());
     1948            showGraphicsLayerTreeForCompositor(document->renderView()->compositor());
     1949        }
     1950    }
     1951}
     1952
    19401953#endif // ENABLE(TREE_DEBUGGING)
    19411954
  • trunk/Source/WebCore/rendering/RenderObject.h

    r235749 r236087  
    11041104void printRenderTreeForLiveDocuments();
    11051105void printLayerTreeForLiveDocuments();
     1106void printGraphicsLayerTreeForLiveDocuments();
    11061107#endif
    11071108
Note: See TracChangeset for help on using the changeset viewer.