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

Unified Diff: third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp

Issue 2835783002: Change painting root for squashed layers to the composting container (Closed)
Patch Set: 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 | « no previous file | 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/layout/compositing/CompositedLayerMapping.cpp
diff --git a/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp b/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp
index 445b2ad8364fdaf98ac5f7ef66b7d2379952c3da..d150629c601a1795f4fa36f6682c288423b503df 100644
--- a/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp
+++ b/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp
@@ -1020,6 +1020,10 @@ void CompositedLayerMapping::UpdateSquashingLayerGeometry(
squashing_layer->SetPosition(squash_layer_bounds.Location());
squashing_layer->SetSize(FloatSize(squash_layer_bounds.Size()));
+ LayoutSize offset_from_layout_object_exclude_subpixel_accumulation = squash_layer_origin_in_compositing_container_space - compositing_container->SubpixelAccumulation();
+ DCHECK(offset_from_layout_object_exclude_subpixel_accumulation.Fraction().IsZero());
+ DCHECK_EQ(owning_layer_.EnclosingLayerWithCompositedLayerMapping(kExcludeSelf), compositing_container);
+ squashing_layer->SetOffsetFromLayoutObject(RoundedIntSize(offset_from_layout_object_exclude_subpixel_accumulation), GraphicsLayer::kDontSetNeedsDisplay);
*offset_from_transformed_ancestor =
compositing_container_offset_from_transformed_ancestor;
@@ -3004,7 +3008,13 @@ void CompositedLayerMapping::DoPaintTask(
const IntRect& clip /* In the coords of rootLayer */) const {
FontCachePurgePreventer font_cache_purge_preventer;
+ PaintLayer* painting_root = paint_info.paint_layer;
IntSize offset = paint_info.offset_from_layout_object;
+ if (paint_info.paint_layer->GetCompositingState() == kPaintsIntoGroupedBacking) {
+ painting_root = owning_layer_.EnclosingLayerWithCompositedLayerMapping(kExcludeSelf);
+ offset = graphics_layer.OffsetFromLayoutObject();
+ }
+
AffineTransform translation;
translation.Translate(-offset.Width(), -offset.Height());
TransformRecorder transform_recorder(context, graphics_layer, translation);
@@ -3016,29 +3026,29 @@ void CompositedLayerMapping::DoPaintTask(
if (paint_layer_flags & (kPaintLayerPaintingOverflowContents |
kPaintLayerPaintingAncestorClippingMaskPhase)) {
dirty_rect.Move(
- RoundedIntSize(paint_info.paint_layer->SubpixelAccumulation()));
+ RoundedIntSize(painting_root->SubpixelAccumulation()));
} else {
LayoutRect bounds = paint_info.composited_bounds;
- bounds.Move(paint_info.paint_layer->SubpixelAccumulation());
+ bounds.Move(painting_root->SubpixelAccumulation());
dirty_rect.Intersect(PixelSnappedIntRect(bounds));
}
#if DCHECK_IS_ON()
if (!GetLayoutObject().View()->GetFrame() ||
!GetLayoutObject().View()->GetFrame()->ShouldThrottleRendering())
- paint_info.paint_layer->GetLayoutObject().AssertSubtreeIsLaidOut();
+ painting_root->GetLayoutObject().AssertSubtreeIsLaidOut();
#endif
float device_scale_factor = blink::DeviceScaleFactorDeprecated(
- paint_info.paint_layer->GetLayoutObject().GetFrame());
+ painting_root->GetLayoutObject().GetFrame());
context.SetDeviceScaleFactor(device_scale_factor);
if (paint_info.paint_layer->GetCompositingState() !=
kPaintsIntoGroupedBacking) {
// FIXME: GraphicsLayers need a way to split for multicol.
PaintLayerPaintingInfo painting_info(
- paint_info.paint_layer, LayoutRect(dirty_rect), kGlobalPaintNormalPhase,
- paint_info.paint_layer->SubpixelAccumulation());
+ painting_root, LayoutRect(dirty_rect), kGlobalPaintNormalPhase,
+ painting_root->SubpixelAccumulation());
PaintLayerPainter(*paint_info.paint_layer)
.PaintLayerContents(context, painting_info, paint_layer_flags);
@@ -3049,8 +3059,8 @@ void CompositedLayerMapping::DoPaintTask(
paint_layer_flags | kPaintLayerPaintingOverlayScrollbars);
} else {
PaintLayerPaintingInfo painting_info(
- paint_info.paint_layer, LayoutRect(dirty_rect), kGlobalPaintNormalPhase,
- paint_info.paint_layer->SubpixelAccumulation());
+ painting_root, LayoutRect(dirty_rect), kGlobalPaintNormalPhase,
+ painting_root->SubpixelAccumulation());
// PaintLayer::paintLayer assumes that the caller clips to the passed rect.
// Squashed layers need to do this clipping in software, since there is no
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698