| 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 946 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 957 DisplayItem::Type clip_type = | 957 DisplayItem::Type clip_type = |
| 958 DisplayItem::PaintPhaseToClipLayerFragmentType(phase); | 958 DisplayItem::PaintPhaseToClipLayerFragmentType(phase); |
| 959 LayerClipRecorder::BorderRadiusClippingRule clipping_rule; | 959 LayerClipRecorder::BorderRadiusClippingRule clipping_rule; |
| 960 switch (phase) { | 960 switch (phase) { |
| 961 case kPaintPhaseSelfBlockBackgroundOnly: // Background painting will | 961 case kPaintPhaseSelfBlockBackgroundOnly: // Background painting will |
| 962 // handle clipping to self. | 962 // handle clipping to self. |
| 963 case kPaintPhaseSelfOutlineOnly: | 963 case kPaintPhaseSelfOutlineOnly: |
| 964 case kPaintPhaseMask: // Mask painting will handle clipping to self. | 964 case kPaintPhaseMask: // Mask painting will handle clipping to self. |
| 965 clipping_rule = LayerClipRecorder::kDoNotIncludeSelfForBorderRadius; | 965 clipping_rule = LayerClipRecorder::kDoNotIncludeSelfForBorderRadius; |
| 966 break; | 966 break; |
| 967 case kPaintPhaseClippingMask: |
| 968 if (paint_flags & kPaintLayerPaintingAncestorClippingMaskPhase) { |
| 969 // The ancestor is the thing that needs to clip, so do not include |
| 970 // this layer's clips. |
| 971 clipping_rule = LayerClipRecorder::kDoNotIncludeSelfForBorderRadius; |
| 972 break; |
| 973 } |
| 967 default: | 974 default: |
| 968 clipping_rule = LayerClipRecorder::kIncludeSelfForBorderRadius; | 975 clipping_rule = LayerClipRecorder::kIncludeSelfForBorderRadius; |
| 969 break; | 976 break; |
| 970 } | 977 } |
| 971 | 978 |
| 972 // TODO(schenney): Nested border-radius clips are not applied to composited | 979 // TODO(schenney): Nested border-radius clips are not applied to composited |
| 973 // children, probably due to an incorrect clipRoot. | 980 // children, probably due to an incorrect clipRoot. |
| 974 // https://bugs.chromium.org/p/chromium/issues/detail?id=672561 | 981 // https://bugs.chromium.org/p/chromium/issues/detail?id=672561 |
| 975 clip_recorder.emplace(context, paint_layer_.GetLayoutObject(), clip_type, | 982 clip_recorder.emplace(context, paint_layer_.GetLayoutObject(), clip_type, |
| 976 clip_rect, painting_info.root_layer, | 983 clip_rect, painting_info.root_layer, |
| (...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1218 context, layout_object, kPaintPhaseClippingMask)) | 1225 context, layout_object, kPaintPhaseClippingMask)) |
| 1219 return; | 1226 return; |
| 1220 | 1227 |
| 1221 IntRect snapped_clip_rect = PixelSnappedIntRect(clip_rect.Rect()); | 1228 IntRect snapped_clip_rect = PixelSnappedIntRect(clip_rect.Rect()); |
| 1222 LayoutObjectDrawingRecorder drawing_recorder( | 1229 LayoutObjectDrawingRecorder drawing_recorder( |
| 1223 context, layout_object, kPaintPhaseClippingMask, snapped_clip_rect); | 1230 context, layout_object, kPaintPhaseClippingMask, snapped_clip_rect); |
| 1224 context.FillRect(snapped_clip_rect, Color::kBlack); | 1231 context.FillRect(snapped_clip_rect, Color::kBlack); |
| 1225 } | 1232 } |
| 1226 | 1233 |
| 1227 } // namespace blink | 1234 } // namespace blink |
| OLD | NEW |