| 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/BoxClipper.h" | 5 #include "core/paint/BoxClipper.h" |
| 6 | 6 |
| 7 #include "core/layout/LayoutBox.h" | 7 #include "core/layout/LayoutBox.h" |
| 8 #include "core/layout/svg/LayoutSVGRoot.h" | 8 #include "core/layout/svg/LayoutSVGRoot.h" |
| 9 #include "core/paint/ObjectPaintProperties.h" | 9 #include "core/paint/ObjectPaintProperties.h" |
| 10 #include "core/paint/PaintInfo.h" | 10 #include "core/paint/PaintInfo.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 : m_box(box), | 33 : m_box(box), |
| 34 m_paintInfo(paintInfo), | 34 m_paintInfo(paintInfo), |
| 35 m_clipType(DisplayItem::kUninitializedType) { | 35 m_clipType(DisplayItem::kUninitializedType) { |
| 36 DCHECK(m_paintInfo.phase != PaintPhaseSelfBlockBackgroundOnly && | 36 DCHECK(m_paintInfo.phase != PaintPhaseSelfBlockBackgroundOnly && |
| 37 m_paintInfo.phase != PaintPhaseSelfOutlineOnly); | 37 m_paintInfo.phase != PaintPhaseSelfOutlineOnly); |
| 38 | 38 |
| 39 if (m_paintInfo.phase == PaintPhaseMask) | 39 if (m_paintInfo.phase == PaintPhaseMask) |
| 40 return; | 40 return; |
| 41 | 41 |
| 42 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { | 42 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { |
| 43 const auto* objectProperties = m_box.objectPaintProperties(); | 43 const auto* objectProperties = m_box.paintProperties(); |
| 44 if (objectProperties && objectProperties->overflowClip()) { | 44 if (objectProperties && objectProperties->overflowClip()) { |
| 45 PaintChunkProperties properties( | 45 PaintChunkProperties properties( |
| 46 paintInfo.context.getPaintController().currentPaintChunkProperties()); | 46 paintInfo.context.getPaintController().currentPaintChunkProperties()); |
| 47 properties.clip = objectProperties->overflowClip(); | 47 properties.clip = objectProperties->overflowClip(); |
| 48 m_scopedClipProperty.emplace(paintInfo.context.getPaintController(), box, | 48 m_scopedClipProperty.emplace(paintInfo.context.getPaintController(), box, |
| 49 paintInfo.displayItemTypeForClipping(), | 49 paintInfo.displayItemTypeForClipping(), |
| 50 properties); | 50 properties); |
| 51 } | 51 } |
| 52 return; | 52 return; |
| 53 } | 53 } |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 BoxClipper::~BoxClipper() { | 97 BoxClipper::~BoxClipper() { |
| 98 if (m_clipType == DisplayItem::kUninitializedType) | 98 if (m_clipType == DisplayItem::kUninitializedType) |
| 99 return; | 99 return; |
| 100 | 100 |
| 101 DCHECK(boxNeedsClip(m_box)); | 101 DCHECK(boxNeedsClip(m_box)); |
| 102 m_paintInfo.context.getPaintController().endItem<EndClipDisplayItem>( | 102 m_paintInfo.context.getPaintController().endItem<EndClipDisplayItem>( |
| 103 m_box, DisplayItem::clipTypeToEndClipType(m_clipType)); | 103 m_box, DisplayItem::clipTypeToEndClipType(m_clipType)); |
| 104 } | 104 } |
| 105 | 105 |
| 106 } // namespace blink | 106 } // namespace blink |
| OLD | NEW |