| 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/ClipRect.h" | 7 #include "core/layout/ClipRect.h" |
| 8 #include "core/layout/LayoutView.h" | 8 #include "core/layout/LayoutView.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" |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 inContainingBlockChain(&paintLayer, layer)) { | 86 inContainingBlockChain(&paintLayer, layer)) { |
| 87 LayoutPoint delta(fragmentOffset); | 87 LayoutPoint delta(fragmentOffset); |
| 88 layer->convertToLayerCoords(clipRoot, delta); | 88 layer->convertToLayerCoords(clipRoot, delta); |
| 89 | 89 |
| 90 // The PaintLayer's size is pixel-snapped if it is a LayoutBox. We can't | 90 // The PaintLayer's size is pixel-snapped if it is a LayoutBox. We can't |
| 91 // use a pre-snapped border rect for clipping, since | 91 // use a pre-snapped border rect for clipping, since |
| 92 // getRoundedInnerBorderFor assumes it has not been snapped yet. | 92 // getRoundedInnerBorderFor assumes it has not been snapped yet. |
| 93 LayoutSize size(layer->layoutBox() | 93 LayoutSize size(layer->layoutBox() |
| 94 ? toLayoutBox(layer->layoutObject())->size() | 94 ? toLayoutBox(layer->layoutObject())->size() |
| 95 : LayoutSize(layer->size())); | 95 : LayoutSize(layer->size())); |
| 96 roundedRectClips.append( | 96 roundedRectClips.push_back( |
| 97 layer->layoutObject()->style()->getRoundedInnerBorderFor( | 97 layer->layoutObject()->style()->getRoundedInnerBorderFor( |
| 98 LayoutRect(delta, size))); | 98 LayoutRect(delta, size))); |
| 99 } | 99 } |
| 100 | 100 |
| 101 if (layer == clipRoot) | 101 if (layer == clipRoot) |
| 102 break; | 102 break; |
| 103 } | 103 } |
| 104 } | 104 } |
| 105 | 105 |
| 106 LayerClipRecorder::~LayerClipRecorder() { | 106 LayerClipRecorder::~LayerClipRecorder() { |
| 107 m_graphicsContext.getPaintController().endItem<EndClipDisplayItem>( | 107 m_graphicsContext.getPaintController().endItem<EndClipDisplayItem>( |
| 108 m_layoutObject, DisplayItem::clipTypeToEndClipType(m_clipType)); | 108 m_layoutObject, DisplayItem::clipTypeToEndClipType(m_clipType)); |
| 109 } | 109 } |
| 110 | 110 |
| 111 } // namespace blink | 111 } // namespace blink |
| OLD | NEW |