Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(447)

Unified Diff: third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp

Issue 2397333002: Change layerTreeAsText to default to layer lists. (Closed)
Patch Set: none Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 898e54807f2c45f42e1898c63a7d5ba1e10b2d66..2575360bdee56113726abfbc45fac6691d54ca36 100644
--- a/third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp
+++ b/third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp
@@ -605,15 +605,14 @@ 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);
+ if (flags & OutputAsLayerTree)
+ return layerTreeAsJSONInternal(flags, renderingContextMap);
+ 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;
}
std::unique_ptr<JSONObject> GraphicsLayer::layerAsJSONInternal(

Powered by Google App Engine
This is Rietveld 408576698