| Index: third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp
|
| diff --git a/third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp b/third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp
|
| index c65fe69813019e2192353d116d99b82892ac5df0..b9154ad0b4eb4e92720a50673763c848e78cb9e1 100644
|
| --- a/third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp
|
| +++ b/third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp
|
| @@ -607,10 +607,18 @@ static String pointerAsString(const void* ptr)
|
| std::unique_ptr<JSONObject> GraphicsLayer::layerTreeAsJSON(LayerTreeFlags flags) const
|
| {
|
| RenderingContextMap renderingContextMap;
|
| + if (flags & OutputChildrenAsLayerList) {
|
| + std::unique_ptr<JSONObject> json = JSONObject::create();
|
| + std::unique_ptr<JSONArray> layersArray = JSONArray::create();
|
| + for (auto& child : m_children)
|
| + child->layersAsJSONArray(flags, renderingContextMap, layersArray.get());
|
| + json->setArray("layers", std::move(layersArray));
|
| + return json;
|
| + }
|
| return layerTreeAsJSONInternal(flags, renderingContextMap);
|
| }
|
|
|
| -std::unique_ptr<JSONObject> GraphicsLayer::layerTreeAsJSONInternal(LayerTreeFlags flags, RenderingContextMap& renderingContextMap) const
|
| +std::unique_ptr<JSONObject> GraphicsLayer::layerAsJSONInternal(LayerTreeFlags flags, RenderingContextMap& renderingContextMap) const
|
| {
|
| std::unique_ptr<JSONObject> json = JSONObject::create();
|
|
|
| @@ -714,6 +722,12 @@ std::unique_ptr<JSONObject> GraphicsLayer::layerTreeAsJSONInternal(LayerTreeFlag
|
| }
|
| json->setArray("squashingDisallowedReasons", std::move(squashingDisallowedReasonsJSON));
|
| }
|
| + return json;
|
| +}
|
| +
|
| +std::unique_ptr<JSONObject> GraphicsLayer::layerTreeAsJSONInternal(LayerTreeFlags flags, RenderingContextMap& renderingContextMap) const
|
| +{
|
| + std::unique_ptr<JSONObject> json = layerAsJSONInternal(flags, renderingContextMap);
|
|
|
| if (m_children.size()) {
|
| std::unique_ptr<JSONArray> childrenJSON = JSONArray::create();
|
| @@ -725,6 +739,16 @@ std::unique_ptr<JSONObject> GraphicsLayer::layerTreeAsJSONInternal(LayerTreeFlag
|
| return json;
|
| }
|
|
|
| +void GraphicsLayer::layersAsJSONArray(LayerTreeFlags flags, RenderingContextMap& renderingContextMap, JSONArray* jsonArray) const
|
| +{
|
| + jsonArray->pushObject(layerAsJSONInternal(flags, renderingContextMap));
|
| +
|
| + if (m_children.size()) {
|
| + for (auto& child : m_children)
|
| + child->layersAsJSONArray(flags, renderingContextMap, jsonArray);
|
| + }
|
| +}
|
| +
|
| String GraphicsLayer::layerTreeAsText(LayerTreeFlags flags) const
|
| {
|
| return layerTreeAsJSON(flags)->toPrettyJSONString();
|
|
|