| 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 630 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 641 std::unique_ptr<JSONObject> json = JSONObject::create(); | 641 std::unique_ptr<JSONObject> json = JSONObject::create(); |
| 642 | 642 |
| 643 if (flags & LayerTreeIncludesDebugInfo) | 643 if (flags & LayerTreeIncludesDebugInfo) |
| 644 json->setString("this", pointerAsString(this)); | 644 json->setString("this", pointerAsString(this)); |
| 645 | 645 |
| 646 json->setString("name", debugName()); | 646 json->setString("name", debugName()); |
| 647 | 647 |
| 648 if (m_position != FloatPoint()) | 648 if (m_position != FloatPoint()) |
| 649 json->setArray("position", pointAsJSONArray(m_position)); | 649 json->setArray("position", pointAsJSONArray(m_position)); |
| 650 | 650 |
| 651 if (flags & LayerTreeIncludesDebugInfo && |
| 652 m_offsetFromLayoutObject != DoubleSize()) { |
| 653 json->setArray("offsetFromLayoutObject", |
| 654 sizeAsJSONArray(m_offsetFromLayoutObject)); |
| 655 } |
| 656 |
| 651 if (m_hasTransformOrigin && | 657 if (m_hasTransformOrigin && |
| 652 m_transformOrigin != | 658 m_transformOrigin != |
| 653 FloatPoint3D(m_size.width() * 0.5f, m_size.height() * 0.5f, 0)) | 659 FloatPoint3D(m_size.width() * 0.5f, m_size.height() * 0.5f, 0)) |
| 654 json->setArray("transformOrigin", pointAsJSONArray(m_transformOrigin)); | 660 json->setArray("transformOrigin", pointAsJSONArray(m_transformOrigin)); |
| 655 | 661 |
| 656 if (m_size != IntSize()) | 662 if (m_size != IntSize()) |
| 657 json->setArray("bounds", sizeAsJSONArray(m_size)); | 663 json->setArray("bounds", sizeAsJSONArray(m_size)); |
| 658 | 664 |
| 659 if (m_opacity != 1) | 665 if (m_opacity != 1) |
| 660 json->setDouble("opacity", m_opacity); | 666 json->setDouble("opacity", m_opacity); |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 761 if (m_debugInfo.getSquashingDisallowedReasons() & | 767 if (m_debugInfo.getSquashingDisallowedReasons() & |
| 762 kSquashingDisallowedReasonStringMap[i].reason) { | 768 kSquashingDisallowedReasonStringMap[i].reason) { |
| 763 squashingDisallowedReasonsJSON->pushString( | 769 squashingDisallowedReasonsJSON->pushString( |
| 764 debug ? kSquashingDisallowedReasonStringMap[i].description | 770 debug ? kSquashingDisallowedReasonStringMap[i].description |
| 765 : kSquashingDisallowedReasonStringMap[i].shortName); | 771 : kSquashingDisallowedReasonStringMap[i].shortName); |
| 766 } | 772 } |
| 767 } | 773 } |
| 768 json->setArray("squashingDisallowedReasons", | 774 json->setArray("squashingDisallowedReasons", |
| 769 std::move(squashingDisallowedReasonsJSON)); | 775 std::move(squashingDisallowedReasonsJSON)); |
| 770 } | 776 } |
| 777 |
| 778 if (m_maskLayer) { |
| 779 std::unique_ptr<JSONArray> maskLayerJSON = JSONArray::create(); |
| 780 maskLayerJSON->pushObject( |
| 781 m_maskLayer->layerAsJSONInternal(flags, renderingContextMap)); |
| 782 json->setArray("maskLayer", std::move(maskLayerJSON)); |
| 783 } |
| 784 |
| 785 if (m_contentsClippingMaskLayer) { |
| 786 std::unique_ptr<JSONArray> contentsClippingMaskLayerJSON = |
| 787 JSONArray::create(); |
| 788 contentsClippingMaskLayerJSON->pushObject( |
| 789 m_contentsClippingMaskLayer->layerAsJSONInternal(flags, |
| 790 renderingContextMap)); |
| 791 json->setArray("contentsClippingMaskLayer", |
| 792 std::move(contentsClippingMaskLayerJSON)); |
| 793 } |
| 794 |
| 771 return json; | 795 return json; |
| 772 } | 796 } |
| 773 | 797 |
| 774 std::unique_ptr<JSONObject> GraphicsLayer::layerTreeAsJSONInternal( | 798 std::unique_ptr<JSONObject> GraphicsLayer::layerTreeAsJSONInternal( |
| 775 LayerTreeFlags flags, | 799 LayerTreeFlags flags, |
| 776 RenderingContextMap& renderingContextMap) const { | 800 RenderingContextMap& renderingContextMap) const { |
| 777 std::unique_ptr<JSONObject> json = | 801 std::unique_ptr<JSONObject> json = |
| 778 layerAsJSONInternal(flags, renderingContextMap); | 802 layerAsJSONInternal(flags, renderingContextMap); |
| 779 | 803 |
| 780 if (m_children.size()) { | 804 if (m_children.size()) { |
| (...skipping 538 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1319 void showGraphicsLayerTree(const blink::GraphicsLayer* layer) { | 1343 void showGraphicsLayerTree(const blink::GraphicsLayer* layer) { |
| 1320 if (!layer) { | 1344 if (!layer) { |
| 1321 LOG(INFO) << "Cannot showGraphicsLayerTree for (nil)."; | 1345 LOG(INFO) << "Cannot showGraphicsLayerTree for (nil)."; |
| 1322 return; | 1346 return; |
| 1323 } | 1347 } |
| 1324 | 1348 |
| 1325 String output = layer->layerTreeAsText(blink::LayerTreeIncludesDebugInfo); | 1349 String output = layer->layerTreeAsText(blink::LayerTreeIncludesDebugInfo); |
| 1326 LOG(INFO) << output.utf8().data(); | 1350 LOG(INFO) << output.utf8().data(); |
| 1327 } | 1351 } |
| 1328 #endif | 1352 #endif |
| OLD | NEW |