Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve handling of no paint effect in paint invalidation #17261

Closed
wants to merge 1 commit into from

Conversation

chromium-wpt-export-bot
Copy link
Collaborator

@chromium-wpt-export-bot chromium-wpt-export-bot commented Jun 11, 2019

Now we check DisplayItemClient::PaintedOutputHasNoEffect() before
computing the visual rect. If it's true, just use empty visual rect
because the DisplayItemClient will paint nothing.

Because PaintedOutputHasNoEffect() may depend on style and/or layout
result, it's cached and updated after SetStyle() and layout. When it
changes, we call SetShouldCheckForPaintInvalidation() to ensure we
update visual rect.

This reduces unnecessary paint invalidations, repaint of PaintLayers,
and raster invalidations when a DisplayItemClient paints nothing
before and after a change (which won't affect the visual effect of the
DisplayItemClient).

This doesn't change LayoutObject::LocalVisualRect() which is used to
get the visual bounding box of the LayoutObject, because some callers
may expect the rect to cover contents.

Change-Id: Ib56fe48dc6e7d60fd717a1dfb2336cfad2521d7f
Reviewed-on: https://chromium-review.googlesource.com/1649602
WPT-Export-Revision: acb43a0d8291e186c62741e9711c8a8abbcaf70a

Copy link
Collaborator

@wpt-pr-bot wpt-pr-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Already reviewed downstream.

@chromium-wpt-export-bot chromium-wpt-export-bot force-pushed the chromium-export-cl-1649602 branch 2 times, most recently from 8107acf to c6d6d25 Compare June 16, 2019 18:41
Now we check DisplayItemClient::PaintedOutputHasNoEffect() before
computing the visual rect. If it's true, just use empty visual rect
because the DisplayItemClient will paint nothing.

Because PaintedOutputHasNoEffect() may depend on style and/or layout
result, it's cached and updated after SetStyle() and layout. When it
changes, we call SetShouldCheckForPaintInvalidation() to ensure we
update visual rect.

This reduces unnecessary paint invalidations, repaint of PaintLayers,
and raster invalidations when a DisplayItemClient paints nothing
before and after a change (which won't affect the visual effect of the
DisplayItemClient).

This doesn't change LayoutObject::LocalVisualRect() which is used to
get the visual bounding box of the LayoutObject, because some callers
may expect the rect to cover contents.

Change-Id: Ib56fe48dc6e7d60fd717a1dfb2336cfad2521d7f
@gsnedders gsnedders closed this Jan 24, 2020
@gsnedders gsnedders deleted the chromium-export-cl-1649602 branch January 24, 2020 18:03
@gsnedders gsnedders restored the chromium-export-cl-1649602 branch January 24, 2020 18:49
@Hexcles Hexcles reopened this Jan 24, 2020
@KyleJu KyleJu closed this Apr 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants