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

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

Issue 2923683002: Fix nested border radius with composited child. (Closed)
Patch Set: Add tests and fix tests 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 f790068dd543b67088ff11293962fa1801ee73bb..7d8cebd6b7f943ca4250dcb3d969287ea9f35044 100644
--- a/third_party/WebKit/Source/core/paint/LayerClipRecorder.cpp
+++ b/third_party/WebKit/Source/core/paint/LayerClipRecorder.cpp
@@ -30,7 +30,7 @@ LayerClipRecorder::LayerClipRecorder(GraphicsContext& graphics_context,
return;
IntRect snapped_clip_rect = PixelSnappedIntRect(clip_rect.Rect());
Vector<FloatRoundedRect> rounded_rects;
- if (clip_root && clip_rect.HasRadius()) {
+ if (clip_root) {
CollectRoundedRectClips(*layout_object.Layer(), clip_root, graphics_context,
fragment_offset, paint_flags, rule, rounded_rects);
}
@@ -68,6 +68,10 @@ void LayerClipRecorder::CollectRoundedRectClips(
// up our layer chain applying the clips from any layers with overflow. The
// condition for being able to apply these clips is that the overflow object
// be in our containing block chain so we check that also.
+#ifndef NDEBUG
+ LOG(INFO) << "CollectRoundedRectClips layer: " << &paint_layer;
+ LOG(INFO) << "CollectRoundedRectClips clip_root: " << clip_root;
+#endif
for (PaintLayer* layer = rule == kIncludeSelfForBorderRadius
? &paint_layer
: paint_layer.Parent();
@@ -78,9 +82,11 @@ 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.
+ bool paintingAncestorMask =
+ paint_flags & kPaintLayerPaintingAncestorClippingMaskPhase;
if (layer->NeedsCompositedScrolling() &&
!(paint_flags & kPaintLayerPaintingChildClippingMaskPhase ||
- paint_flags & kPaintLayerPaintingAncestorClippingMaskPhase))
+ paintingAncestorMask))
break;
if (layer->GetLayoutObject().HasOverflowClip() &&
@@ -95,9 +101,14 @@ void LayerClipRecorder::CollectRoundedRectClips(
LayoutSize size(layer->GetLayoutBox()
? ToLayoutBox(layer->GetLayoutObject()).Size()
: LayoutSize(layer->size()));
- rounded_rect_clips.push_back(
+ FloatRoundedRect clip_rect =
layer->GetLayoutObject().Style()->GetRoundedInnerBorderFor(
- LayoutRect(delta, size)));
+ LayoutRect(delta, size));
+ rounded_rect_clips.push_back(clip_rect);
+#ifndef NDEBUG
+ LOG(INFO) << "Adding rect for layer " << layer << " "
+ << clip_rect.ToString();
+#endif
}
if (layer == clip_root)

Powered by Google App Engine
This is Rietveld 408576698