-
Notifications
You must be signed in to change notification settings - Fork 176
[win32] Cleanup image wrappers #2036
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] Cleanup image wrappers #2036
Conversation
5de2869
to
0786ad3
Compare
616acf8
to
2e9c992
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.
The overall change looks sound and is great cleanup step.
I only have one question regarding the adaptation for disabled/gray images.
return imageProvider.getImageMetadata(zoom); | ||
} else { | ||
ImageData resizedData = getImageData(zoom); | ||
ImageData newData = adaptImageDataIfDisabledOrGray(resizedData); |
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.
This was removed at the place where this code was moved to. Was that intended, i.e., it is sufficient to only do the adaptation at the remaining places?
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.
I think, it was not completly correct. I want to cover all places, where scaled variants of an ImageData is created and those could be not adapted. My latest commit removed an unnecessary call (calling place already does it) and adds one call.
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! It looks fine now. I didn't find a path that is not covered properly. Still, we might think about if we could further improve this in the future as the it's quite difficult to understand where this adaptation logic has to be placed and why it is correct right now. And since it's hard to test, it may easily be removed at some of the placed accidentally, leading to errors that are not easily perceived.
But for now, it's fine as is.
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, I agree. We should try to better streamline ImageData creation/scaling in Image
2e9c992
to
7502fc6
Compare
This commit refactors Image in the win32 implementation as Image#imageProvider is final and always != null now. With this the handling and creation of new handles and ImageData was unified.
7502fc6
to
3accd93
Compare
Version increment check is failing for infrastructure reasons and no further version bump is required here. |
This PR refactors Image in the win32 implementation as Image#imageProvider is final and always != null now. With this the handling and creation of new handles and ImageData was unified.
Relies on #2027 being merged first and includes this commit because of that.