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

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

Issue 2194273002: Fix border radius on composited children. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Revised method based on PaintLayer switching 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 }
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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
718 if ((flags & LayerTreeIncludesPaintingPhases) && m_paintingPhase) { 723 if ((flags & LayerTreeIncludesPaintingPhases) && m_paintingPhase) {
719 std::unique_ptr<JSONArray> paintingPhasesJSON = JSONArray::create(); 724 std::unique_ptr<JSONArray> paintingPhasesJSON = JSONArray::create();
720 if (m_paintingPhase & GraphicsLayerPaintBackground) 725 if (m_paintingPhase & GraphicsLayerPaintBackground)
721 paintingPhasesJSON->pushString("GraphicsLayerPaintBackground"); 726 paintingPhasesJSON->pushString("GraphicsLayerPaintBackground");
722 if (m_paintingPhase & GraphicsLayerPaintForeground) 727 if (m_paintingPhase & GraphicsLayerPaintForeground)
723 paintingPhasesJSON->pushString("GraphicsLayerPaintForeground"); 728 paintingPhasesJSON->pushString("GraphicsLayerPaintForeground");
724 if (m_paintingPhase & GraphicsLayerPaintMask) 729 if (m_paintingPhase & GraphicsLayerPaintMask)
725 paintingPhasesJSON->pushString("GraphicsLayerPaintMask"); 730 paintingPhasesJSON->pushString("GraphicsLayerPaintMask");
726 if (m_paintingPhase & GraphicsLayerPaintChildClippingMask) 731 if (m_paintingPhase & GraphicsLayerPaintChildClippingMask)
727 paintingPhasesJSON->pushString("GraphicsLayerPaintChildClippingMask"); 732 paintingPhasesJSON->pushString("GraphicsLayerPaintChildClippingMask");
733 if (m_paintingPhase & GraphicsLayerPaintAncestorClippingMask)
734 paintingPhasesJSON->pushString("GraphicsLayerPaintAncestorClippingMask");
728 if (m_paintingPhase & GraphicsLayerPaintOverflowContents) 735 if (m_paintingPhase & GraphicsLayerPaintOverflowContents)
729 paintingPhasesJSON->pushString("GraphicsLayerPaintOverflowContents"); 736 paintingPhasesJSON->pushString("GraphicsLayerPaintOverflowContents");
730 if (m_paintingPhase & GraphicsLayerPaintCompositedScroll) 737 if (m_paintingPhase & GraphicsLayerPaintCompositedScroll)
731 paintingPhasesJSON->pushString("GraphicsLayerPaintCompositedScroll"); 738 paintingPhasesJSON->pushString("GraphicsLayerPaintCompositedScroll");
732 if (m_paintingPhase & GraphicsLayerPaintDecoration) 739 if (m_paintingPhase & GraphicsLayerPaintDecoration)
733 paintingPhasesJSON->pushString("GraphicsLayerPaintDecoration"); 740 paintingPhasesJSON->pushString("GraphicsLayerPaintDecoration");
734 json->setArray("paintingPhases", std::move(paintingPhasesJSON)); 741 json->setArray("paintingPhases", std::move(paintingPhasesJSON));
735 } 742 }
736 743
737 if (flags & LayerTreeIncludesClipAndScrollParents) { 744 if (flags & LayerTreeIncludesClipAndScrollParents) {
(...skipping 23 matching lines...) Expand all
761 if (m_debugInfo.getSquashingDisallowedReasons() & 768 if (m_debugInfo.getSquashingDisallowedReasons() &
762 kSquashingDisallowedReasonStringMap[i].reason) { 769 kSquashingDisallowedReasonStringMap[i].reason) {
763 squashingDisallowedReasonsJSON->pushString( 770 squashingDisallowedReasonsJSON->pushString(
764 debug ? kSquashingDisallowedReasonStringMap[i].description 771 debug ? kSquashingDisallowedReasonStringMap[i].description
765 : kSquashingDisallowedReasonStringMap[i].shortName); 772 : kSquashingDisallowedReasonStringMap[i].shortName);
766 } 773 }
767 } 774 }
768 json->setArray("squashingDisallowedReasons", 775 json->setArray("squashingDisallowedReasons",
769 std::move(squashingDisallowedReasonsJSON)); 776 std::move(squashingDisallowedReasonsJSON));
770 } 777 }
778
779 if (m_maskLayer) {
780 std::unique_ptr<JSONArray> maskLayerJSON = JSONArray::create();
781 maskLayerJSON->pushObject(
782 m_maskLayer->layerAsJSONInternal(flags, renderingContextMap));
783 json->setArray("maskLayer", std::move(maskLayerJSON));
784 }
785
786 if (m_contentsClippingMaskLayer) {
787 std::unique_ptr<JSONArray> contentsClippingMaskLayerJSON =
788 JSONArray::create();
789 contentsClippingMaskLayerJSON->pushObject(m_contentsClippingMaskLayer->
790 layerAsJSONInternal(flags, 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 534 matching lines...) Expand 10 before | Expand all | Expand 10 after
1315 1339
1316 } // namespace blink 1340 } // namespace blink
1317 1341
1318 #ifndef NDEBUG 1342 #ifndef NDEBUG
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(255);
1326 LOG(INFO) << output.utf8().data(); 1350 LOG(INFO) << output.utf8().data();
1327 } 1351 }
1328 #endif 1352 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698