[Win] Provide a means for viewing the layer tree
authorbfulgham@apple.com <bfulgham@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 16 Sep 2015 01:00:32 +0000 (01:00 +0000)
committerbfulgham@apple.com <bfulgham@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 16 Sep 2015 01:00:32 +0000 (01:00 +0000)
commited41c51971a3446fa8e26583f2c8883650f61534
tree271c2ab8d6fe46749a23364bdaca2cb26fe6dcf4
parent9df99d89a18cb2cf4fa60aac8c9cba3388d78541
[Win] Provide a means for viewing the layer tree
https://bugs.webkit.org/show_bug.cgi?id=149165

Reviewed by Simon Fraser.

Source/WebCore:

Revise the old fprintf logic to generate a string
containing the layer tree so that it can be output
to the debugger (or elsewhere).

* platform/graphics/ca/PlatformCALayer.h: Rename 'printTree'
to 'printLayerTree', and make it available in release builds.
* platform/graphics/ca/win/CACFLayerTreeHost.cpp:
(WebCore::CACFLayerTreeHost::printLayerTree): Added. Calls into
the PlatformCALayer implementation.
* platform/graphics/ca/win/CACFLayerTreeHost.h:
* platform/graphics/ca/win/PlatformCALayerWin.cpp:
(printIndent): Revise to use two-space indent and use StringBuilder.
(printTransform): Ditto.
(printColor): Added helper function.
(printLayer): Revised to output information on the layer contents.
(PlatformCALayerWin::printLayerTree): Renamed from 'printTree'.
(PlatformCALayerWin::printTree): Deleted.
* platform/graphics/ca/win/PlatformCALayerWinInternal.cpp:
(PlatformCALayerWinInternal::drawRepaintCounters): Drive-by fix. Match the
cocoa repaint counter logic by not painting counters for the layers that
contain the tile grid.
* platform/graphics/ca/win/PlatformCALayerWin.h:
* platform/graphics/ca/win/PlatformCALayerWinInternal.cpp:
(PlatformCALayerWinInternal::drawRepaintCounters):

Source/WebKit/win:

Add a new WebView method "printLayerTree" so that clients
can get a string dump of the current layer tree. Add this
to a new COM interface version so no existing clients break
compatibility.

* Interfaces/IWebViewPrivate.idl:
* WebView.cpp:
(WebView::QueryInterface): Recognize the new interface version.
(WebView::printLayerTree): Added. This just calls the WebCore
implementation.
* WebView.h:

Tools:

Update MiniBrowser with a new Debug menu option that will
dump the current layer tree to the debug console.

* MiniBrowser/MiniBrowser.vcxproj/MiniBrowserLib.rc:
* MiniBrowser/MiniBrowser.vcxproj/MiniBrowserLibResource.h:
* MiniBrowser/win/Common.cpp:
(WndProc): Add handler for 'Print Layer Tree' menu option.
* MiniBrowser/win/MiniBrowser.cpp:
(MiniBrowser::printLayerTree): Added Handler.
* MiniBrowser/win/MiniBrowser.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@189833 268f45cc-cd09-0410-ab3c-d52691b4dbfc
17 files changed:
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/ca/PlatformCALayer.h
Source/WebCore/platform/graphics/ca/win/CACFLayerTreeHost.cpp
Source/WebCore/platform/graphics/ca/win/CACFLayerTreeHost.h
Source/WebCore/platform/graphics/ca/win/PlatformCALayerWin.cpp
Source/WebCore/platform/graphics/ca/win/PlatformCALayerWin.h
Source/WebCore/platform/graphics/ca/win/PlatformCALayerWinInternal.cpp
Source/WebKit/win/ChangeLog
Source/WebKit/win/Interfaces/IWebViewPrivate.idl
Source/WebKit/win/WebView.cpp
Source/WebKit/win/WebView.h
Tools/ChangeLog
Tools/MiniBrowser/MiniBrowser.vcxproj/MiniBrowserLib.rc
Tools/MiniBrowser/MiniBrowser.vcxproj/MiniBrowserLibResource.h
Tools/MiniBrowser/win/Common.cpp
Tools/MiniBrowser/win/MiniBrowser.cpp
Tools/MiniBrowser/win/MiniBrowser.h