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

Unified Diff: third_party/WebKit/Source/core/paint/LayerClipRecorder.cpp

Issue 2923683002: Fix nested border radius with composited child. (Closed)
Patch Set: Split tests, check layer sizes, document Created 3 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/paint/LayerClipRecorder.cpp
diff --git a/third_party/WebKit/Source/core/paint/LayerClipRecorder.cpp b/third_party/WebKit/Source/core/paint/LayerClipRecorder.cpp
index db164f4d81934121106505cd1228db3ff31124bd..9befa968421e9ee938330010317d20c598a76444 100644
--- a/third_party/WebKit/Source/core/paint/LayerClipRecorder.cpp
+++ b/third_party/WebKit/Source/core/paint/LayerClipRecorder.cpp
@@ -29,10 +29,13 @@ LayerClipRecorder::LayerClipRecorder(GraphicsContext& graphics_context,
if (RuntimeEnabledFeatures::SlimmingPaintV2Enabled())
return;
IntRect snapped_clip_rect = PixelSnappedIntRect(clip_rect.Rect());
+ bool painting_masks =
+ (paint_flags & kPaintLayerPaintingChildClippingMaskPhase ||
+ paint_flags & kPaintLayerPaintingAncestorClippingMaskPhase);
Vector<FloatRoundedRect> rounded_rects;
- if (clip_root && clip_rect.HasRadius()) {
- CollectRoundedRectClips(*layout_object.Layer(), clip_root, graphics_context,
- fragment_offset, paint_flags, rule, rounded_rects);
+ if (clip_root && (clip_rect.HasRadius() || painting_masks)) {
+ CollectRoundedRectClips(*layout_object.Layer(), clip_root, fragment_offset,
+ painting_masks, rule, rounded_rects);
}
graphics_context_.GetPaintController().CreateAndAppend<ClipDisplayItem>(
@@ -59,9 +62,8 @@ static bool InContainingBlockChain(PaintLayer* start_layer,
void LayerClipRecorder::CollectRoundedRectClips(
PaintLayer& paint_layer,
const PaintLayer* clip_root,
- GraphicsContext& context,
- const LayoutPoint& fragment_offset,
- PaintLayerFlags paint_flags,
+ const LayoutPoint& offset_within_layer,
+ bool cross_composited_scrollers,
BorderRadiusClippingRule rule,
Vector<FloatRoundedRect>& rounded_rect_clips) {
// If the clip rect has been tainted by a border radius, then we have to walk
@@ -78,15 +80,13 @@ void LayerClipRecorder::CollectRoundedRectClips(
// frame to update the clip. We only want to make sure that the mask layer
// is properly clipped so that it can in turn clip the scrolled contents in
// the compositor.
- if (layer->NeedsCompositedScrolling() &&
- !(paint_flags & kPaintLayerPaintingChildClippingMaskPhase ||
- paint_flags & kPaintLayerPaintingAncestorClippingMaskPhase))
+ if (!cross_composited_scrollers && layer->NeedsCompositedScrolling())
break;
if (layer->GetLayoutObject().HasOverflowClip() &&
layer->GetLayoutObject().Style()->HasBorderRadius() &&
InContainingBlockChain(&paint_layer, layer)) {
- LayoutPoint delta(fragment_offset);
+ LayoutPoint delta(offset_within_layer);
layer->ConvertToLayerCoords(clip_root, delta);
// The PaintLayer's size is pixel-snapped if it is a LayoutBox. We can't
« no previous file with comments | « third_party/WebKit/Source/core/paint/LayerClipRecorder.h ('k') | third_party/WebKit/Source/core/paint/PaintLayer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698