Chromium Code Reviews| 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 2d0b917413a35611db9079fff8995dca642b36f9..585530cf54dc3e6dbe1bda30289e2f8526e4594c 100644 |
| --- a/third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp |
| +++ b/third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp |
| @@ -764,7 +764,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/25 22:11:04
Nit: please change to "This works around a bug in
trchen
2017/04/25 23:16:00
Done.
|
| + // 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, |