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

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

Issue 1153023002: layout-tests: Add flag for including compositingReasons in layerTreeAsText(). (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 7 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: Source/platform/graphics/GraphicsLayer.cpp
diff --git a/Source/platform/graphics/GraphicsLayer.cpp b/Source/platform/graphics/GraphicsLayer.cpp
index d8884ed1cf32ccf04f1cc257901784c1cc9d3f51..e994c3a804483c437a466ef9a926becc8e0386cf 100644
--- a/Source/platform/graphics/GraphicsLayer.cpp
+++ b/Source/platform/graphics/GraphicsLayer.cpp
@@ -701,14 +701,13 @@ PassRefPtr<JSONObject> GraphicsLayer::layerTreeAsJSON(LayerTreeFlags flags, Rend
json->setBoolean("hasClipParent", true);
}
- if (flags & LayerTreeIncludesDebugInfo) {
- RefPtr<JSONArray> compositingReasonsJSON = adoptRef(new JSONArray);
- for (size_t i = 0; i < kNumberOfCompositingReasons; ++i) {
- if (m_debugInfo.compositingReasons() & kCompositingReasonStringMap[i].reason)
- compositingReasonsJSON->pushString(kCompositingReasonStringMap[i].description);
- }
- json->setArray("compositingReasons", compositingReasonsJSON);
+ bool debug = flags & LayerTreeIncludesDebugInfo;
+ RefPtr<JSONArray> compositingReasonsJSON = adoptRef(new JSONArray);
+ for (size_t i = 0; i < kNumberOfCompositingReasons; ++i) {
+ if (m_debugInfo.compositingReasons() & kCompositingReasonStringMap[i].reason)
+ compositingReasonsJSON->pushString(debug ? kCompositingReasonStringMap[i].description : kCompositingReasonStringMap[i].shortName);
}
+ json->setArray("compositingReasons", compositingReasonsJSON);
if (m_children.size()) {
RefPtr<JSONArray> childrenJSON = adoptRef(new JSONArray);

Powered by Google App Engine
This is Rietveld 408576698