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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2009 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 683 matching lines...) Expand 10 before | Expand all | Expand 10 after
694 json->setArray("paintingPhases", paintingPhasesJSON); 694 json->setArray("paintingPhases", paintingPhasesJSON);
695 } 695 }
696 696
697 if (flags & LayerTreeIncludesClipAndScrollParents) { 697 if (flags & LayerTreeIncludesClipAndScrollParents) {
698 if (m_hasScrollParent) 698 if (m_hasScrollParent)
699 json->setBoolean("hasScrollParent", true); 699 json->setBoolean("hasScrollParent", true);
700 if (m_hasClipParent) 700 if (m_hasClipParent)
701 json->setBoolean("hasClipParent", true); 701 json->setBoolean("hasClipParent", true);
702 } 702 }
703 703
704 if (flags & LayerTreeIncludesDebugInfo) { 704 bool debug = flags & LayerTreeIncludesDebugInfo;
705 RefPtr<JSONArray> compositingReasonsJSON = adoptRef(new JSONArray); 705 RefPtr<JSONArray> compositingReasonsJSON = adoptRef(new JSONArray);
706 for (size_t i = 0; i < kNumberOfCompositingReasons; ++i) { 706 for (size_t i = 0; i < kNumberOfCompositingReasons; ++i) {
707 if (m_debugInfo.compositingReasons() & kCompositingReasonStringMap[i ].reason) 707 if (m_debugInfo.compositingReasons() & kCompositingReasonStringMap[i].re ason)
708 compositingReasonsJSON->pushString(kCompositingReasonStringMap[i ].description); 708 compositingReasonsJSON->pushString(debug ? kCompositingReasonStringM ap[i].description : kCompositingReasonStringMap[i].shortName);
709 }
710 json->setArray("compositingReasons", compositingReasonsJSON);
711 } 709 }
710 json->setArray("compositingReasons", compositingReasonsJSON);
712 711
713 if (m_children.size()) { 712 if (m_children.size()) {
714 RefPtr<JSONArray> childrenJSON = adoptRef(new JSONArray); 713 RefPtr<JSONArray> childrenJSON = adoptRef(new JSONArray);
715 for (size_t i = 0; i < m_children.size(); i++) 714 for (size_t i = 0; i < m_children.size(); i++)
716 childrenJSON->pushObject(m_children[i]->layerTreeAsJSON(flags, rende ringContextMap)); 715 childrenJSON->pushObject(m_children[i]->layerTreeAsJSON(flags, rende ringContextMap));
717 json->setArray("children", childrenJSON); 716 json->setArray("children", childrenJSON);
718 } 717 }
719 718
720 return json; 719 return json;
721 } 720 }
(...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after
1172 { 1171 {
1173 if (!layer) { 1172 if (!layer) {
1174 fprintf(stderr, "Cannot showGraphicsLayerTree for (nil).\n"); 1173 fprintf(stderr, "Cannot showGraphicsLayerTree for (nil).\n");
1175 return; 1174 return;
1176 } 1175 }
1177 1176
1178 String output = layer->layerTreeAsText(blink::LayerTreeIncludesDebugInfo); 1177 String output = layer->layerTreeAsText(blink::LayerTreeIncludesDebugInfo);
1179 fprintf(stderr, "%s\n", output.utf8().data()); 1178 fprintf(stderr, "%s\n", output.utf8().data());
1180 } 1179 }
1181 #endif 1180 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698