Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(88)

Side by Side Diff: third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp

Issue 2825743002: Fix clipping of squashed sibling layers with border radius masks (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/compositing/nested-border-radius-composited-child-expected.txt ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 956 matching lines...) Expand 10 before | Expand all | Expand 10 after
967 DisplayItem::Type clip_type = 967 DisplayItem::Type clip_type =
968 DisplayItem::PaintPhaseToClipLayerFragmentType(phase); 968 DisplayItem::PaintPhaseToClipLayerFragmentType(phase);
969 LayerClipRecorder::BorderRadiusClippingRule clipping_rule; 969 LayerClipRecorder::BorderRadiusClippingRule clipping_rule;
970 switch (phase) { 970 switch (phase) {
971 case kPaintPhaseSelfBlockBackgroundOnly: // Background painting will 971 case kPaintPhaseSelfBlockBackgroundOnly: // Background painting will
972 // handle clipping to self. 972 // handle clipping to self.
973 case kPaintPhaseSelfOutlineOnly: 973 case kPaintPhaseSelfOutlineOnly:
974 case kPaintPhaseMask: // Mask painting will handle clipping to self. 974 case kPaintPhaseMask: // Mask painting will handle clipping to self.
975 clipping_rule = LayerClipRecorder::kDoNotIncludeSelfForBorderRadius; 975 clipping_rule = LayerClipRecorder::kDoNotIncludeSelfForBorderRadius;
976 break; 976 break;
977 case kPaintPhaseClippingMask:
978 if (paint_flags & kPaintLayerPaintingAncestorClippingMaskPhase) {
979 // The ancestor is the thing that needs to clip, so do not include
980 // this layer's clips.
981 clipping_rule = LayerClipRecorder::kDoNotIncludeSelfForBorderRadius;
982 break;
983 }
977 default: 984 default:
978 clipping_rule = LayerClipRecorder::kIncludeSelfForBorderRadius; 985 clipping_rule = LayerClipRecorder::kIncludeSelfForBorderRadius;
979 break; 986 break;
980 } 987 }
981 988
982 // TODO(schenney): Nested border-radius clips are not applied to composited 989 // TODO(schenney): Nested border-radius clips are not applied to composited
983 // children, probably due to an incorrect clipRoot. 990 // children, probably due to an incorrect clipRoot.
984 // https://bugs.chromium.org/p/chromium/issues/detail?id=672561 991 // https://bugs.chromium.org/p/chromium/issues/detail?id=672561
985 clip_recorder.emplace(context, paint_layer_.GetLayoutObject(), clip_type, 992 clip_recorder.emplace(context, paint_layer_.GetLayoutObject(), clip_type,
986 clip_rect, painting_info.root_layer, 993 clip_rect, painting_info.root_layer,
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
1228 context, layout_object, kPaintPhaseClippingMask)) 1235 context, layout_object, kPaintPhaseClippingMask))
1229 return; 1236 return;
1230 1237
1231 IntRect snapped_clip_rect = PixelSnappedIntRect(clip_rect.Rect()); 1238 IntRect snapped_clip_rect = PixelSnappedIntRect(clip_rect.Rect());
1232 LayoutObjectDrawingRecorder drawing_recorder( 1239 LayoutObjectDrawingRecorder drawing_recorder(
1233 context, layout_object, kPaintPhaseClippingMask, snapped_clip_rect); 1240 context, layout_object, kPaintPhaseClippingMask, snapped_clip_rect);
1234 context.FillRect(snapped_clip_rect, Color::kBlack); 1241 context.FillRect(snapped_clip_rect, Color::kBlack);
1235 } 1242 }
1236 1243
1237 } // namespace blink 1244 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/compositing/nested-border-radius-composited-child-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698