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

Speed-up Border rendering by avoiding useless pass during size allocation #24844

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

albyrock87
Copy link
Contributor

@albyrock87 albyrock87 commented Sep 20, 2024

Description of Change

While updating the frame from Handler we set Width and Height.
Each of them triggers border mapping:

image image

The first one is useless as the other dimension will change right after.
We can avoid this by batching the change on SizeAllocated:

void UpdateBoundsComponents(Rect bounds)
{
_frame = bounds;
BatchBegin();
X = bounds.X;
Y = bounds.Y;
Width = bounds.Width;
Height = bounds.Height;
SizeAllocated(Width, Height);
SizeChanged?.Invoke(this, EventArgs.Empty);
BatchCommit();
}

This brings us to a better result:
image
image

Issues Fixed

Fixes #24843
Contributes to #24123

@albyrock87 albyrock87 requested a review from a team as a code owner September 20, 2024 12:17
@dotnet-policy-service dotnet-policy-service bot added the community ✨ Community Contribution label Sep 20, 2024
@rmarinho rmarinho requested review from jonathanpeppers and PureWeen and removed request for jsuarezruiz and tj-devel709 September 20, 2024 14:39
@PureWeen
Copy link
Member

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community ✨ Community Contribution
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Border mapping should perform better
2 participants