| 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/PaintLayerPainter.h" | 5 #include "core/paint/PaintLayerPainter.h" |
| 6 | 6 |
| 7 #include "core/frame/LocalFrame.h" | 7 #include "core/frame/LocalFrame.h" |
| 8 #include "core/layout/LayoutView.h" | 8 #include "core/layout/LayoutView.h" |
| 9 #include "core/paint/ClipPathClipper.h" | 9 #include "core/paint/ClipPathClipper.h" |
| 10 #include "core/paint/FilterPainter.h" | 10 #include "core/paint/FilterPainter.h" |
| (...skipping 935 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 946 DisplayItem::Type clipType = | 946 DisplayItem::Type clipType = |
| 947 DisplayItem::paintPhaseToClipLayerFragmentType(phase); | 947 DisplayItem::paintPhaseToClipLayerFragmentType(phase); |
| 948 LayerClipRecorder::BorderRadiusClippingRule clippingRule; | 948 LayerClipRecorder::BorderRadiusClippingRule clippingRule; |
| 949 switch (phase) { | 949 switch (phase) { |
| 950 case PaintPhaseSelfBlockBackgroundOnly: // Background painting will | 950 case PaintPhaseSelfBlockBackgroundOnly: // Background painting will |
| 951 // handle clipping to self. | 951 // handle clipping to self. |
| 952 case PaintPhaseSelfOutlineOnly: | 952 case PaintPhaseSelfOutlineOnly: |
| 953 case PaintPhaseMask: // Mask painting will handle clipping to self. | 953 case PaintPhaseMask: // Mask painting will handle clipping to self. |
| 954 clippingRule = LayerClipRecorder::DoNotIncludeSelfForBorderRadius; | 954 clippingRule = LayerClipRecorder::DoNotIncludeSelfForBorderRadius; |
| 955 break; | 955 break; |
| 956 case kPaintPhaseClippingMask: |
| 957 if (paint_flags & kPaintLayerPaintingAncestorClippingMaskPhase) { |
| 958 // The ancestor is the thing that needs to clip, so do not include |
| 959 // this layer's clips. |
| 960 clipping_rule = LayerClipRecorder::kDoNotIncludeSelfForBorderRadius; |
| 961 break; |
| 962 } |
| 956 default: | 963 default: |
| 957 clippingRule = LayerClipRecorder::IncludeSelfForBorderRadius; | 964 clippingRule = LayerClipRecorder::IncludeSelfForBorderRadius; |
| 958 break; | 965 break; |
| 959 } | 966 } |
| 960 | 967 |
| 961 // TODO(schenney): Nested border-radius clips are not applied to composited | 968 // TODO(schenney): Nested border-radius clips are not applied to composited |
| 962 // children, probably due to an incorrect clipRoot. | 969 // children, probably due to an incorrect clipRoot. |
| 963 // https://bugs.chromium.org/p/chromium/issues/detail?id=672561 | 970 // https://bugs.chromium.org/p/chromium/issues/detail?id=672561 |
| 964 clipRecorder.emplace(context, m_paintLayer.layoutObject(), clipType, | 971 clipRecorder.emplace(context, m_paintLayer.layoutObject(), clipType, |
| 965 clipRect, paintingInfo.rootLayer, | 972 clipRect, paintingInfo.rootLayer, |
| (...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1208 context, layoutObject, PaintPhaseClippingMask)) | 1215 context, layoutObject, PaintPhaseClippingMask)) |
| 1209 return; | 1216 return; |
| 1210 | 1217 |
| 1211 IntRect snappedClipRect = pixelSnappedIntRect(clipRect.rect()); | 1218 IntRect snappedClipRect = pixelSnappedIntRect(clipRect.rect()); |
| 1212 LayoutObjectDrawingRecorder drawingRecorder( | 1219 LayoutObjectDrawingRecorder drawingRecorder( |
| 1213 context, layoutObject, PaintPhaseClippingMask, snappedClipRect); | 1220 context, layoutObject, PaintPhaseClippingMask, snappedClipRect); |
| 1214 context.fillRect(snappedClipRect, Color::black); | 1221 context.fillRect(snappedClipRect, Color::black); |
| 1215 } | 1222 } |
| 1216 | 1223 |
| 1217 } // namespace blink | 1224 } // namespace blink |
| OLD | NEW |