Changeset 136959 in webkit


Ignore:
Timestamp:
Dec 7, 2012 9:54:54 AM (11 years ago)
Author:
commit-queue@webkit.org
Message:

Provide the backend for exposing the layer tree to the Web Inspector
https://bugs.webkit.org/show_bug.cgi?id=103513

Patch by Antoine Quint <Antoine Quint> on 2012-12-07
Reviewed by Pavel Feldman.

Source/WebCore:

The purpose of this patch is to provide a new agent enabling the Web Inspector to interface
with WebCore to access information about the render layer tree and, more specifically, expose
useful information about layers backed by textures composited on the GPU such as metrics and
backing store. Thus we now provide a LayerTreeAgent which will inform the front-end of
changes to the render layer tree via a new layerTreeDidChange event, providing an object
containing the entire hierarchy of RenderLayers for the inspected document. This hierarchy
can be queried at any time using the .getLayerTree() method on the LayerTreeAgent. Finally,
the LayerTreeAgent also exposes a .nodeIdForLayerId() method allowing to get the id of the
node associated with the RenderLayer with the provided layer id.

In terms of implementation, RenderLayerCompositor has been changed such that in its
updateCompositingLayers() method we call the layerTreeDidChange method on the
InspectorLayerTreeAgent instance via the InspectorInstrumentation.

Test: inspector-protocol/layer-tree.html

  • CMakeLists.txt:
  • GNUmakefile.list.am:
  • Target.pri:
  • WebCore.gypi:
  • WebCore.vcproj/WebCore.vcproj:
  • WebCore.xcodeproj/project.pbxproj:
  • inspector/Inspector.json: Define new types IntRect (x, y, width, height) and Layer, which

holds the information for a RenderLayer (layerId, bounds, isComposited, memory,
compositedBounds) and its children (childLayers). We also define the methods of the
LayerTreeAgent object (enable, disable, getLayerTree, nodeIdForLayerId) and the
layerTreeDidChange event it
fires.

  • inspector/InspectorAllInOne.cpp:
  • inspector/InspectorController.cpp:

(WebCore::InspectorController::InspectorController):

  • inspector/InspectorDOMAgent.cpp:

(WebCore::InspectorDOMAgent::pushNodePathForRenderLayerToFrontend): New method facilitating
pushing the node associated with a given RenderLayer to the front-end.
(WebCore):

  • inspector/InspectorDOMAgent.h:

(InspectorDOMAgent):

  • inspector/InspectorInstrumentation.cpp:

(WebCore):
(WebCore::InspectorInstrumentation::didCommitLoadImpl):
(WebCore::InspectorInstrumentation::layerTreeDidChangeImpl):
(WebCore::InspectorInstrumentation::renderLayerDestroyedImpl):

  • inspector/InspectorInstrumentation.h:

(WebCore):
(InspectorInstrumentation):
(WebCore::InspectorInstrumentation::layerTreeDidChange):
(WebCore::InspectorInstrumentation::renderLayerDestroyed):

  • inspector/InspectorLayerTreeAgent.cpp: Added.

(WebCore):
(LayerTreeAgentState):
(WebCore::InspectorLayerTreeAgent::InspectorLayerTreeAgent):
(WebCore::InspectorLayerTreeAgent::~InspectorLayerTreeAgent):
(WebCore::InspectorLayerTreeAgent::setFrontend):
(WebCore::InspectorLayerTreeAgent::clearFrontend):
(WebCore::InspectorLayerTreeAgent::restore):
(WebCore::InspectorLayerTreeAgent::reset):
(WebCore::InspectorLayerTreeAgent::enable):
(WebCore::InspectorLayerTreeAgent::disable):
(WebCore::InspectorLayerTreeAgent::layerTreeDidChange):
(WebCore::InspectorLayerTreeAgent::renderLayerDestroyed):
(WebCore::InspectorLayerTreeAgent::getLayerTree):
(WebCore::InspectorLayerTreeAgent::buildObjectForRootLayer):
(WebCore::InspectorLayerTreeAgent::buildObjectForLayer): Build the entire hierarchy of
RenderLayers from the provided RenderLayer.
(WebCore::InspectorLayerTreeAgent::buildObjectForIntRect):
(WebCore::InspectorLayerTreeAgent::bind):
(WebCore::InspectorLayerTreeAgent::unbind):
(WebCore::InspectorLayerTreeAgent::nodeIdForLayerId):

  • inspector/InspectorLayerTreeAgent.h: Added.

(WebCore):
(InspectorLayerTreeAgent):
(WebCore::InspectorLayerTreeAgent::create):

  • inspector/InstrumentingAgents.h:

(WebCore):
(WebCore::InstrumentingAgents::InstrumentingAgents):
(InstrumentingAgents):
(WebCore::InstrumentingAgents::inspectorLayerTreeAgent):
(WebCore::InstrumentingAgents::setInspectorLayerTreeAgent):

  • rendering/RenderLayerCompositor.cpp:

(WebCore::RenderLayerCompositor::updateCompositingLayers): Call the layerTreeDidChange method
on the LayerTreeAgent via the InspectorInstrumentation to inform the front-end that the
RenderLayer hierarchy has changed.
(WebCore):
(WebCore::RenderLayerCompositor::layerBecameNonComposited): Call the renderLayerDestroyed
method on the LayerTreeAgent via the InspectorInstrumentation to unbind the layer that is
being destroyed.

  • rendering/RenderLayerCompositor.h:

(RenderLayerCompositor):

LayoutTests:

Adding a LayoutTest that exercises the various APIs and event exposed by the LayerTreeAgent.
This test is skipped on EFL where ACCELERATED_COMPOSITING is not available.

  • inspector-protocol/layer-tree-expected.txt: Added.
  • inspector-protocol/layer-tree.html: Added.
  • platform/efl/TestExpectations:
