Store a visible rect in GraphicsLayers, and optionally dump it in layerTreeAsText
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 10 Oct 2012 17:49:17 +0000 (17:49 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 10 Oct 2012 17:49:17 +0000 (17:49 +0000)
commit2b9952592295324c9f501c83697d4f9f6f2a401e
tree679cb9ef0f43f07db4ab07a32d7f1b9df0dff208
parentc0979ed6810a978a64fe45a5b1e436c12f1b3693
Store a visible rect in GraphicsLayers, and optionally dump it in layerTreeAsText
https://bugs.webkit.org/show_bug.cgi?id=98839

Reviewed by Sam Weinig.

Source/WebCore:

To replace CATiledLayer with TileCaches, we need to be able to compute the visible part of a GraphicsLayer,
in order to limit the extent of TileCache tiles. Reuse the existing code in GraphicsLayerCA for this,
but store the computed rect in m_visibleRect.

Add a flag to layerTreeAsText() so that tests can optionally include this visible rect in
layer tree dumps. This output will be platform-specific, so we don't want to do it unconditionally.

* WebCore.exp.in: Signature of Frame::layerTreeAsText() changed.
* page/Frame.cpp:
(WebCore::Frame::layerTreeAsText): Change to take some enum flags rather than just a bool.
* page/Frame.h:
* platform/graphics/GraphicsLayer.cpp:
(WebCore::GraphicsLayer::writeIndent): Make into a static class method so subclasses can use it.
(WebCore::GraphicsLayer::dumpProperties): Call a virtual dumpAdditionalProperties() for subclasses.
(showGraphicsLayerTree):
* platform/graphics/GraphicsLayer.h:
(GraphicsLayer): New LayerTreeAsTextIncludeVisibleRects flag.
(WebCore::GraphicsLayer::dumpAdditionalProperties): New virtual method.
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::recursiveCommitChanges): clipRectForChildren and clipRectForSelf
were previously unused and buggy. Fix to correctly compute clipRectForSelf, to assign
to m_visibleRect.
(WebCore::GraphicsLayerCA::dumpAdditionalProperties): Dump m_visibleRect.
* platform/graphics/ca/GraphicsLayerCA.h:
(GraphicsLayerCA):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::layerTreeAsText): Convert the flags from Frame flags
to GraphicsLayerFlags and pass them along.
* rendering/RenderLayerCompositor.h:
(RenderLayerCompositor):
* testing/Internals.cpp:
(WebCore::Internals::layerTreeAsText): Overloaded method to handle the optional IDL arguments.
* testing/Internals.h: Add enum.
* testing/Internals.idl: Add optional flags, and a const short to describe the flags.

Source/WebKit/chromium:

Add a flag to layerTreeAsText() so that tests can optionally include this visible rect in
layer tree dumps. This output will be platform-specific, so we don't want to do it unconditionally.

* src/WebFrameImpl.cpp:
(WebKit::WebFrameImpl::layerTreeAsText):

Source/WebKit/mac:

To replace CATiledLayer with TileCaches, we need to be able to compute the visible part of a GraphicsLayer,
in order to limit the extent of TileCache tiles. Reuse the existing code in GraphicsLayerCA for this,
but store the computed rect in m_visibleRect.

Add a flag to layerTreeAsText() so that tests can optionally include this visible rect in
layer tree dumps. This output will be platform-specific, so we don't want to do it unconditionally.

* WebView/WebFrame.mm:
(-[WebFrame _layerTreeAsText]):

Source/WebKit2:

Add a flag to layerTreeAsText() so that tests can optionally include this visible rect in
layer tree dumps. This output will be platform-specific, so we don't want to do it unconditionally.

* WebProcess/WebPage/WebFrame.cpp:
(WebKit::WebFrame::layerTreeAsText):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@130927 268f45cc-cd09-0410-ab3c-d52691b4dbfc
19 files changed:
Source/WebCore/ChangeLog
Source/WebCore/WebCore.exp.in
Source/WebCore/page/Frame.cpp
Source/WebCore/page/Frame.h
Source/WebCore/platform/graphics/GraphicsLayer.cpp
Source/WebCore/platform/graphics/GraphicsLayer.h
Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp
Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h
Source/WebCore/rendering/RenderLayerCompositor.cpp
Source/WebCore/rendering/RenderLayerCompositor.h
Source/WebCore/testing/Internals.cpp
Source/WebCore/testing/Internals.h
Source/WebCore/testing/Internals.idl
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/src/WebFrameImpl.cpp
Source/WebKit/mac/ChangeLog
Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/WebPage/WebFrame.cpp
Source/WebKit2/win/WebKit2.def