OLD | NEW |
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 Loading... |
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 if (flags & (LayerTreeIncludesDebugInfo | LayerTreeIncludesCompositingReason
s)) { |
| 705 bool debug = flags & LayerTreeIncludesDebugInfo; |
705 RefPtr<JSONArray> compositingReasonsJSON = adoptRef(new JSONArray); | 706 RefPtr<JSONArray> compositingReasonsJSON = adoptRef(new JSONArray); |
706 for (size_t i = 0; i < kNumberOfCompositingReasons; ++i) { | 707 for (size_t i = 0; i < kNumberOfCompositingReasons; ++i) { |
707 if (m_debugInfo.compositingReasons() & kCompositingReasonStringMap[i
].reason) | 708 if (m_debugInfo.compositingReasons() & kCompositingReasonStringMap[i
].reason) |
708 compositingReasonsJSON->pushString(kCompositingReasonStringMap[i
].description); | 709 compositingReasonsJSON->pushString(debug ? kCompositingReasonStr
ingMap[i].description : kCompositingReasonStringMap[i].shortName); |
709 } | 710 } |
710 json->setArray("compositingReasons", compositingReasonsJSON); | 711 json->setArray("compositingReasons", compositingReasonsJSON); |
711 } | 712 } |
712 | 713 |
713 if (m_children.size()) { | 714 if (m_children.size()) { |
714 RefPtr<JSONArray> childrenJSON = adoptRef(new JSONArray); | 715 RefPtr<JSONArray> childrenJSON = adoptRef(new JSONArray); |
715 for (size_t i = 0; i < m_children.size(); i++) | 716 for (size_t i = 0; i < m_children.size(); i++) |
716 childrenJSON->pushObject(m_children[i]->layerTreeAsJSON(flags, rende
ringContextMap)); | 717 childrenJSON->pushObject(m_children[i]->layerTreeAsJSON(flags, rende
ringContextMap)); |
717 json->setArray("children", childrenJSON); | 718 json->setArray("children", childrenJSON); |
718 } | 719 } |
(...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1172 { | 1173 { |
1173 if (!layer) { | 1174 if (!layer) { |
1174 fprintf(stderr, "Cannot showGraphicsLayerTree for (nil).\n"); | 1175 fprintf(stderr, "Cannot showGraphicsLayerTree for (nil).\n"); |
1175 return; | 1176 return; |
1176 } | 1177 } |
1177 | 1178 |
1178 String output = layer->layerTreeAsText(blink::LayerTreeIncludesDebugInfo); | 1179 String output = layer->layerTreeAsText(blink::LayerTreeIncludesDebugInfo); |
1179 fprintf(stderr, "%s\n", output.utf8().data()); | 1180 fprintf(stderr, "%s\n", output.utf8().data()); |
1180 } | 1181 } |
1181 #endif | 1182 #endif |
OLD | NEW |