[Win32] Store 100% handle when drawing single-zoom bitmap#3429
Open
HeikoKlare wants to merge 1 commit into
Open
[Win32] Store 100% handle when drawing single-zoom bitmap#3429HeikoKlare wants to merge 1 commit into
HeikoKlare wants to merge 1 commit into
Conversation
Contributor
The GC.drawImage() operations use an Image mechanism that creates temporary handles for the requested size in case the image can be rendered at precisely the requested size or if no existing handle with a fitting size is found. While it is reasonable to not store persistent handles for arbitrary zooms, this may not be the optimal decision when requesting the 100% version of the image. For example, an image for which just a single bitmap exists, such that it can only be reasonably used at 100% scale, it is not beneficial to not persist the handle for its 100% version, as the next request will definitely request that same size again. This change thus improves the image loading mechanism for GC.drawImage() operations by persisting the 100% handle in case the image is requested at exactly 100% for that drawImage() operation. Fixes eclipse-platform#3419
There was a problem hiding this comment.
Pull request overview
Improves Win32 GC.drawImage() performance by ensuring the 100% image handle is persisted (instead of repeatedly creating temporary handles) when an image is requested at exactly 100% scale.
Changes:
- Persist the 100% handle when
getOrCreateImageHandleAtClosestSize(...)computesimageZoom == 100. - Refactor handle retrieval logic into a shared private helper (
getHandleInternal(...)) and delegategetHandle(...)to it.
3 tasks
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.
The GC.drawImage() operations use an Image mechanism that creates temporary handles for the requested size in case the image can be rendered at precisely the requested size or if no existing handle with a fitting size is found.
While it is reasonable to not store persistent handles for arbitrary zooms, this may not be the optimal decision when requesting the 100% version of the image. For example, an image for which just a single bitmap exists, such that it can only be reasonably used at 100% scale, it is not beneficial to not persist the handle for its 100% version, as the next request will definitely request that same size again.
This change thus improves the image loading mechanism for GC.drawImage() operations by persisting the 100% handle in case the image is requested at exactly 100% for that drawImage() operation.
Fixes #3419