| 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 600 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 611 | 611 |
| 612 // Then compare clientDebugName, in alphabetic order. | 612 // Then compare clientDebugName, in alphabetic order. |
| 613 int nameCompareResult = codePointCompare(a.clientDebugName, b.clientDebugNam
e); | 613 int nameCompareResult = codePointCompare(a.clientDebugName, b.clientDebugNam
e); |
| 614 if (nameCompareResult != 0) | 614 if (nameCompareResult != 0) |
| 615 return nameCompareResult < 0; | 615 return nameCompareResult < 0; |
| 616 | 616 |
| 617 return a.reason < b.reason; | 617 return a.reason < b.reason; |
| 618 } | 618 } |
| 619 | 619 |
| 620 template <typename T> | 620 template <typename T> |
| 621 static PassRefPtr<JSONArray> pointAsJSONArray(const T& point) | 621 static std::unique_ptr<JSONArray> pointAsJSONArray(const T& point) |
| 622 { | 622 { |
| 623 RefPtr<JSONArray> array = JSONArray::create(); | 623 std::unique_ptr<JSONArray> array = JSONArray::create(); |
| 624 array->pushNumber(point.x()); | 624 array->pushDouble(point.x()); |
| 625 array->pushNumber(point.y()); | 625 array->pushDouble(point.y()); |
| 626 return array; | 626 return array; |
| 627 } | 627 } |
| 628 | 628 |
| 629 template <typename T> | 629 template <typename T> |
| 630 static PassRefPtr<JSONArray> sizeAsJSONArray(const T& size) | 630 static std::unique_ptr<JSONArray> sizeAsJSONArray(const T& size) |
| 631 { | 631 { |
| 632 RefPtr<JSONArray> array = JSONArray::create(); | 632 std::unique_ptr<JSONArray> array = JSONArray::create(); |
| 633 array->pushNumber(size.width()); | 633 array->pushDouble(size.width()); |
| 634 array->pushNumber(size.height()); | 634 array->pushDouble(size.height()); |
| 635 return array; | 635 return array; |
| 636 } | 636 } |
| 637 | 637 |
| 638 template <typename T> | 638 template <typename T> |
| 639 static PassRefPtr<JSONArray> rectAsJSONArray(const T& rect) | 639 static std::unique_ptr<JSONArray> rectAsJSONArray(const T& rect) |
| 640 { | 640 { |
| 641 RefPtr<JSONArray> array = JSONArray::create(); | 641 std::unique_ptr<JSONArray> array = JSONArray::create(); |
| 642 array->pushNumber(rect.x()); | 642 array->pushDouble(rect.x()); |
| 643 array->pushNumber(rect.y()); | 643 array->pushDouble(rect.y()); |
| 644 array->pushNumber(rect.width()); | 644 array->pushDouble(rect.width()); |
| 645 array->pushNumber(rect.height()); | 645 array->pushDouble(rect.height()); |
| 646 return array; | 646 return array; |
| 647 } | 647 } |
| 648 | 648 |
| 649 static double roundCloseToZero(double number) | 649 static double roundCloseToZero(double number) |
| 650 { | 650 { |
| 651 return std::abs(number) < 1e-7 ? 0 : number; | 651 return std::abs(number) < 1e-7 ? 0 : number; |
| 652 } | 652 } |
| 653 | 653 |
| 654 static PassRefPtr<JSONArray> transformAsJSONArray(const TransformationMatrix& t) | 654 static std::unique_ptr<JSONArray> transformAsJSONArray(const TransformationMatri
x& t) |
| 655 { | 655 { |
| 656 RefPtr<JSONArray> array = JSONArray::create(); | 656 std::unique_ptr<JSONArray> array = JSONArray::create(); |
| 657 { | 657 { |
| 658 RefPtr<JSONArray> row = JSONArray::create(); | 658 std::unique_ptr<JSONArray> row = JSONArray::create(); |
| 659 row->pushNumber(roundCloseToZero(t.m11())); | 659 row->pushDouble(roundCloseToZero(t.m11())); |
| 660 row->pushNumber(roundCloseToZero(t.m12())); | 660 row->pushDouble(roundCloseToZero(t.m12())); |
| 661 row->pushNumber(roundCloseToZero(t.m13())); | 661 row->pushDouble(roundCloseToZero(t.m13())); |
| 662 row->pushNumber(roundCloseToZero(t.m14())); | 662 row->pushDouble(roundCloseToZero(t.m14())); |
| 663 array->pushArray(row); | 663 array->pushArray(std::move(row)); |
| 664 } | 664 } |
| 665 { | 665 { |
| 666 RefPtr<JSONArray> row = JSONArray::create(); | 666 std::unique_ptr<JSONArray> row = JSONArray::create(); |
| 667 row->pushNumber(roundCloseToZero(t.m21())); | 667 row->pushDouble(roundCloseToZero(t.m21())); |
| 668 row->pushNumber(roundCloseToZero(t.m22())); | 668 row->pushDouble(roundCloseToZero(t.m22())); |
| 669 row->pushNumber(roundCloseToZero(t.m23())); | 669 row->pushDouble(roundCloseToZero(t.m23())); |
| 670 row->pushNumber(roundCloseToZero(t.m24())); | 670 row->pushDouble(roundCloseToZero(t.m24())); |
| 671 array->pushArray(row); | 671 array->pushArray(std::move(row)); |
| 672 } | 672 } |
| 673 { | 673 { |
| 674 RefPtr<JSONArray> row = JSONArray::create(); | 674 std::unique_ptr<JSONArray> row = JSONArray::create(); |
| 675 row->pushNumber(roundCloseToZero(t.m31())); | 675 row->pushDouble(roundCloseToZero(t.m31())); |
| 676 row->pushNumber(roundCloseToZero(t.m32())); | 676 row->pushDouble(roundCloseToZero(t.m32())); |
| 677 row->pushNumber(roundCloseToZero(t.m33())); | 677 row->pushDouble(roundCloseToZero(t.m33())); |
| 678 row->pushNumber(roundCloseToZero(t.m34())); | 678 row->pushDouble(roundCloseToZero(t.m34())); |
| 679 array->pushArray(row); | 679 array->pushArray(std::move(row)); |
| 680 } | 680 } |
| 681 { | 681 { |
| 682 RefPtr<JSONArray> row = JSONArray::create(); | 682 std::unique_ptr<JSONArray> row = JSONArray::create(); |
| 683 row->pushNumber(roundCloseToZero(t.m41())); | 683 row->pushDouble(roundCloseToZero(t.m41())); |
| 684 row->pushNumber(roundCloseToZero(t.m42())); | 684 row->pushDouble(roundCloseToZero(t.m42())); |
| 685 row->pushNumber(roundCloseToZero(t.m43())); | 685 row->pushDouble(roundCloseToZero(t.m43())); |
| 686 row->pushNumber(roundCloseToZero(t.m44())); | 686 row->pushDouble(roundCloseToZero(t.m44())); |
| 687 array->pushArray(row); | 687 array->pushArray(std::move(row)); |
| 688 } | 688 } |
| 689 return array; | 689 return array; |
| 690 } | 690 } |
| 691 | 691 |
| 692 static String pointerAsString(const void* ptr) | 692 static String pointerAsString(const void* ptr) |
| 693 { | 693 { |
| 694 TextStream ts; | 694 TextStream ts; |
| 695 ts << ptr; | 695 ts << ptr; |
| 696 return ts.release(); | 696 return ts.release(); |
| 697 } | 697 } |
| 698 | 698 |
| 699 PassRefPtr<JSONObject> GraphicsLayer::layerTreeAsJSON(LayerTreeFlags flags) cons
t | 699 std::unique_ptr<JSONObject> GraphicsLayer::layerTreeAsJSON(LayerTreeFlags flags)
const |
| 700 { | 700 { |
| 701 RenderingContextMap renderingContextMap; | 701 RenderingContextMap renderingContextMap; |
| 702 return layerTreeAsJSONInternal(flags, renderingContextMap); | 702 return layerTreeAsJSONInternal(flags, renderingContextMap); |
| 703 } | 703 } |
| 704 | 704 |
| 705 PassRefPtr<JSONObject> GraphicsLayer::layerTreeAsJSONInternal(LayerTreeFlags fla
gs, RenderingContextMap& renderingContextMap) const | 705 std::unique_ptr<JSONObject> GraphicsLayer::layerTreeAsJSONInternal(LayerTreeFlag
s flags, RenderingContextMap& renderingContextMap) const |
| 706 { | 706 { |
| 707 RefPtr<JSONObject> json = JSONObject::create(); | 707 std::unique_ptr<JSONObject> json = JSONObject::create(); |
| 708 | 708 |
| 709 if (flags & LayerTreeIncludesDebugInfo) | 709 if (flags & LayerTreeIncludesDebugInfo) |
| 710 json->setString("this", pointerAsString(this)); | 710 json->setString("this", pointerAsString(this)); |
| 711 | 711 |
| 712 json->setString("name", debugName()); | 712 json->setString("name", debugName()); |
| 713 | 713 |
| 714 if (m_position != FloatPoint()) | 714 if (m_position != FloatPoint()) |
| 715 json->setArray("position", pointAsJSONArray(m_position)); | 715 json->setArray("position", pointAsJSONArray(m_position)); |
| 716 | 716 |
| 717 if (m_hasTransformOrigin && m_transformOrigin != FloatPoint3D(m_size.width()
* 0.5f, m_size.height() * 0.5f, 0)) | 717 if (m_hasTransformOrigin && m_transformOrigin != FloatPoint3D(m_size.width()
* 0.5f, m_size.height() * 0.5f, 0)) |
| 718 json->setArray("transformOrigin", pointAsJSONArray(m_transformOrigin)); | 718 json->setArray("transformOrigin", pointAsJSONArray(m_transformOrigin)); |
| 719 | 719 |
| 720 if (m_size != IntSize()) | 720 if (m_size != IntSize()) |
| 721 json->setArray("bounds", sizeAsJSONArray(m_size)); | 721 json->setArray("bounds", sizeAsJSONArray(m_size)); |
| 722 | 722 |
| 723 if (m_opacity != 1) | 723 if (m_opacity != 1) |
| 724 json->setNumber("opacity", m_opacity); | 724 json->setDouble("opacity", m_opacity); |
| 725 | 725 |
| 726 if (m_blendMode != WebBlendModeNormal) | 726 if (m_blendMode != WebBlendModeNormal) |
| 727 json->setString("blendMode", compositeOperatorName(CompositeSourceOver,
m_blendMode)); | 727 json->setString("blendMode", compositeOperatorName(CompositeSourceOver,
m_blendMode)); |
| 728 | 728 |
| 729 if (m_isRootForIsolatedGroup) | 729 if (m_isRootForIsolatedGroup) |
| 730 json->setBoolean("isolate", m_isRootForIsolatedGroup); | 730 json->setBoolean("isolate", m_isRootForIsolatedGroup); |
| 731 | 731 |
| 732 if (m_contentsOpaque) | 732 if (m_contentsOpaque) |
| 733 json->setBoolean("contentsOpaque", m_contentsOpaque); | 733 json->setBoolean("contentsOpaque", m_contentsOpaque); |
| 734 | 734 |
| 735 if (!m_shouldFlattenTransform) | 735 if (!m_shouldFlattenTransform) |
| 736 json->setBoolean("shouldFlattenTransform", m_shouldFlattenTransform); | 736 json->setBoolean("shouldFlattenTransform", m_shouldFlattenTransform); |
| 737 | 737 |
| 738 if (m_3dRenderingContext) { | 738 if (m_3dRenderingContext) { |
| 739 RenderingContextMap::const_iterator it = renderingContextMap.find(m_3dRe
nderingContext); | 739 RenderingContextMap::const_iterator it = renderingContextMap.find(m_3dRe
nderingContext); |
| 740 int contextId = renderingContextMap.size() + 1; | 740 int contextId = renderingContextMap.size() + 1; |
| 741 if (it == renderingContextMap.end()) | 741 if (it == renderingContextMap.end()) |
| 742 renderingContextMap.set(m_3dRenderingContext, contextId); | 742 renderingContextMap.set(m_3dRenderingContext, contextId); |
| 743 else | 743 else |
| 744 contextId = it->value; | 744 contextId = it->value; |
| 745 | 745 |
| 746 json->setNumber("3dRenderingContext", contextId); | 746 json->setInteger("3dRenderingContext", contextId); |
| 747 } | 747 } |
| 748 | 748 |
| 749 if (m_drawsContent) | 749 if (m_drawsContent) |
| 750 json->setBoolean("drawsContent", m_drawsContent); | 750 json->setBoolean("drawsContent", m_drawsContent); |
| 751 | 751 |
| 752 if (!m_contentsVisible) | 752 if (!m_contentsVisible) |
| 753 json->setBoolean("contentsVisible", m_contentsVisible); | 753 json->setBoolean("contentsVisible", m_contentsVisible); |
| 754 | 754 |
| 755 if (!m_backfaceVisibility) | 755 if (!m_backfaceVisibility) |
| 756 json->setString("backfaceVisibility", m_backfaceVisibility ? "visible" :
"hidden"); | 756 json->setString("backfaceVisibility", m_backfaceVisibility ? "visible" :
"hidden"); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 769 | 769 |
| 770 if (m_replicatedLayer) | 770 if (m_replicatedLayer) |
| 771 json->setString("replicatedLayer", flags & LayerTreeIncludesDebugInfo ?
pointerAsString(m_replicatedLayer) : ""); | 771 json->setString("replicatedLayer", flags & LayerTreeIncludesDebugInfo ?
pointerAsString(m_replicatedLayer) : ""); |
| 772 | 772 |
| 773 PaintInvalidationTrackingMap::iterator it = paintInvalidationTrackingMap().f
ind(this); | 773 PaintInvalidationTrackingMap::iterator it = paintInvalidationTrackingMap().f
ind(this); |
| 774 if (it != paintInvalidationTrackingMap().end()) { | 774 if (it != paintInvalidationTrackingMap().end()) { |
| 775 if (flags & LayerTreeIncludesPaintInvalidations) { | 775 if (flags & LayerTreeIncludesPaintInvalidations) { |
| 776 Vector<PaintInvalidationInfo>& infos = it->value.trackedPaintInvalid
ations; | 776 Vector<PaintInvalidationInfo>& infos = it->value.trackedPaintInvalid
ations; |
| 777 if (!infos.isEmpty()) { | 777 if (!infos.isEmpty()) { |
| 778 std::sort(infos.begin(), infos.end(), &comparePaintInvalidationI
nfo); | 778 std::sort(infos.begin(), infos.end(), &comparePaintInvalidationI
nfo); |
| 779 RefPtr<JSONArray> paintInvalidationsJSON = JSONArray::create(); | 779 std::unique_ptr<JSONArray> paintInvalidationsJSON = JSONArray::c
reate(); |
| 780 for (auto& info : infos) { | 780 for (auto& info : infos) { |
| 781 RefPtr<JSONObject> infoJSON = JSONObject::create(); | 781 std::unique_ptr<JSONObject> infoJSON = JSONObject::create(); |
| 782 infoJSON->setString("object", info.clientDebugName); | 782 infoJSON->setString("object", info.clientDebugName); |
| 783 if (!info.rect.isEmpty()) | 783 if (!info.rect.isEmpty()) |
| 784 infoJSON->setArray("rect", rectAsJSONArray(info.rect)); | 784 infoJSON->setArray("rect", rectAsJSONArray(info.rect)); |
| 785 infoJSON->setString("reason", paintInvalidationReasonToStrin
g(info.reason)); | 785 infoJSON->setString("reason", paintInvalidationReasonToStrin
g(info.reason)); |
| 786 paintInvalidationsJSON->pushObject(infoJSON); | 786 paintInvalidationsJSON->pushObject(std::move(infoJSON)); |
| 787 } | 787 } |
| 788 json->setArray("paintInvalidations", paintInvalidationsJSON); | 788 json->setArray("paintInvalidations", std::move(paintInvalidation
sJSON)); |
| 789 } | 789 } |
| 790 #if DCHECK_IS_ON() | 790 #if DCHECK_IS_ON() |
| 791 Vector<UnderPaintInvalidation>& underPaintInvalidations = it->value.
underPaintInvalidations; | 791 Vector<UnderPaintInvalidation>& underPaintInvalidations = it->value.
underPaintInvalidations; |
| 792 if (!underPaintInvalidations.isEmpty()) { | 792 if (!underPaintInvalidations.isEmpty()) { |
| 793 RefPtr<JSONArray> underPaintInvalidationsJSON = JSONArray::creat
e(); | 793 std::unique_ptr<JSONArray> underPaintInvalidationsJSON = JSONArr
ay::create(); |
| 794 for (auto& underPaintInvalidation : underPaintInvalidations) { | 794 for (auto& underPaintInvalidation : underPaintInvalidations) { |
| 795 RefPtr<JSONObject> underPaintInvalidationJSON = JSONObject::
create(); | 795 std::unique_ptr<JSONObject> underPaintInvalidationJSON = JSO
NObject::create(); |
| 796 underPaintInvalidationJSON->setNumber("x", underPaintInvalid
ation.x); | 796 underPaintInvalidationJSON->setDouble("x", underPaintInvalid
ation.x); |
| 797 underPaintInvalidationJSON->setNumber("y", underPaintInvalid
ation.x); | 797 underPaintInvalidationJSON->setDouble("y", underPaintInvalid
ation.x); |
| 798 underPaintInvalidationJSON->setString("oldPixel", Color(unde
rPaintInvalidation.oldPixel).nameForLayoutTreeAsText()); | 798 underPaintInvalidationJSON->setString("oldPixel", Color(unde
rPaintInvalidation.oldPixel).nameForLayoutTreeAsText()); |
| 799 underPaintInvalidationJSON->setString("newPixel", Color(unde
rPaintInvalidation.newPixel).nameForLayoutTreeAsText()); | 799 underPaintInvalidationJSON->setString("newPixel", Color(unde
rPaintInvalidation.newPixel).nameForLayoutTreeAsText()); |
| 800 underPaintInvalidationsJSON->pushObject(underPaintInvalidati
onJSON); | 800 underPaintInvalidationsJSON->pushObject(std::move(underPaint
InvalidationJSON)); |
| 801 } | 801 } |
| 802 json->setArray("underPaintInvalidations", underPaintInvalidation
sJSON); | 802 json->setArray("underPaintInvalidations", std::move(underPaintIn
validationsJSON)); |
| 803 } | 803 } |
| 804 #endif | 804 #endif |
| 805 } | 805 } |
| 806 } | 806 } |
| 807 | 807 |
| 808 if ((flags & LayerTreeIncludesPaintingPhases) && m_paintingPhase) { | 808 if ((flags & LayerTreeIncludesPaintingPhases) && m_paintingPhase) { |
| 809 RefPtr<JSONArray> paintingPhasesJSON = JSONArray::create(); | 809 std::unique_ptr<JSONArray> paintingPhasesJSON = JSONArray::create(); |
| 810 if (m_paintingPhase & GraphicsLayerPaintBackground) | 810 if (m_paintingPhase & GraphicsLayerPaintBackground) |
| 811 paintingPhasesJSON->pushString("GraphicsLayerPaintBackground"); | 811 paintingPhasesJSON->pushString("GraphicsLayerPaintBackground"); |
| 812 if (m_paintingPhase & GraphicsLayerPaintForeground) | 812 if (m_paintingPhase & GraphicsLayerPaintForeground) |
| 813 paintingPhasesJSON->pushString("GraphicsLayerPaintForeground"); | 813 paintingPhasesJSON->pushString("GraphicsLayerPaintForeground"); |
| 814 if (m_paintingPhase & GraphicsLayerPaintMask) | 814 if (m_paintingPhase & GraphicsLayerPaintMask) |
| 815 paintingPhasesJSON->pushString("GraphicsLayerPaintMask"); | 815 paintingPhasesJSON->pushString("GraphicsLayerPaintMask"); |
| 816 if (m_paintingPhase & GraphicsLayerPaintChildClippingMask) | 816 if (m_paintingPhase & GraphicsLayerPaintChildClippingMask) |
| 817 paintingPhasesJSON->pushString("GraphicsLayerPaintChildClippingMask"
); | 817 paintingPhasesJSON->pushString("GraphicsLayerPaintChildClippingMask"
); |
| 818 if (m_paintingPhase & GraphicsLayerPaintOverflowContents) | 818 if (m_paintingPhase & GraphicsLayerPaintOverflowContents) |
| 819 paintingPhasesJSON->pushString("GraphicsLayerPaintOverflowContents")
; | 819 paintingPhasesJSON->pushString("GraphicsLayerPaintOverflowContents")
; |
| 820 if (m_paintingPhase & GraphicsLayerPaintCompositedScroll) | 820 if (m_paintingPhase & GraphicsLayerPaintCompositedScroll) |
| 821 paintingPhasesJSON->pushString("GraphicsLayerPaintCompositedScroll")
; | 821 paintingPhasesJSON->pushString("GraphicsLayerPaintCompositedScroll")
; |
| 822 json->setArray("paintingPhases", paintingPhasesJSON); | 822 json->setArray("paintingPhases", std::move(paintingPhasesJSON)); |
| 823 } | 823 } |
| 824 | 824 |
| 825 if (flags & LayerTreeIncludesClipAndScrollParents) { | 825 if (flags & LayerTreeIncludesClipAndScrollParents) { |
| 826 if (m_hasScrollParent) | 826 if (m_hasScrollParent) |
| 827 json->setBoolean("hasScrollParent", true); | 827 json->setBoolean("hasScrollParent", true); |
| 828 if (m_hasClipParent) | 828 if (m_hasClipParent) |
| 829 json->setBoolean("hasClipParent", true); | 829 json->setBoolean("hasClipParent", true); |
| 830 } | 830 } |
| 831 | 831 |
| 832 if (flags & (LayerTreeIncludesDebugInfo | LayerTreeIncludesCompositingReason
s)) { | 832 if (flags & (LayerTreeIncludesDebugInfo | LayerTreeIncludesCompositingReason
s)) { |
| 833 bool debug = flags & LayerTreeIncludesDebugInfo; | 833 bool debug = flags & LayerTreeIncludesDebugInfo; |
| 834 RefPtr<JSONArray> compositingReasonsJSON = JSONArray::create(); | 834 std::unique_ptr<JSONArray> compositingReasonsJSON = JSONArray::create(); |
| 835 for (size_t i = 0; i < kNumberOfCompositingReasons; ++i) { | 835 for (size_t i = 0; i < kNumberOfCompositingReasons; ++i) { |
| 836 if (m_debugInfo.getCompositingReasons() & kCompositingReasonStringMa
p[i].reason) | 836 if (m_debugInfo.getCompositingReasons() & kCompositingReasonStringMa
p[i].reason) |
| 837 compositingReasonsJSON->pushString(debug ? kCompositingReasonStr
ingMap[i].description : kCompositingReasonStringMap[i].shortName); | 837 compositingReasonsJSON->pushString(debug ? kCompositingReasonStr
ingMap[i].description : kCompositingReasonStringMap[i].shortName); |
| 838 } | 838 } |
| 839 json->setArray("compositingReasons", compositingReasonsJSON); | 839 json->setArray("compositingReasons", std::move(compositingReasonsJSON)); |
| 840 | 840 |
| 841 RefPtr<JSONArray> squashingDisallowedReasonsJSON = JSONArray::create(); | 841 std::unique_ptr<JSONArray> squashingDisallowedReasonsJSON = JSONArray::c
reate(); |
| 842 for (size_t i = 0; i < kNumberOfSquashingDisallowedReasons; ++i) { | 842 for (size_t i = 0; i < kNumberOfSquashingDisallowedReasons; ++i) { |
| 843 if (m_debugInfo.getSquashingDisallowedReasons() & kSquashingDisallow
edReasonStringMap[i].reason) | 843 if (m_debugInfo.getSquashingDisallowedReasons() & kSquashingDisallow
edReasonStringMap[i].reason) |
| 844 squashingDisallowedReasonsJSON->pushString(debug ? kSquashingDis
allowedReasonStringMap[i].description : kSquashingDisallowedReasonStringMap[i].s
hortName); | 844 squashingDisallowedReasonsJSON->pushString(debug ? kSquashingDis
allowedReasonStringMap[i].description : kSquashingDisallowedReasonStringMap[i].s
hortName); |
| 845 } | 845 } |
| 846 json->setArray("squashingDisallowedReasons", squashingDisallowedReasonsJ
SON); | 846 json->setArray("squashingDisallowedReasons", std::move(squashingDisallow
edReasonsJSON)); |
| 847 } | 847 } |
| 848 | 848 |
| 849 if (m_children.size()) { | 849 if (m_children.size()) { |
| 850 RefPtr<JSONArray> childrenJSON = JSONArray::create(); | 850 std::unique_ptr<JSONArray> childrenJSON = JSONArray::create(); |
| 851 for (size_t i = 0; i < m_children.size(); i++) | 851 for (size_t i = 0; i < m_children.size(); i++) |
| 852 childrenJSON->pushObject(m_children[i]->layerTreeAsJSONInternal(flag
s, renderingContextMap)); | 852 childrenJSON->pushObject(m_children[i]->layerTreeAsJSONInternal(flag
s, renderingContextMap)); |
| 853 json->setArray("children", childrenJSON); | 853 json->setArray("children", std::move(childrenJSON)); |
| 854 } | 854 } |
| 855 | 855 |
| 856 return json; | 856 return json; |
| 857 } | 857 } |
| 858 | 858 |
| 859 String GraphicsLayer::layerTreeAsText(LayerTreeFlags flags) const | 859 String GraphicsLayer::layerTreeAsText(LayerTreeFlags flags) const |
| 860 { | 860 { |
| 861 return layerTreeAsJSON(flags)->toPrettyJSONString(); | 861 return layerTreeAsJSON(flags)->toPrettyJSONString(); |
| 862 } | 862 } |
| 863 | 863 |
| (...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1358 { | 1358 { |
| 1359 if (!layer) { | 1359 if (!layer) { |
| 1360 fprintf(stderr, "Cannot showGraphicsLayerTree for (nil).\n"); | 1360 fprintf(stderr, "Cannot showGraphicsLayerTree for (nil).\n"); |
| 1361 return; | 1361 return; |
| 1362 } | 1362 } |
| 1363 | 1363 |
| 1364 String output = layer->layerTreeAsText(blink::LayerTreeIncludesDebugInfo); | 1364 String output = layer->layerTreeAsText(blink::LayerTreeIncludesDebugInfo); |
| 1365 fprintf(stderr, "%s\n", output.utf8().data()); | 1365 fprintf(stderr, "%s\n", output.utf8().data()); |
| 1366 } | 1366 } |
| 1367 #endif | 1367 #endif |
| OLD | NEW |