Conversation
zencode1
force-pushed
the
background-bitmap-performance
branch
from
September 21, 2026 15:03
4009f28 to
1da02df
Compare
Contributor
Author
|
After making the PR, I noticed that it is possible for Additionally, I added a "Concerns" section to my description regarding a possible problem if a consumer makes use of |
Daniel-Tr
self-requested a review
September 22, 2026 13:09
Daniel-Tr
requested changes
Sep 22, 2026
Daniel-Tr
left a comment
Collaborator
There was a problem hiding this comment.
As for the concerns mentioned in the PR:
To resolve this, we would need a more robust notification mechanism. That is beyond the scope of this PR.
This is a potential breaking change (even though most likely not very likely), so I think we should address it first.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
StaticBackground/TileBackgroundpreviously calledPrepareBackGroundPictureon every paint, which allocates a newTBitmap, resizes it, and re-renders the background graphic (including aMaskBlt/transparency pass) even though the result is identical from one paint to the next.FBackgroundPrepared(bitmap + theBackgroundColor/Transparentsettings it was rendered with) and a newGetBackgroundBitmaphelper that only re-renders when the background color or transparency setting has changed since the last paint; otherwise it returns the cached bitmap. The cache is also invalidated whenever the background picture changes (Background.OnChange).Notes for reviewers
PrepareBackGroundPictureis unchanged - the existingTImage-styleBackGroundImageTransparentcontract (issue Background image should support transparency #662) is preserved.Concerns
Backgroundis a public property, and OnChange is a single public callback, if a consumer assignsBackground.OnChangeafter construction, it replaces this handler. Any subsequent changes then leaveFBackgroundPrepared.Bitmapstale, and the tree continues painting the old image. To resolve this, we would need a more robust notification mechanism. That is beyond the scope of this PR.Test plan