OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "config.h" | 5 #include "config.h" |
6 #include "core/paint/RoundedInnerRectClipper.h" | 6 #include "core/paint/RoundedInnerRectClipper.h" |
7 | 7 |
8 #include "core/layout/LayoutBox.h" | 8 #include "core/layout/LayoutBox.h" |
9 #include "core/paint/PaintInfo.h" | 9 #include "core/paint/PaintInfo.h" |
10 #include "platform/graphics/paint/ClipDisplayItem.h" | 10 #include "platform/graphics/paint/ClipDisplayItem.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 roundedRectClips.append(FloatRoundedRect(topCorner, topCornerRadii))
; | 42 roundedRectClips.append(FloatRoundedRect(topCorner, topCornerRadii))
; |
43 | 43 |
44 FloatRect bottomCorner(clipRect.rect().x(), rect.y().toFloat(), rect
.maxX() - clipRect.rect().x(), clipRect.rect().maxY() - rect.y().toFloat()); | 44 FloatRect bottomCorner(clipRect.rect().x(), rect.y().toFloat(), rect
.maxX() - clipRect.rect().x(), clipRect.rect().maxY() - rect.y().toFloat()); |
45 FloatRoundedRect::Radii bottomCornerRadii; | 45 FloatRoundedRect::Radii bottomCornerRadii; |
46 bottomCornerRadii.setBottomLeft(clipRect.radii().bottomLeft()); | 46 bottomCornerRadii.setBottomLeft(clipRect.radii().bottomLeft()); |
47 roundedRectClips.append(FloatRoundedRect(bottomCorner, bottomCornerR
adii)); | 47 roundedRectClips.append(FloatRoundedRect(bottomCorner, bottomCornerR
adii)); |
48 } | 48 } |
49 } | 49 } |
50 | 50 |
51 if (m_usePaintController) { | 51 if (m_usePaintController) { |
52 m_paintInfo.context->paintController().createAndAppend<ClipDisplayItem>(
layoutObject, m_clipType, LayoutRect::infiniteIntRect(), roundedRectClips); | 52 m_paintInfo.context.paintController().createAndAppend<ClipDisplayItem>(l
ayoutObject, m_clipType, LayoutRect::infiniteIntRect(), roundedRectClips); |
53 } else { | 53 } else { |
54 ClipDisplayItem clipDisplayItem(layoutObject, m_clipType, LayoutRect::in
finiteIntRect(), roundedRectClips); | 54 ClipDisplayItem clipDisplayItem(layoutObject, m_clipType, LayoutRect::in
finiteIntRect(), roundedRectClips); |
55 clipDisplayItem.replay(*paintInfo.context); | 55 clipDisplayItem.replay(paintInfo.context); |
56 } | 56 } |
57 } | 57 } |
58 | 58 |
59 RoundedInnerRectClipper::~RoundedInnerRectClipper() | 59 RoundedInnerRectClipper::~RoundedInnerRectClipper() |
60 { | 60 { |
61 DisplayItem::Type endType = DisplayItem::clipTypeToEndClipType(m_clipType); | 61 DisplayItem::Type endType = DisplayItem::clipTypeToEndClipType(m_clipType); |
62 if (m_usePaintController) { | 62 if (m_usePaintController) { |
63 m_paintInfo.context->paintController().endItem<EndClipDisplayItem>(m_lay
outObject, endType); | 63 m_paintInfo.context.paintController().endItem<EndClipDisplayItem>(m_layo
utObject, endType); |
64 } else { | 64 } else { |
65 EndClipDisplayItem endClipDisplayItem(m_layoutObject, endType); | 65 EndClipDisplayItem endClipDisplayItem(m_layoutObject, endType); |
66 endClipDisplayItem.replay(*m_paintInfo.context); | 66 endClipDisplayItem.replay(m_paintInfo.context); |
67 } | 67 } |
68 } | 68 } |
69 | 69 |
70 } // namespace blink | 70 } // namespace blink |
OLD | NEW |