-
Notifications
You must be signed in to change notification settings - Fork 164
[win32] Remove Image#initialNativeZoom #2064
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
[win32] Remove Image#initialNativeZoom #2064
Conversation
52dd511
to
db7a3a1
Compare
db7a3a1
to
e0c1ae7
Compare
e0c1ae7
to
f3b211c
Compare
f3b211c
to
73d731c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general, the change is sound and rather trivial as it removes a mostly unused field. I have only question regarding the handle cleanup logic.
destroyHandles(zoom -> { | ||
return !zoomLevels.contains(zoom) && zoom != DPIUtil.getZoomForAutoscaleProperty(initialNativeZoom); | ||
}); | ||
destroyHandles(zoom -> !zoomLevels.contains(zoom)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May this now lead to all handles being destroyed if the (potentially single) zoom, for which a handle exists, is not in the list of excluded zoom levels? So, e.g., an image was create for 100% zoom, drawn with a GC, then monitor scaling is changed to 125%, so the handle is destroyed and the image painted via GC is lost?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, you probably could create a scenario like this. As you stated out, it would only affect images, that are changed with a GC afterwards. We already would have issues with GC when there were multiple handles created before, but we could introduce some kind of locking flag, when an image was used once with a GC to prevent it from cleaning up any handles here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the fix regarding a plain image that may be initialized via GC. Looks fine to me.
38787fc
to
140e119
Compare
This commit removes Image#initialNativeZoom in the windows implementation. To achieve this all usages of this field are replaces by either using a concrete zoom values or by creating a temporary handle.
140e119
to
d424a46
Compare
This PR removes Image#initialNativeZoom in the windows implementation. To achieve this all usages of this field are replaces by either using a concrete zoom values or by creating a temporary handle.