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

LibWeb: Use stack to represent blit/sample corners commands state #24453

Conversation

kalenikaliaksandr
Copy link
Contributor

...instead of allocating separate BorderRadiusCornerClipper for each executed sample/blit commands pair.

With this change a vector of BorderRadiusCornerClipper has far fewer items. For example on twitter profile page its size goes down from ~3000 to ~3 items.

Before:
- sample corners id = 0
- sample corners id = 1
- sample corners id = 2
- blit corners   id = 0
- blit corners   id = 1
- blit corners   id = 2

After:
 - sample corners id = 0
 - sample corners id = 1
 - sample corners id = 2
 - blit corners   id = 2
 - blit corners   id = 1
 - blit corners   id = 0
@github-actions github-actions bot added the 👀 pr-needs-review PR needs review from a maintainer or community member label May 26, 2024
@BuggieBot
Copy link
Member

Hello!

One or more of the commit messages in this PR do not match the SerenityOS code submission policy, please check the lint_commits CI job for more details on which commits were flagged and why.
Please do not close this PR and open another, instead modify your commit message(s) with git commit --amend and force push those changes to update this PR.

This reverts commit 6b7b9ca.

The whole corner radius is invisible if it has 0 radius in any axis, so
the reverted commit was a mistake that led to error checking during
painting command execution b61aab6 to
avoid crashing on attempt to allocate 0 size bitmap.
Before, this check was needed to prevent crashing when attempting to
allocate zero-size bitmap for sampled corners, which could have happened
if a corner had 0 radius in one axis.

Now, since SampleUnderCorners command is not emmited when radius is 0
in one axis, this check is no longer needed.
...instead of allocating separate BorderRadiusCornerClipper for each
executed sample/blit commands pair.

With this change a vector of BorderRadiusCornerClipper has far fewer
items. For example on twitter profile page its size goes down from
~3000 to ~3 items.
@kalenikaliaksandr kalenikaliaksandr force-pushed the use-stack-for-sample-blit-corners branch from 8eb5e11 to e5cc5d0 Compare May 26, 2024 15:41
@awesomekling
Copy link
Collaborator

cc @MacDue

@MacDue
Copy link
Member

MacDue commented May 26, 2024

Seems fine to me (though I've not been keeping up with changes in the RecordingPainter)

@awesomekling awesomekling merged commit 0eeae7f into SerenityOS:master May 27, 2024
11 checks passed
@github-actions github-actions bot removed the 👀 pr-needs-review PR needs review from a maintainer or community member label May 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants