Commit bd7e63a3 authored by Chris Harrelson's avatar Chris Harrelson Committed by Commit Bot

Enable GeometryMapper for composited bounds.

This use cases happens after the pre-paint tree walk, so is
safe for GeometryMapper.

Change-Id: I728ea302c026b18d8dacf4a39c177c6f13068da4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2347251Reviewed-by: default avatarXianzhu Wang <wangxianzhu@chromium.org>
Commit-Queue: Chris Harrelson <chrishtr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#796651}
parent 9da90a7c
......@@ -2703,6 +2703,8 @@ PhysicalRect PaintLayer::BoundingBoxForCompositingInternal(
const PaintLayer& composited_layer,
const PaintLayer* stacking_parent,
CalculateBoundsOptions options) const {
DCHECK_GE(GetLayoutObject().GetDocument().Lifecycle().GetState(),
DocumentLifecycle::kInPrePaint);
if (!IsSelfPaintingLayer())
return PhysicalRect();
......@@ -2731,8 +2733,17 @@ PhysicalRect PaintLayer::BoundingBoxForCompositingInternal(
// If there is a clip applied by an ancestor to this PaintLayer but below or
// equal to |ancestorLayer|, apply that clip.
PhysicalRect result = Clipper(GeometryMapperOption::kDoNotUseGeometryMapper)
.LocalClipRect(composited_layer);
//
// There are two callsites to BoundingBoxForCompositingInternal: one in
// pre-paint for filter bouonding boxes, and one in compositing. The former
// can't use GeometryMapper yet because of circularity between
// LocalBorderBoxProperties and filters being set on the property trees.
PhysicalRect result =
Clipper((GetLayoutObject().GetDocument().Lifecycle().GetState() ==
DocumentLifecycle::kInCompositingAssignmentsUpdate)
? GeometryMapperOption::kUseGeometryMapper
: GeometryMapperOption::kDoNotUseGeometryMapper)
.LocalClipRect(composited_layer);
result.Intersect(LocalBoundingBox());
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment