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

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

Issue 2821733002: Fix clipping of squashed sibling layers with border radius masks (Closed)
Patch Set: Test will fail in SPv2 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
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 943 matching lines...) Expand 10 before | Expand all | Expand 10 after
954 Optional<LayerClipRecorder> clip_recorder; 954 Optional<LayerClipRecorder> clip_recorder;
955 if (clip_state != kHasClipped && painting_info.clip_to_dirty_rect && 955 if (clip_state != kHasClipped && painting_info.clip_to_dirty_rect &&
956 NeedsToClip(painting_info, clip_rect)) { 956 NeedsToClip(painting_info, clip_rect)) {
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:
965 case kPaintPhaseClippingMask:
chrishtr 2017/04/17 17:25:00 Your fix is generally correct, just a small error.
966 // Mask painting will handle clipping to self.
965 clipping_rule = LayerClipRecorder::kDoNotIncludeSelfForBorderRadius; 967 clipping_rule = LayerClipRecorder::kDoNotIncludeSelfForBorderRadius;
966 break; 968 break;
967 default: 969 default:
968 clipping_rule = LayerClipRecorder::kIncludeSelfForBorderRadius; 970 clipping_rule = LayerClipRecorder::kIncludeSelfForBorderRadius;
969 break; 971 break;
970 } 972 }
971 973
972 // TODO(schenney): Nested border-radius clips are not applied to composited 974 // TODO(schenney): Nested border-radius clips are not applied to composited
973 // children, probably due to an incorrect clipRoot. 975 // children, probably due to an incorrect clipRoot.
974 // https://bugs.chromium.org/p/chromium/issues/detail?id=672561 976 // https://bugs.chromium.org/p/chromium/issues/detail?id=672561
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
1218 context, layout_object, kPaintPhaseClippingMask)) 1220 context, layout_object, kPaintPhaseClippingMask))
1219 return; 1221 return;
1220 1222
1221 IntRect snapped_clip_rect = PixelSnappedIntRect(clip_rect.Rect()); 1223 IntRect snapped_clip_rect = PixelSnappedIntRect(clip_rect.Rect());
1222 LayoutObjectDrawingRecorder drawing_recorder( 1224 LayoutObjectDrawingRecorder drawing_recorder(
1223 context, layout_object, kPaintPhaseClippingMask, snapped_clip_rect); 1225 context, layout_object, kPaintPhaseClippingMask, snapped_clip_rect);
1224 context.FillRect(snapped_clip_rect, Color::kBlack); 1226 context.FillRect(snapped_clip_rect, Color::kBlack);
1225 } 1227 }
1226 1228
1227 } // namespace blink 1229 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698