Commit 46b42eb0 authored by Sam Fortiner's avatar Sam Fortiner Committed by Commit Bot

Reorder flag check for kMaxOverlapBoundsForFixed

Evaluating if the feature is enabled is more costly then evaluating if
it is fixed to the viewport. Swapping this order nets at 15% improvement
according to a linux-perf try job for the blink_perf.paint
fixed-and-many-layers-scroll perf test.

There is no functionality change with this modification.

Bug: 1083715
Change-Id: I0573dd56a9ac944517b952ec7b7e6d8534d478bf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2210780Reviewed-by: default avatarPhilip Rogers <pdr@chromium.org>
Commit-Queue: Sam Fortiner <samfort@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#771117}
parent 142274a8
...@@ -2597,9 +2597,9 @@ PhysicalRect PaintLayer::BoundingBoxForCompositingOverlapTest() const { ...@@ -2597,9 +2597,9 @@ PhysicalRect PaintLayer::BoundingBoxForCompositingOverlapTest() const {
style.BackdropFilter().MapRect(FloatRect(bounding_box))); style.BackdropFilter().MapRect(FloatRect(bounding_box)));
} }
if (base::FeatureList::IsEnabled(features::kMaxOverlapBoundsForFixed) && if (FixedToViewport()) {
!bounding_box.IsEmpty()) { if (base::FeatureList::IsEnabled(features::kMaxOverlapBoundsForFixed) &&
if (FixedToViewport()) { !bounding_box.IsEmpty()) {
DCHECK_EQ(style.GetPosition(), EPosition::kFixed); DCHECK_EQ(style.GetPosition(), EPosition::kFixed);
// Note that we only expand the bounding box for overlap testing when the // Note that we only expand the bounding box for overlap testing when the
// fixed's containing block is the viewport. This keeps us from expanding // fixed's containing block is the viewport. This keeps us from expanding
......
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