Location:
trunk
Files:
4 added
19 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r136955 r136959  
     12012-12-07  Antoine Quint  <graouts@apple.com>
     2
     3        Provide the backend for exposing the layer tree to the Web Inspector
     4        https://bugs.webkit.org/show_bug.cgi?id=103513
     5
     6        Reviewed by Pavel Feldman.
     7
     8        Adding a LayoutTest that exercises the various APIs and event exposed by the LayerTreeAgent.
     9        This test is skipped on EFL where ACCELERATED_COMPOSITING is not available.
     10
     11        * inspector-protocol/layer-tree-expected.txt: Added.
     12        * inspector-protocol/layer-tree.html: Added.
     13        * platform/efl/TestExpectations:
     14
    1152012-12-07  Zan Dobersek  <zandobersek@gmail.com>
    216
  • trunk/LayoutTests/platform/efl/TestExpectations

    r136919 r136959  
    11201120webkit.org/b/79766 compositing/geometry/fixed-position-composited-switch.html [ Failure ]
    11211121webkit.org/b/79766 compositing/visibility/visibility-image-layers-dynamic.html [ Failure ]
     1122webkit.org/b/104372 inspector-protocol/layer-tree.html [ Skip ]
    11221123
    11231124# LAYER_TREE_INCLUDES_VISIBLE_RECTS option to layerTreeAsText is only applicable to Mac.
  • trunk/Source/WebCore/CMakeLists.txt

    r136932 r136959  
    16041604    inspector/InspectorInputAgent.cpp
    16051605    inspector/InspectorInstrumentation.cpp
     1606    inspector/InspectorLayerTreeAgent.cpp
    16061607    inspector/InspectorMemoryAgent.cpp
    16071608    inspector/InspectorOverlay.cpp
  • trunk/Source/WebCore/ChangeLog

    r136958 r136959  
     12012-12-07  Antoine Quint  <graouts@apple.com>
     2
     3        Provide the backend for exposing the layer tree to the Web Inspector
     4        https://bugs.webkit.org/show_bug.cgi?id=103513
     5
     6        Reviewed by Pavel Feldman.
     7
     8        The purpose of this patch is to provide a new agent enabling the Web Inspector to interface
     9        with WebCore to access information about the render layer tree and, more specifically, expose
     10        useful information about layers backed by textures composited on the GPU such as metrics and
     11        backing store. Thus we now provide a LayerTreeAgent which will inform the front-end of
     12        changes to the render layer tree via a new layerTreeDidChange event, providing an object
     13        containing the entire hierarchy of RenderLayers for the inspected document. This hierarchy
     14        can be queried at any time using the .getLayerTree() method on the LayerTreeAgent. Finally,
     15        the LayerTreeAgent also exposes a .nodeIdForLayerId() method allowing to get the id of the
     16        node associated with the RenderLayer with the provided layer id.
     17       
     18        In terms of implementation, RenderLayerCompositor has been changed such that in its
     19        updateCompositingLayers() method we call the layerTreeDidChange method on the
     20        InspectorLayerTreeAgent instance via the InspectorInstrumentation.
     21
     22        Test: inspector-protocol/layer-tree.html
     23
     24        * CMakeLists.txt:
     25        * GNUmakefile.list.am:
     26        * Target.pri:
     27        * WebCore.gypi:
     28        * WebCore.vcproj/WebCore.vcproj:
     29        * WebCore.xcodeproj/project.pbxproj:
     30        * inspector/Inspector.json: Define new types IntRect (x, y, width, height) and Layer, which
     31        holds the information for a RenderLayer (layerId, bounds, isComposited, memory,
     32        compositedBounds) and its children (childLayers). We also define the methods of the
     33        LayerTreeAgent object (enable, disable, getLayerTree, nodeIdForLayerId) and the
     34        layerTreeDidChange event it 
     35        fires.
     36        * inspector/InspectorAllInOne.cpp:
     37        * inspector/InspectorController.cpp:
     38        (WebCore::InspectorController::InspectorController):
     39        * inspector/InspectorDOMAgent.cpp:
     40        (WebCore::InspectorDOMAgent::pushNodePathForRenderLayerToFrontend): New method facilitating
     41        pushing the node associated with a given RenderLayer to the front-end.
     42        (WebCore):
     43        * inspector/InspectorDOMAgent.h:
     44        (InspectorDOMAgent):
     45        * inspector/InspectorInstrumentation.cpp:
     46        (WebCore):
     47        (WebCore::InspectorInstrumentation::didCommitLoadImpl):
     48        (WebCore::InspectorInstrumentation::layerTreeDidChangeImpl):
     49        (WebCore::InspectorInstrumentation::renderLayerDestroyedImpl):
     50        * inspector/InspectorInstrumentation.h:
     51        (WebCore):
     52        (InspectorInstrumentation):
     53        (WebCore::InspectorInstrumentation::layerTreeDidChange):
     54        (WebCore::InspectorInstrumentation::renderLayerDestroyed):
     55        * inspector/InspectorLayerTreeAgent.cpp: Added.
     56        (WebCore):
     57        (LayerTreeAgentState):
     58        (WebCore::InspectorLayerTreeAgent::InspectorLayerTreeAgent):
     59        (WebCore::InspectorLayerTreeAgent::~InspectorLayerTreeAgent):
     60        (WebCore::InspectorLayerTreeAgent::setFrontend):
     61        (WebCore::InspectorLayerTreeAgent::clearFrontend):
     62        (WebCore::InspectorLayerTreeAgent::restore):
     63        (WebCore::InspectorLayerTreeAgent::reset):
     64        (WebCore::InspectorLayerTreeAgent::enable):
     65        (WebCore::InspectorLayerTreeAgent::disable):
     66        (WebCore::InspectorLayerTreeAgent::layerTreeDidChange):
     67        (WebCore::InspectorLayerTreeAgent::renderLayerDestroyed):
     68        (WebCore::InspectorLayerTreeAgent::getLayerTree):
     69        (WebCore::InspectorLayerTreeAgent::buildObjectForRootLayer):
     70        (WebCore::InspectorLayerTreeAgent::buildObjectForLayer): Build the entire hierarchy of
     71        RenderLayers from the provided RenderLayer.
     72        (WebCore::InspectorLayerTreeAgent::buildObjectForIntRect):
     73        (WebCore::InspectorLayerTreeAgent::bind):
     74        (WebCore::InspectorLayerTreeAgent::unbind):
     75        (WebCore::InspectorLayerTreeAgent::nodeIdForLayerId):
     76        * inspector/InspectorLayerTreeAgent.h: Added.
     77        (WebCore):
     78        (InspectorLayerTreeAgent):
     79        (WebCore::InspectorLayerTreeAgent::create):
     80        * inspector/InstrumentingAgents.h:
     81        (WebCore):
     82        (WebCore::InstrumentingAgents::InstrumentingAgents):
     83        (InstrumentingAgents):
     84        (WebCore::InstrumentingAgents::inspectorLayerTreeAgent):
     85        (WebCore::InstrumentingAgents::setInspectorLayerTreeAgent):
     86        * rendering/RenderLayerCompositor.cpp:
     87        (WebCore::RenderLayerCompositor::updateCompositingLayers): Call the layerTreeDidChange method
     88        on the LayerTreeAgent via the InspectorInstrumentation to inform the front-end that the
     89        RenderLayer hierarchy has changed.
     90        (WebCore):
     91        (WebCore::RenderLayerCompositor::layerBecameNonComposited): Call the renderLayerDestroyed
     92        method on the LayerTreeAgent via the InspectorInstrumentation to unbind the layer that is
     93        being destroyed.
     94        * rendering/RenderLayerCompositor.h:
     95        (RenderLayerCompositor):
     96
    1972012-12-07  Joshua Bell  <jsbell@chromium.org>
    298
  • trunk/Source/WebCore/GNUmakefile.list.am

    r136932 r136959  
    37503750        Source/WebCore/inspector/InspectorInstrumentation.cpp \
    37513751        Source/WebCore/inspector/InspectorInstrumentation.h \
     3752        Source/WebCore/inspector/InspectorLayerTreeAgent.cpp \
     3753        Source/WebCore/inspector/InspectorLayerTreeAgent.h \
    37523754        Source/WebCore/inspector/InspectorMemoryAgent.cpp \
    37533755        Source/WebCore/inspector/InspectorMemoryAgent.h \
  • trunk/Source/WebCore/Target.pri

    r136932 r136959  
    777777    inspector/InspectorInputAgent.cpp \
    778778    inspector/InspectorInstrumentation.cpp \
     779    inspector/InspectorLayerTreeAgent.cpp \
    779780    inspector/InspectorMemoryAgent.cpp \
    780781    inspector/InspectorOverlay.cpp \
     
    19301931    inspector/InspectorHistory.h \
    19311932    inspector/InspectorInstrumentation.h \
     1933    inspector/InspectorLayerTreeAgent.h \
    19321934    inspector/InspectorMemoryAgent.h \
    19331935    inspector/InspectorOverlay.h \
  • trunk/Source/WebCore/WebCore.gypi

    r136932 r136959  
    18311831            'inspector/InspectorInstrumentation.cpp',
    18321832            'inspector/InspectorInstrumentation.h',
     1833            'inspector/InspectorLayerTreeAgent.cpp',
     1834            'inspector/InspectorLayerTreeAgent.h',
    18331835            'inspector/InspectorMemoryAgent.cpp',
    18341836            'inspector/InspectorMemoryAgent.h',
  • trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj

    r136932 r136959  
    7563575635                        </File>
    7563675636                        <File
     75637                                RelativePath="..\inspector\InspectorLayerTreeAgent.cpp"
     75638                                >
     75639                                <FileConfiguration
     75640                                        Name="Release|Win32"
     75641                                        ExcludedFromBuild="true"
     75642                                        >
     75643                                        <Tool
     75644                                                Name="VCCLCompilerTool"
     75645                                        />
     75646                                </FileConfiguration>
     75647                                <FileConfiguration
     75648                                        Name="Production|Win32"
     75649                                        ExcludedFromBuild="true"
     75650                                        >
     75651                                        <Tool
     75652                                                Name="VCCLCompilerTool"
     75653                                        />
     75654                                </FileConfiguration>
     75655                        </File>
     75656                        <File
     75657                                RelativePath="..\inspector\InspectorLayerTreeAgent.h"
     75658                                >
     75659                        </File>
     75660                        <File
    7563775661                                RelativePath="..\inspector\InspectorMemoryAgent.cpp"
    7563875662                                >
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r136932 r136959  
    19131913                71A57DF1154BE25C0009D120 /* SVGPathUtilities.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 71A57DEF154BE25C0009D120 /* SVGPathUtilities.cpp */; };
    19141914                71A57DF2154BE25C0009D120 /* SVGPathUtilities.h in Headers */ = {isa = PBXBuildFile; fileRef = 71A57DF0154BE25C0009D120 /* SVGPathUtilities.h */; };
     1915                71B1E125164048F700B1880A /* InspectorLayerTreeAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = 71B1E124164048CC00B1880A /* InspectorLayerTreeAgent.h */; };
     1916                71B1E1261640491A00B1880A /* InspectorLayerTreeAgent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 71B1E123164048CC00B1880A /* InspectorLayerTreeAgent.cpp */; };
    19151917                71CC7A20152A0BFE009EEAF9 /* SVGAnimatedEnumeration.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 71CC7A1F152A0BFE009EEAF9 /* SVGAnimatedEnumeration.cpp */; };
    19161918                71DCB7011568197600862271 /* JSSVGZoomAndPan.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 71DCB6FF1568197600862271 /* JSSVGZoomAndPan.cpp */; };
     
    92069208                71A57DEF154BE25C0009D120 /* SVGPathUtilities.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGPathUtilities.cpp; sourceTree = "<group>"; };
    92079209                71A57DF0154BE25C0009D120 /* SVGPathUtilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGPathUtilities.h; sourceTree = "<group>"; };
     9210                71B1E123164048CC00B1880A /* InspectorLayerTreeAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorLayerTreeAgent.cpp; sourceTree = "<group>"; };
     9211                71B1E124164048CC00B1880A /* InspectorLayerTreeAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorLayerTreeAgent.h; sourceTree = "<group>"; };
    92089212                71CC7A1F152A0BFE009EEAF9 /* SVGAnimatedEnumeration.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGAnimatedEnumeration.cpp; sourceTree = "<group>"; };
    92099213                71DCB6FF1568197600862271 /* JSSVGZoomAndPan.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSSVGZoomAndPan.cpp; sourceTree = "<group>"; };
     
    1484414848                                AA73183D159255B900A93E6E /* InjectedScriptCanvasModule.h */,
    1484514849                                AA9030FE157E16A000276247 /* InjectedScriptCanvasModuleSource.js */,
     14850                                71B1E123164048CC00B1880A /* InspectorLayerTreeAgent.cpp */,
     14851                                71B1E124164048CC00B1880A /* InspectorLayerTreeAgent.h */,
    1484614852                                7A0E76F610BF08ED00A0276E /* InjectedScriptHost.cpp */,
    1484714853                                7A0E76F710BF08ED00A0276E /* InjectedScriptHost.h */,
     
    2336923375                                8502AB980AD4394E00378540 /* DOMSVGFEFuncGElementInternal.h in Headers */,
    2337023376                                8502AB560AD438C000378540 /* DOMSVGFEFuncRElement.h in Headers */,
     23377                                71B1E125164048F700B1880A /* InspectorLayerTreeAgent.h in Headers */,
    2337123378                                8502AB990AD4394E00378540 /* DOMSVGFEFuncRElementInternal.h in Headers */,
    2337223379                                8502AB580AD438C000378540 /* DOMSVGFEGaussianBlurElement.h in Headers */,
     
    2623526242                        buildActionMask = 2147483647;
    2623626243                        files = (
     26244                                71B1E1261640491A00B1880A /* InspectorLayerTreeAgent.cpp in Sources */,
    2623726245                                97BC69DA1505F076001B74AC /* AbstractDatabase.cpp in Sources */,
    2623826246                                41E1B1D00FF5986900576B3B /* AbstractWorker.cpp in Sources */,
  • trunk/Source/WebCore/inspector/Inspector.json

    r136949 r136959  
    32863286        ],
    32873287        "events": []
     3288    },
     3289    {
     3290        "domain": "LayerTree",
     3291        "hidden": true,
     3292        "types": [
     3293            {
     3294                "id": "LayerId",
     3295                "type": "string",
     3296                "description": "Unique RenderLayer identifier."
     3297            },
     3298            {
     3299                "id": "IntRect",
     3300                "type": "object",
     3301                "description": "A rectangle.",
     3302                "properties": [
     3303                    { "name": "x", "type": "integer", "description": "The x position." },
     3304                    { "name": "y", "type": "integer", "description": "The y position." },
     3305                    { "name": "width", "type": "integer", "description": "The width metric." },
     3306                    { "name": "height", "type": "integer", "description": "The height metric." }
     3307                ]
     3308            },
     3309            {
     3310                "id": "Layer",
     3311                "type": "object",
     3312                "description": "Information about a compositing layer.",
     3313                "properties": [
     3314                    { "name": "layerId", "$ref": "LayerId", "description": "The unique id for this layer." },
     3315                    { "name": "bounds", "$ref": "IntRect", "description": "Bounds of the layer." },
     3316                    { "name": "isComposited", "type": "boolean", "description": "Indicates whether this layer is composited." },
     3317                    { "name": "memory", "type": "integer", "optional": true, "description": "Estimated memory used by this layer." },
     3318                    { "name": "compositedBounds", "$ref": "IntRect", "optional": true, "description": "The bounds of the composited layer." },
     3319                    { "name": "childLayers", "type": "array", "optional": true, "items": { "$ref": "Layer" }, "description": "Child layers." }
     3320                ]
     3321            }
     3322        ],
     3323        "commands": [
     3324            {
     3325                "name": "enable",
     3326                "description": "Enables compositing tree inspection."
     3327            },
     3328            {
     3329                "name": "disable",
     3330                "description": "Disables compositing tree inspection."
     3331            },
     3332            {
     3333                "name": "getLayerTree",
     3334                "description": "Returns the layer tree structure of the current page.",
     3335                "returns": [
     3336                    { "name": "layerTree", "$ref": "Layer", "description": "Layer tree structure of the current page." }
     3337                ]
     3338            },
     3339            {
     3340                "name": "nodeIdForLayerId",
     3341                "description": "Returns the node id for a given layer id.",
     3342                "parameters": [
     3343                    { "name": "layerId", "$ref": "LayerId" }
     3344                ],
     3345                "returns": [
     3346                    { "name": "nodeId", "$ref": "DOM.NodeId", "description": "The node id for the given layer id." }
     3347                ]
     3348            }
     3349        ],
     3350        "events": [
     3351            {
     3352                "name": "layerTreeDidChange"
     3353            }
     3354        ]
    32883355    }]
    32893356}
  • trunk/Source/WebCore/inspector/InspectorAllInOne.cpp

    r136521 r136959  
    6060#include "InspectorInputAgent.cpp"
    6161#include "InspectorInstrumentation.cpp"
     62#include "InspectorLayerTreeAgent.cpp"
    6263#include "InspectorMemoryAgent.cpp"
    6364#include "InspectorOverlay.cpp"
  • trunk/Source/WebCore/inspector/InspectorController.cpp

    r136949 r136959  
    5858#include "InspectorInputAgent.h"
    5959#include "InspectorInstrumentation.h"
     60#include "InspectorLayerTreeAgent.h"
    6061#include "InspectorMemoryAgent.h"
    6162#include "InspectorOverlay.h"
     
    155156    m_agents.append(InspectorInputAgent::create(m_instrumentingAgents.get(), m_state.get(), page));
    156157
     158    m_agents.append(InspectorLayerTreeAgent::create(m_instrumentingAgents.get(), m_state.get(), page));
     159
    157160    ASSERT_ARG(inspectorClient, inspectorClient);
    158161    m_injectedScriptManager->injectedScriptHost()->init(m_inspectorAgent
  • trunk/Source/WebCore/inspector/InspectorDOMAgent.cpp

    r136521 r136959  
    565565}
    566566
     567int InspectorDOMAgent::pushNodePathForRenderLayerToFrontend(const RenderLayer* renderLayer)
     568{
     569    return pushNodePathToFrontend(renderLayer->renderer()->node());
     570}
     571
    567572int InspectorDOMAgent::boundNodeId(Node* node)
    568573{
  • trunk/Source/WebCore/inspector/InspectorDOMAgent.h

    r136521 r136959  
    3838#include "InspectorOverlay.h"
    3939#include "InspectorValues.h"
     40#include "RenderLayer.h"
    4041#include "Timer.h"
    4142
     
    201202    // Methods called from other agents.
    202203    InspectorPageAgent* pageAgent() { return m_pageAgent; }
     204    int pushNodePathForRenderLayerToFrontend(const RenderLayer*);
    203205
    204206private:
  • trunk/Source/WebCore/inspector/InspectorInstrumentation.cpp

    r136949 r136959  
    5555#include "InspectorDOMStorageAgent.h"
    5656#include "InspectorDebuggerAgent.h"
     57#include "InspectorLayerTreeAgent.h"
    5758#include "InspectorPageAgent.h"
    5859#include "InspectorProfilerAgent.h"
     
    909910        if (InspectorDOMAgent* domAgent = instrumentingAgents->inspectorDOMAgent())
    910911            domAgent->setDocument(mainFrame->document());
    911 
     912#if USE(ACCELERATED_COMPOSITING)
     913        if (InspectorLayerTreeAgent* layerTreeAgent = instrumentingAgents->inspectorLayerTreeAgent())
     914            layerTreeAgent->reset();
     915#endif
    912916        inspectorAgent->didCommitLoad();
    913917    }
     
    12971301}
    12981302
     1303#if USE(ACCELERATED_COMPOSITING)
     1304void InspectorInstrumentation::layerTreeDidChangeImpl(InstrumentingAgents* instrumentingAgents)
     1305{
     1306    if (InspectorLayerTreeAgent* layerTreeAgent = instrumentingAgents->inspectorLayerTreeAgent())
     1307        layerTreeAgent->layerTreeDidChange();
     1308}
     1309
     1310void InspectorInstrumentation::renderLayerDestroyedImpl(InstrumentingAgents* instrumentingAgents, const RenderLayer* renderLayer)
     1311{
     1312    if (InspectorLayerTreeAgent* layerTreeAgent = instrumentingAgents->inspectorLayerTreeAgent())
     1313        layerTreeAgent->renderLayerDestroyed(renderLayer);
     1314}
     1315#endif
     1316
    12991317} // namespace WebCore
    13001318
  • trunk/Source/WebCore/inspector/InspectorInstrumentation.h

    r136948 r136959  
    6161class KURL;
    6262class Node;
     63class RenderLayer;
    6364class RenderObject;
    6465class ResourceRequest;
     
    280281
    281282    static DeviceOrientationData* overrideDeviceOrientation(Page*, DeviceOrientationData*);
     283
     284#if USE(ACCELERATED_COMPOSITING)
     285    static void layerTreeDidChange(Page*);
     286    static void renderLayerDestroyed(Page*, const RenderLayer*);
     287#endif
    282288
    283289private:
     
    459465
    460466    static DeviceOrientationData* overrideDeviceOrientationImpl(InstrumentingAgents*, DeviceOrientationData*);
     467
     468#if USE(ACCELERATED_COMPOSITING)
     469    static void layerTreeDidChangeImpl(InstrumentingAgents*);
     470    static void renderLayerDestroyedImpl(InstrumentingAgents*, const RenderLayer*);
     471#endif
     472
    461473    static int s_frontendCounter;
    462474#endif
     
    15321544    return deviceOrientation;
    15331545}
     1546
     1547#if USE(ACCELERATED_COMPOSITING)
     1548inline void InspectorInstrumentation::layerTreeDidChange(Page* page)
     1549{
     1550    if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
     1551        layerTreeDidChangeImpl(instrumentingAgents);
     1552}
     1553
     1554inline void InspectorInstrumentation::renderLayerDestroyed(Page* page, const RenderLayer* renderLayer)
     1555{
     1556    if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
     1557        renderLayerDestroyedImpl(instrumentingAgents, renderLayer);
     1558}
     1559#endif
    15341560
    15351561#if ENABLE(INSPECTOR)
  • trunk/Source/WebCore/inspector/InstrumentingAgents.h

    r136949 r136959  
    4848class InspectorDebuggerAgent;
    4949class InspectorFileSystemAgent;
     50class InspectorLayerTreeAgent;
    5051class InspectorPageAgent;
    5152class InspectorProfilerAgent;
     
    6768        , m_inspectorPageAgent(0)
    6869        , m_inspectorCSSAgent(0)
     70        , m_inspectorLayerTreeAgent(0)
    6971        , m_inspectorConsoleAgent(0)
    7072        , m_inspectorDOMAgent(0)
     
    159161    void setInspectorCanvasAgent(InspectorCanvasAgent* agent) { m_inspectorCanvasAgent = agent; }
    160162
     163#if USE(ACCELERATED_COMPOSITING)
     164    InspectorLayerTreeAgent* inspectorLayerTreeAgent() const { return m_inspectorLayerTreeAgent; }
     165    void setInspectorLayerTreeAgent(InspectorLayerTreeAgent* agent) { m_inspectorLayerTreeAgent = agent; }
     166#endif
     167
    161168private:
    162169    InspectorAgent* m_inspectorAgent;
    163170    InspectorPageAgent* m_inspectorPageAgent;
    164171    InspectorCSSAgent* m_inspectorCSSAgent;
     172#if USE(ACCELERATED_COMPOSITING)
     173    InspectorLayerTreeAgent* m_inspectorLayerTreeAgent;
     174#endif
    165175    InspectorConsoleAgent* m_inspectorConsoleAgent;
    166176    InspectorDOMAgent* m_inspectorDOMAgent;
  • trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp

    r136452 r136959  
    4141#include "HTMLNames.h"
    4242#include "HitTestResult.h"
     43#include "InspectorInstrumentation.h"
    4344#include "NodeList.h"
    4445#include "Page.h"
     
    509510    if (!hasAcceleratedCompositing())
    510511        enableCompositingMode(false);
     512
     513    // Inform the inspector that the layer tree has changed.
     514    InspectorInstrumentation::layerTreeDidChange(page());
     515}
     516
     517void RenderLayerCompositor::layerBecameNonComposited(const RenderLayer* renderLayer)
     518{
     519    // Inform the inspector that the given RenderLayer was destroyed.
     520    InspectorInstrumentation::renderLayerDestroyed(page(), renderLayer);
     521
     522    ASSERT(m_compositedLayerCount > 0);
     523    --m_compositedLayerCount;
    511524}
    512525
  • trunk/Source/WebCore/rendering/RenderLayerCompositor.h

    r136277 r136959  
    171171   
    172172    void layerBecameComposited(const RenderLayer*) { ++m_compositedLayerCount; }
    173     void layerBecameNonComposited(const RenderLayer*)
    174     {
    175         ASSERT(m_compositedLayerCount > 0);
    176         --m_compositedLayerCount;
    177     }
     173    void layerBecameNonComposited(const RenderLayer*);
    178174   
    179175#if ENABLE(VIDEO)
Note: See TracChangeset for help on using the changeset viewer.