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

Side by Side Diff: third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp

Issue 2555283002: Add mask layer and offsetFromLayoutObject info to GraphicsLayer JSON (Closed)
Patch Set: Created 4 years 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
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 630 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 (m_offsetFromLayoutObject != DoubleSize()) {
652 json->setArray("offsetFromLayoutObject",
653 sizeAsJSONArray(m_offsetFromLayoutObject));
654 }
Stephen Chennney 2016/12/07 20:29:11 I'm not so sure about outputting this. Lots of lay
ajuma 2016/12/07 22:53:18 What about adding a LayerTreeFlag for it and only
655
651 if (m_hasTransformOrigin && 656 if (m_hasTransformOrigin &&
652 m_transformOrigin != 657 m_transformOrigin !=
653 FloatPoint3D(m_size.width() * 0.5f, m_size.height() * 0.5f, 0)) 658 FloatPoint3D(m_size.width() * 0.5f, m_size.height() * 0.5f, 0))
654 json->setArray("transformOrigin", pointAsJSONArray(m_transformOrigin)); 659 json->setArray("transformOrigin", pointAsJSONArray(m_transformOrigin));
655 660
656 if (m_size != IntSize()) 661 if (m_size != IntSize())
657 json->setArray("bounds", sizeAsJSONArray(m_size)); 662 json->setArray("bounds", sizeAsJSONArray(m_size));
658 663
659 if (m_opacity != 1) 664 if (m_opacity != 1)
660 json->setDouble("opacity", m_opacity); 665 json->setDouble("opacity", m_opacity);
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
761 if (m_debugInfo.getSquashingDisallowedReasons() & 766 if (m_debugInfo.getSquashingDisallowedReasons() &
762 kSquashingDisallowedReasonStringMap[i].reason) { 767 kSquashingDisallowedReasonStringMap[i].reason) {
763 squashingDisallowedReasonsJSON->pushString( 768 squashingDisallowedReasonsJSON->pushString(
764 debug ? kSquashingDisallowedReasonStringMap[i].description 769 debug ? kSquashingDisallowedReasonStringMap[i].description
765 : kSquashingDisallowedReasonStringMap[i].shortName); 770 : kSquashingDisallowedReasonStringMap[i].shortName);
766 } 771 }
767 } 772 }
768 json->setArray("squashingDisallowedReasons", 773 json->setArray("squashingDisallowedReasons",
769 std::move(squashingDisallowedReasonsJSON)); 774 std::move(squashingDisallowedReasonsJSON));
770 } 775 }
776
777 if (m_maskLayer) {
778 std::unique_ptr<JSONArray> maskLayerJSON = JSONArray::create();
779 maskLayerJSON->pushObject(
780 m_maskLayer->layerAsJSONInternal(flags, renderingContextMap));
781 json->setArray("maskLayer", std::move(maskLayerJSON));
782 }
783
784 if (m_contentsClippingMaskLayer) {
785 std::unique_ptr<JSONArray> contentsClippingMaskLayerJSON =
786 JSONArray::create();
787 contentsClippingMaskLayerJSON->pushObject(
788 m_contentsClippingMaskLayer->layerAsJSONInternal(flags,
789 renderingContextMap));
790 json->setArray("contentsClippingMaskLayer",
791 std::move(contentsClippingMaskLayerJSON));
792 }
Stephen Chennney 2016/12/07 20:29:11 These missing layers were a big issue in originall
793
771 return json; 794 return json;
772 } 795 }
773 796
774 std::unique_ptr<JSONObject> GraphicsLayer::layerTreeAsJSONInternal( 797 std::unique_ptr<JSONObject> GraphicsLayer::layerTreeAsJSONInternal(
775 LayerTreeFlags flags, 798 LayerTreeFlags flags,
776 RenderingContextMap& renderingContextMap) const { 799 RenderingContextMap& renderingContextMap) const {
777 std::unique_ptr<JSONObject> json = 800 std::unique_ptr<JSONObject> json =
778 layerAsJSONInternal(flags, renderingContextMap); 801 layerAsJSONInternal(flags, renderingContextMap);
779 802
780 if (m_children.size()) { 803 if (m_children.size()) {
(...skipping 538 matching lines...) Expand 10 before | Expand all | Expand 10 after
1319 void showGraphicsLayerTree(const blink::GraphicsLayer* layer) { 1342 void showGraphicsLayerTree(const blink::GraphicsLayer* layer) {
1320 if (!layer) { 1343 if (!layer) {
1321 LOG(INFO) << "Cannot showGraphicsLayerTree for (nil)."; 1344 LOG(INFO) << "Cannot showGraphicsLayerTree for (nil).";
1322 return; 1345 return;
1323 } 1346 }
1324 1347
1325 String output = layer->layerTreeAsText(blink::LayerTreeIncludesDebugInfo); 1348 String output = layer->layerTreeAsText(blink::LayerTreeIncludesDebugInfo);
1326 LOG(INFO) << output.utf8().data(); 1349 LOG(INFO) << output.utf8().data();
1327 } 1350 }
1328 #endif 1351 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698