Index: third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp |
diff --git a/third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp b/third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp |
index ef3a824876e161269e1d75877fb04f82af1a85d0..9efc8b1272c288486dd97f098b20d253c21ee64e 100644 |
--- a/third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp |
+++ b/third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp |
@@ -758,7 +758,17 @@ PaintResult PaintLayerPainter::PaintLayerWithTransform( |
ClipRect ancestor_background_clip_rect; |
if (!RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { |
- if (parent_layer) { |
+ if (painting_info.root_layer == &paint_layer_) { |
+ // This workaround a bug in squash layer painting. |
chrishtr
2017/04/23 17:13:44
Nit: "This works around a bug in squashed-layer pa
|
+ // Squashed layers paint into a backing in its compositing container's |
+ // space, but painting_info.root_layer points to the squashed layer |
+ // itself, thus PaintLayerClipper would return a clip rect in the |
+ // squashed layer's local space, instead of the backing's space. |
+ // Fortunately, CompositedLayerMapping::DoPaintTask already applied |
+ // appropriate ancestor clip for us, we can simply skip it. |
+ DCHECK_EQ(paint_layer_.GetCompositingState(), kPaintsIntoGroupedBacking); |
+ ancestor_background_clip_rect.SetRect(FloatClipRect()); |
+ } else if (parent_layer) { |
// Calculate the clip rectangle that the ancestors establish. |
ClipRectsContext clip_rects_context( |
painting_info.root_layer, |