| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "core/paint/LayerClipRecorder.h" | 5 #include "core/paint/LayerClipRecorder.h" |
| 6 | 6 |
| 7 #include "core/layout/LayoutView.h" | 7 #include "core/layout/LayoutView.h" |
| 8 #include "core/paint/ClipRect.h" | 8 #include "core/paint/ClipRect.h" |
| 9 #include "core/paint/PaintLayer.h" | 9 #include "core/paint/PaintLayer.h" |
| 10 #include "platform/geometry/IntRect.h" | 10 #include "platform/geometry/IntRect.h" |
| 11 #include "platform/graphics/GraphicsContext.h" | 11 #include "platform/graphics/GraphicsContext.h" |
| 12 #include "platform/graphics/GraphicsLayer.h" | 12 #include "platform/graphics/GraphicsLayer.h" |
| 13 #include "platform/graphics/paint/ClipRecorder.h" | 13 #include "platform/graphics/paint/ClipRecorder.h" |
| 14 #include "platform/graphics/paint/PaintController.h" | 14 #include "platform/graphics/paint/PaintController.h" |
| 15 | 15 |
| 16 namespace blink { | 16 namespace blink { |
| 17 | 17 |
| 18 LayerClipRecorder::LayerClipRecorder(GraphicsContext& graphicsContext, | 18 LayerClipRecorder::LayerClipRecorder(GraphicsContext& graphicsContext, |
| 19 const LayoutBoxModelObject& layoutObject, | 19 const LayoutBoxModelObject& layoutObject, |
| 20 DisplayItem::Type clipType, | 20 DisplayItem::Type clipType, |
| 21 const ClipRect& clipRect, | 21 const ClipRect& clipRect, |
| 22 const PaintLayer* clipRoot, | 22 const PaintLayer* clipRoot, |
| 23 const LayoutPoint& fragmentOffset, | 23 const LayoutPoint& fragmentOffset, |
| 24 PaintLayerFlags paintFlags, | 24 PaintLayerFlags paintFlags, |
| 25 BorderRadiusClippingRule rule) | 25 BorderRadiusClippingRule rule) |
| 26 : m_graphicsContext(graphicsContext), | 26 : m_graphicsContext(graphicsContext), |
| 27 m_layoutObject(layoutObject), | 27 m_layoutObject(layoutObject), |
| 28 m_clipType(clipType) { | 28 m_clipType(clipType) { |
| 29 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) |
| 30 return; |
| 29 IntRect snappedClipRect = pixelSnappedIntRect(clipRect.rect()); | 31 IntRect snappedClipRect = pixelSnappedIntRect(clipRect.rect()); |
| 30 Vector<FloatRoundedRect> roundedRects; | 32 Vector<FloatRoundedRect> roundedRects; |
| 31 if (clipRoot && clipRect.hasRadius()) { | 33 if (clipRoot && clipRect.hasRadius()) { |
| 32 collectRoundedRectClips(*layoutObject.layer(), clipRoot, graphicsContext, | 34 collectRoundedRectClips(*layoutObject.layer(), clipRoot, graphicsContext, |
| 33 fragmentOffset, paintFlags, rule, roundedRects); | 35 fragmentOffset, paintFlags, rule, roundedRects); |
| 34 } | 36 } |
| 35 | 37 |
| 36 m_graphicsContext.getPaintController().createAndAppend<ClipDisplayItem>( | 38 m_graphicsContext.getPaintController().createAndAppend<ClipDisplayItem>( |
| 37 layoutObject, m_clipType, snappedClipRect, roundedRects); | 39 layoutObject, m_clipType, snappedClipRect, roundedRects); |
| 38 } | 40 } |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 layer->layoutObject().style()->getRoundedInnerBorderFor( | 99 layer->layoutObject().style()->getRoundedInnerBorderFor( |
| 98 LayoutRect(delta, size))); | 100 LayoutRect(delta, size))); |
| 99 } | 101 } |
| 100 | 102 |
| 101 if (layer == clipRoot) | 103 if (layer == clipRoot) |
| 102 break; | 104 break; |
| 103 } | 105 } |
| 104 } | 106 } |
| 105 | 107 |
| 106 LayerClipRecorder::~LayerClipRecorder() { | 108 LayerClipRecorder::~LayerClipRecorder() { |
| 109 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) |
| 110 return; |
| 107 m_graphicsContext.getPaintController().endItem<EndClipDisplayItem>( | 111 m_graphicsContext.getPaintController().endItem<EndClipDisplayItem>( |
| 108 m_layoutObject, DisplayItem::clipTypeToEndClipType(m_clipType)); | 112 m_layoutObject, DisplayItem::clipTypeToEndClipType(m_clipType)); |
| 109 } | 113 } |
| 110 | 114 |
| 111 } // namespace blink | 115 } // namespace blink |
| OLD | NEW |