Web Inspector: Provide the paint count of layers through the LayerTreeAgent
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 17 Dec 2012 16:57:16 +0000 (16:57 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 17 Dec 2012 16:57:16 +0000 (16:57 +0000)
https://bugs.webkit.org/show_bug.cgi?id=105024

Patch by Antoine Quint <graouts@apple.com> on 2012-12-17
Reviewed by Pavel Feldman.

Source/WebCore:

We add a new optional .paintCount property to the Layer object, passing through the
relevant information from GraphicsLayer.

* inspector/Inspector.json:
* inspector/InspectorLayerTreeAgent.cpp:
(WebCore::InspectorLayerTreeAgent::buildObjectForLayer):

LayoutTests:

Add the paintCount property to the expected output of the LayerTreeAgent test.

* inspector-protocol/layer-tree-expected.txt:
* inspector-protocol/layer-tree.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@137913 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/inspector-protocol/layer-tree-expected.txt
LayoutTests/inspector-protocol/layer-tree.html
Source/WebCore/ChangeLog
Source/WebCore/inspector/Inspector.json
Source/WebCore/inspector/InspectorLayerTreeAgent.cpp

index 2fd42d8..507830c 100644 (file)
@@ -1,3 +1,15 @@
+2012-12-17  Antoine Quint  <graouts@apple.com>
+
+        Web Inspector: Provide the paint count of layers through the LayerTreeAgent
+        https://bugs.webkit.org/show_bug.cgi?id=105024
+
+        Reviewed by Pavel Feldman.
+
+        Add the paintCount property to the expected output of the LayerTreeAgent test.
+
+        * inspector-protocol/layer-tree-expected.txt:
+        * inspector-protocol/layer-tree.html:
+
 2012-12-17  Csaba Osztrogon√°c  <ossy@webkit.org>
 
         [Qt][WK2] Unreviewed gardening.
index 5ba75fe..04eee79 100644 (file)
@@ -27,6 +27,7 @@ PASS
         "width": "number",
         "height": "number"
     },
+    "paintCount": "number",
     "childLayers": [
         {
             "layerId": "string",
@@ -65,6 +66,7 @@ PASS
                         "width": 50,
                         "height": 50
                     },
+                    "paintCount": "number",
                     "childLayers": [
                         {
                             "layerId": "string",
@@ -82,6 +84,7 @@ PASS
                                 "width": 50,
                                 "height": 50
                             },
+                            "paintCount": "number",
                             "childLayers": []
                         }
                     ]
@@ -102,6 +105,7 @@ PASS
                         "width": 100,
                         "height": 100
                     },
+                    "paintCount": "number",
                     "childLayers": [
                         {
                             "layerId": "string",
@@ -119,6 +123,7 @@ PASS
                                 "width": 50,
                                 "height": 50
                             },
+                            "paintCount": "number",
                             "childLayers": []
                         }
                     ]
@@ -161,6 +166,7 @@ PASS
                         "width": "number",
                         "height": "number"
                     },
+                    "paintCount": "number",
                     "childLayers": []
                 }
             ]
@@ -192,6 +198,7 @@ PASS
         "width": "number",
         "height": "number"
     },
+    "paintCount": "number",
     "childLayers": [
         {
             "layerId": "string",
@@ -230,6 +237,7 @@ PASS
                         "width": 50,
                         "height": 50
                     },
+                    "paintCount": "number",
                     "childLayers": [
                         {
                             "layerId": "string",
@@ -247,6 +255,7 @@ PASS
                                 "width": 50,
                                 "height": 50
                             },
+                            "paintCount": "number",
                             "childLayers": []
                         }
                     ]
@@ -267,6 +276,7 @@ PASS
                         "width": 100,
                         "height": 100
                     },
+                    "paintCount": "number",
                     "childLayers": [
                         {
                             "layerId": "string",
@@ -284,6 +294,7 @@ PASS
                                 "width": 50,
                                 "height": 50
                             },
+                            "paintCount": "number",
                             "childLayers": []
                         }
                     ]
@@ -326,6 +337,7 @@ PASS
                         "width": "number",
                         "height": "number"
                     },
+                    "paintCount": "number",
                     "childLayers": []
                 },
                 {
@@ -344,6 +356,7 @@ PASS
                         "width": 50,
                         "height": 50
                     },
+                    "paintCount": "number",
                     "childLayers": []
                 }
             ]
index 1a1bc62..86aad60 100644 (file)
@@ -168,7 +168,7 @@ function test()
     {
         function replacer(key, value)
         {
-            if (key === "layerId" || key === "memory")
+            if (key === "layerId" || key === "memory" || key === "paintCount")
                 return typeof(value);
 
             // some values differ based on port, but the ones we most
index 34c3db9..fbcd90c 100644 (file)
@@ -1,3 +1,17 @@
+2012-12-17  Antoine Quint  <graouts@apple.com>
+
+        Web Inspector: Provide the paint count of layers through the LayerTreeAgent
+        https://bugs.webkit.org/show_bug.cgi?id=105024
+
+        Reviewed by Pavel Feldman.
+
+        We add a new optional .paintCount property to the Layer object, passing through the
+        relevant information from GraphicsLayer.
+
+        * inspector/Inspector.json:
+        * inspector/InspectorLayerTreeAgent.cpp:
+        (WebCore::InspectorLayerTreeAgent::buildObjectForLayer):
+
 2012-12-17  Pavel Feldman  <pfeldman@chromium.org>
 
         Web Inspector: [chromium] make toolbar render with Mountain Lion-friendly colors
index eeb7631..9d39279 100644 (file)
                     { "name": "layerId", "$ref": "LayerId", "description": "The unique id for this layer." },
                     { "name": "bounds", "$ref": "IntRect", "description": "Bounds of the layer." },
                     { "name": "isComposited", "type": "boolean", "description": "Indicates whether this layer is composited." },
+                    { "name": "paintCount", "type": "integer", "optional": true, "description": "Indicates how many time this layer has painted." },
                     { "name": "memory", "type": "integer", "optional": true, "description": "Estimated memory used by this layer." },
                     { "name": "compositedBounds", "$ref": "IntRect", "optional": true, "description": "The bounds of the composited layer." },
                     { "name": "childLayers", "type": "array", "optional": true, "items": { "$ref": "Layer" }, "description": "Child layers." }
index 6446536..680ee2f 100644 (file)
@@ -137,6 +137,7 @@ PassRefPtr<TypeBuilder::LayerTree::Layer> InspectorLayerTreeAgent::buildObjectFo
         RenderLayerBacking* backing = renderLayer->backing();
         layerObject->setMemory(backing->backingStoreMemoryEstimate());
         layerObject->setCompositedBounds(buildObjectForIntRect(backing->compositedBounds()));
+        layerObject->setPaintCount(backing->graphicsLayer()->repaintCount());
     }
 
     // Process children layers.