Commit b65d8f5f authored by Joao Victor Almeida's avatar Joao Victor Almeida Committed by Chromium LUCI CQ

Change PL::ClippedClippedAbsoluteBoundingBox to pixel-snap

This makes the code when CompositingOptimizations is enabled match
behavior without it enabled.

Bug: 1115577
Change-Id: Iee854f63d135885e1ae5d02a5f76c1dd41eb51aa
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2613347
Commit-Queue: João Victor Almeida de Aguiar <joalmei@microsoft.com>
Reviewed-by: default avatarChris Harrelson <chrishtr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#841782}
parent 3f07c029
...@@ -1124,7 +1124,11 @@ const IntRect PaintLayer::ClippedAbsoluteBoundingBox() const { ...@@ -1124,7 +1124,11 @@ const IntRect PaintLayer::ClippedAbsoluteBoundingBox() const {
PhysicalRect mapping_rect = LocalBoundingBoxForCompositingOverlapTest(); PhysicalRect mapping_rect = LocalBoundingBoxForCompositingOverlapTest();
GetLayoutObject().MapToVisualRectInAncestorSpace( GetLayoutObject().MapToVisualRectInAncestorSpace(
GetLayoutObject().View(), mapping_rect, kUseGeometryMapper); GetLayoutObject().View(), mapping_rect, kUseGeometryMapper);
return EnclosingIntRect(mapping_rect); // We use PixelSnappedIntRect here to match the behavior in
// CIU:: UpdateAncestorDependentCompositingInputs, even though the code
// in UnclippedAbsoluteBoundingBox and its equivalent in
// CIU::UpdateAncestorDependentCompositingInputs uses EnclosingIntRect.
return PixelSnappedIntRect(mapping_rect);
} else { } else {
return GetAncestorDependentCompositingInputs() return GetAncestorDependentCompositingInputs()
.clipped_absolute_bounding_box; .clipped_absolute_bounding_box;
......
...@@ -2968,7 +2968,13 @@ TEST_P(PaintLayerOverlapTest, ...@@ -2968,7 +2968,13 @@ TEST_P(PaintLayerOverlapTest,
EXPECT_EQ(fixed->LocalBoundingBoxForCompositingOverlapTest(), EXPECT_EQ(fixed->LocalBoundingBoxForCompositingOverlapTest(),
PhysicalRect(0, 0, 50, 50)); PhysicalRect(0, 0, 50, 50));
EXPECT_EQ(fixed->UnclippedAbsoluteBoundingBox(), IntRect(117, 117, 66, 66)); EXPECT_EQ(fixed->UnclippedAbsoluteBoundingBox(), IntRect(117, 117, 66, 66));
EXPECT_EQ(fixed->ClippedAbsoluteBoundingBox(), IntRect(117, 117, 66, 66)); // These values differ because CompositingOptimizationsEnabled takes into
// account transforms (the one one the .xform element), whereas
// CompositingOptimizationsDisabled (incorrectly) does not.
if (!RuntimeEnabledFeatures::CompositingOptimizationsEnabled())
EXPECT_EQ(fixed->ClippedAbsoluteBoundingBox(), IntRect(117, 117, 66, 66));
else
EXPECT_EQ(fixed->ClippedAbsoluteBoundingBox(), IntRect(118, 118, 64, 64));
} }
TEST_P(PaintLayerOverlapTest, NestedFixedUsesExpandedBoundingBoxForOverlap) { TEST_P(PaintLayerOverlapTest, NestedFixedUsesExpandedBoundingBoxForOverlap) {
......
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