Chromium Code Reviews| 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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 64 | 64 |
| 65 // The PaintLayer's size is pixel-snapped if it is a LayoutBox. We c an't use a pre-snapped border rect for clipping, since getRoundedInnerBorderFor assumes | 65 // The PaintLayer's size is pixel-snapped if it is a LayoutBox. We c an't use a pre-snapped border rect for clipping, since getRoundedInnerBorderFor assumes |
| 66 // it has not been snapped yet. | 66 // it has not been snapped yet. |
| 67 LayoutSize size(layer->layoutBox() ? toLayoutBox(layer->layoutObject ())->size() : LayoutSize(layer->size())); | 67 LayoutSize size(layer->layoutBox() ? toLayoutBox(layer->layoutObject ())->size() : LayoutSize(layer->size())); |
| 68 roundedRectClips.append(layer->layoutObject()->style()->getRoundedIn nerBorderFor(LayoutRect(delta, size))); | 68 roundedRectClips.append(layer->layoutObject()->style()->getRoundedIn nerBorderFor(LayoutRect(delta, size))); |
| 69 } | 69 } |
| 70 | 70 |
| 71 if (layer == localPaintingInfo.rootLayer) | 71 if (layer == localPaintingInfo.rootLayer) |
| 72 break; | 72 break; |
| 73 } | 73 } |
| 74 | |
| 75 // TODO(schenney): Not right, but hack to get something that applies a radiu s then figure out the correct way to do it. | |
|
chrishtr
2016/10/21 23:15:08
This is to get the right positioning relative to t
Stephen Chennney
2016/10/24 20:15:27
Yes, the clipping container is in one layer (the p
| |
| 76 if (paintFlags & PaintLayerPaintingAncestorClippingMaskPhase) { | |
| 77 const LayoutObject* clippingContainer = paintLayer.clippingContainer(); | |
| 78 LayoutPoint fragmentDelta(fragmentOffset); | |
| 79 paintLayer.convertToLayerCoords(paintLayer.root(), fragmentDelta); | |
| 80 LayoutPoint containerDelta; | |
| 81 clippingContainer->enclosingLayer()->convertToLayerCoords(clippingContai ner->enclosingLayer()->root(), containerDelta); | |
| 82 LayoutPoint offset(containerDelta.x() - fragmentDelta.x(), containerDelt a.y() - fragmentDelta.y()); | |
| 83 LayoutSize size(toLayoutBox(clippingContainer) ? toLayoutBox(clippingCon tainer)->size() : LayoutSize(clippingContainer->enclosingLayer()->size())); | |
| 84 roundedRectClips.append(clippingContainer->style()->getRoundedInnerBorde rFor(LayoutRect(offset, size))); | |
| 85 } | |
| 74 } | 86 } |
| 75 | 87 |
| 76 LayerClipRecorder::~LayerClipRecorder() | 88 LayerClipRecorder::~LayerClipRecorder() |
| 77 { | 89 { |
| 78 m_graphicsContext.getPaintController().endItem<EndClipDisplayItem>(m_layoutO bject, DisplayItem::clipTypeToEndClipType(m_clipType)); | 90 m_graphicsContext.getPaintController().endItem<EndClipDisplayItem>(m_layoutO bject, DisplayItem::clipTypeToEndClipType(m_clipType)); |
| 79 } | 91 } |
| 80 | 92 |
| 81 } // namespace blink | 93 } // namespace blink |
| OLD | NEW |