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

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

Issue 2830013007: [blink] Skip ancestor clip in PaintLayerPainter for squashed layers. (Closed)
Patch Set: aye aye sir 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/compositing/squashing/squash-transformed-with-clip-expected.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..7817508e0f0baa41bd67ae0d89099f6e0cf975f7 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 works around a bug in squashed-layer painting.
+ // 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,
« no previous file with comments | « third_party/WebKit/LayoutTests/compositing/squashing/squash-transformed-with-clip-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698