-
Notifications
You must be signed in to change notification settings - Fork 187
[Win32] Ensure consistent image data returned for filename/data provider #1989
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] Ensure consistent image data returned for filename/data provider #1989
Conversation
Test Results 539 files ±0 539 suites ±0 26m 55s ⏱️ - 2m 2s For more details on these failures, see this check. Results for commit aff8f04. ± Comparison against base commit 0f21a6e. ♻️ This comment has been updated with latest results. |
b73b8cc to
e5e40f0
Compare
akoch-yatta
left a comment
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.
Looks good to me. I tested around a bit and didn't find a regression caused by this.
Due to the on-demand creation of image handles, there is not necessarily a handles anymore from which image data is retrieved when requesting is via the getImageData(...) methods. This results in potentially different kinds of image data (including different anti-aliasing results) depending on whether a handle has already been created for an image at the given zoom or not. This change adapts the Image implementation for ImageDataProvider and ImageFileNameProvider to always use the image data retrieved from a native handle. To this end, it temporarily creates a handle if necessary. In order to avoid repeated loading and handle creation for the same source of image, a cache for the already retrieved image data is introduced. For both the consistent retrieval of image data and the avoidance of repeated loading of image data according test cases are added.
e5e40f0 to
aff8f04
Compare
|
Test failure is known and documented: #1843 |
|
I noticed that this introduces behavior that might violate the contract of
But there is now the following behavior: output: So while modifying the Is this desired / expected? |
That's definitely not expected but simply seems like a bug introduced with this PR. Thank you for the catch, @sratz! |
Due to the on-demand creation of image handles, there is not necessarily a handles anymore from which image data is retrieved when requesting is via the getImageData(...) methods. This results in potentially different kinds of image data (including different anti-aliasing results) depending on whether a handle has already been created for an image at the given zoom or not.
This change adapts the Image implementation for ImageDataProvider and ImageFileNameProvider to always use the image data retrieved from a native handle. To this end, it temporarily creates a handle if necessary. In order to avoid repeated loading and handle creation for the same source of image, a cache for the already retrieved image data is introduced. For both the consistent retrieval of image data and the avoidance of repeated loading of image data according test cases are added.