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 765 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
776 } | 776 } |
777 | 777 |
778 if (flags & (LayerTreeIncludesDebugInfo | LayerTreeIncludesCompositingReason
s)) { | 778 if (flags & (LayerTreeIncludesDebugInfo | LayerTreeIncludesCompositingReason
s)) { |
779 bool debug = flags & LayerTreeIncludesDebugInfo; | 779 bool debug = flags & LayerTreeIncludesDebugInfo; |
780 RefPtr<JSONArray> compositingReasonsJSON = adoptRef(new JSONArray); | 780 RefPtr<JSONArray> compositingReasonsJSON = adoptRef(new JSONArray); |
781 for (size_t i = 0; i < kNumberOfCompositingReasons; ++i) { | 781 for (size_t i = 0; i < kNumberOfCompositingReasons; ++i) { |
782 if (m_debugInfo.compositingReasons() & kCompositingReasonStringMap[i
].reason) | 782 if (m_debugInfo.compositingReasons() & kCompositingReasonStringMap[i
].reason) |
783 compositingReasonsJSON->pushString(debug ? kCompositingReasonStr
ingMap[i].description : kCompositingReasonStringMap[i].shortName); | 783 compositingReasonsJSON->pushString(debug ? kCompositingReasonStr
ingMap[i].description : kCompositingReasonStringMap[i].shortName); |
784 } | 784 } |
785 json->setArray("compositingReasons", compositingReasonsJSON); | 785 json->setArray("compositingReasons", compositingReasonsJSON); |
| 786 |
| 787 RefPtr<JSONArray> squashingDisallowedReasonsJSON = adoptRef(new JSONArra
y); |
| 788 for (size_t i = 0; i < kNumberOfSquashingDisallowedReasons; ++i) { |
| 789 if (m_debugInfo.squashingDisallowedReasons() & kSquashingDisallowedR
easonStringMap[i].reason) |
| 790 squashingDisallowedReasonsJSON->pushString(debug ? kSquashingDis
allowedReasonStringMap[i].description : kSquashingDisallowedReasonStringMap[i].s
hortName); |
| 791 } |
| 792 json->setArray("squashingDisallowedReasons", squashingDisallowedReasonsJ
SON); |
786 } | 793 } |
787 | 794 |
788 if (m_children.size()) { | 795 if (m_children.size()) { |
789 RefPtr<JSONArray> childrenJSON = adoptRef(new JSONArray); | 796 RefPtr<JSONArray> childrenJSON = adoptRef(new JSONArray); |
790 for (size_t i = 0; i < m_children.size(); i++) | 797 for (size_t i = 0; i < m_children.size(); i++) |
791 childrenJSON->pushObject(m_children[i]->layerTreeAsJSON(flags, rende
ringContextMap)); | 798 childrenJSON->pushObject(m_children[i]->layerTreeAsJSON(flags, rende
ringContextMap)); |
792 json->setArray("children", childrenJSON); | 799 json->setArray("children", childrenJSON); |
793 } | 800 } |
794 | 801 |
795 return json; | 802 return json; |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
831 ASSERT_NOT_REACHED(); | 838 ASSERT_NOT_REACHED(); |
832 } | 839 } |
833 return name; | 840 return name; |
834 } | 841 } |
835 | 842 |
836 void GraphicsLayer::setCompositingReasons(CompositingReasons reasons) | 843 void GraphicsLayer::setCompositingReasons(CompositingReasons reasons) |
837 { | 844 { |
838 m_debugInfo.setCompositingReasons(reasons); | 845 m_debugInfo.setCompositingReasons(reasons); |
839 } | 846 } |
840 | 847 |
| 848 void GraphicsLayer::setSquashingDisallowedReasons(SquashingDisallowedReasons rea
sons) |
| 849 { |
| 850 m_debugInfo.setSquashingDisallowedReasons(reasons); |
| 851 } |
| 852 |
841 void GraphicsLayer::setOwnerNodeId(int nodeId) | 853 void GraphicsLayer::setOwnerNodeId(int nodeId) |
842 { | 854 { |
843 m_debugInfo.setOwnerNodeId(nodeId); | 855 m_debugInfo.setOwnerNodeId(nodeId); |
844 } | 856 } |
845 | 857 |
846 void GraphicsLayer::setPosition(const FloatPoint& point) | 858 void GraphicsLayer::setPosition(const FloatPoint& point) |
847 { | 859 { |
848 m_position = point; | 860 m_position = point; |
849 platformLayer()->setPosition(m_position); | 861 platformLayer()->setPosition(m_position); |
850 } | 862 } |
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1259 { | 1271 { |
1260 if (!layer) { | 1272 if (!layer) { |
1261 fprintf(stderr, "Cannot showGraphicsLayerTree for (nil).\n"); | 1273 fprintf(stderr, "Cannot showGraphicsLayerTree for (nil).\n"); |
1262 return; | 1274 return; |
1263 } | 1275 } |
1264 | 1276 |
1265 String output = layer->layerTreeAsText(blink::LayerTreeIncludesDebugInfo); | 1277 String output = layer->layerTreeAsText(blink::LayerTreeIncludesDebugInfo); |
1266 fprintf(stderr, "%s\n", output.utf8().data()); | 1278 fprintf(stderr, "%s\n", output.utf8().data()); |
1267 } | 1279 } |
1268 #endif | 1280 #endif |
OLD | NEW |