| 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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 conservativeClipRect.move(m_box.scrolledContentOffset()); | 82 conservativeClipRect.move(m_box.scrolledContentOffset()); |
| 83 if (conservativeClipRect.contains(contentsVisualOverflow)) | 83 if (conservativeClipRect.contains(contentsVisualOverflow)) |
| 84 return; | 84 return; |
| 85 } | 85 } |
| 86 | 86 |
| 87 if (!m_paintInfo.context.getPaintController() | 87 if (!m_paintInfo.context.getPaintController() |
| 88 .displayItemConstructionIsDisabled()) { | 88 .displayItemConstructionIsDisabled()) { |
| 89 m_clipType = m_paintInfo.displayItemTypeForClipping(); | 89 m_clipType = m_paintInfo.displayItemTypeForClipping(); |
| 90 Vector<FloatRoundedRect> roundedRects; | 90 Vector<FloatRoundedRect> roundedRects; |
| 91 if (hasBorderRadius) | 91 if (hasBorderRadius) |
| 92 roundedRects.append(clipRoundedRect); | 92 roundedRects.push_back(clipRoundedRect); |
| 93 m_paintInfo.context.getPaintController().createAndAppend<ClipDisplayItem>( | 93 m_paintInfo.context.getPaintController().createAndAppend<ClipDisplayItem>( |
| 94 m_box, m_clipType, pixelSnappedIntRect(clipRect), roundedRects); | 94 m_box, m_clipType, pixelSnappedIntRect(clipRect), roundedRects); |
| 95 } | 95 } |
| 96 } | 96 } |
| 97 | 97 |
| 98 BoxClipper::~BoxClipper() { | 98 BoxClipper::~BoxClipper() { |
| 99 if (m_clipType == DisplayItem::kUninitializedType) | 99 if (m_clipType == DisplayItem::kUninitializedType) |
| 100 return; | 100 return; |
| 101 | 101 |
| 102 DCHECK(boxNeedsClip(m_box)); | 102 DCHECK(boxNeedsClip(m_box)); |
| 103 m_paintInfo.context.getPaintController().endItem<EndClipDisplayItem>( | 103 m_paintInfo.context.getPaintController().endItem<EndClipDisplayItem>( |
| 104 m_box, DisplayItem::clipTypeToEndClipType(m_clipType)); | 104 m_box, DisplayItem::clipTypeToEndClipType(m_clipType)); |
| 105 } | 105 } |
| 106 | 106 |
| 107 } // namespace blink | 107 } // namespace blink |
| OLD | NEW |