Skip to content

[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

Conversation

akoch-yatta
Copy link
Contributor

@akoch-yatta akoch-yatta commented Apr 25, 2025

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.

Copy link
Contributor

github-actions bot commented Apr 25, 2025

Test Results

   545 files  + 6     545 suites  +6   33m 16s ⏱️ - 3m 30s
 4 376 tests +37   4 358 ✅ +35   18 💤 +3  0 ❌  - 1 
16 643 runs  +37  16 502 ✅ +35  141 💤 +3  0 ❌  - 1 

Results for commit d424a46. ± Comparison against base commit cababba.

♻️ This comment has been updated with latest results.

@akoch-yatta akoch-yatta force-pushed the Remove-initialNativeZoom-in-Image branch 8 times, most recently from 52dd511 to db7a3a1 Compare May 2, 2025 07:20
@akoch-yatta akoch-yatta marked this pull request as ready for review May 2, 2025 08:14
@akoch-yatta akoch-yatta force-pushed the Remove-initialNativeZoom-in-Image branch from db7a3a1 to e0c1ae7 Compare May 5, 2025 18:11
@akoch-yatta akoch-yatta linked an issue May 6, 2025 that may be closed by this pull request
@akoch-yatta akoch-yatta force-pushed the Remove-initialNativeZoom-in-Image branch from e0c1ae7 to f3b211c Compare May 6, 2025 14:47
@HeikoKlare HeikoKlare force-pushed the Remove-initialNativeZoom-in-Image branch from f3b211c to 73d731c Compare May 6, 2025 15:11
Copy link
Contributor

@HeikoKlare HeikoKlare left a 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));
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor

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.

@akoch-yatta akoch-yatta force-pushed the Remove-initialNativeZoom-in-Image branch 2 times, most recently from 38787fc to 140e119 Compare May 7, 2025 09:05
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.
@akoch-yatta akoch-yatta force-pushed the Remove-initialNativeZoom-in-Image branch from 140e119 to d424a46 Compare May 7, 2025 09:38
@HeikoKlare HeikoKlare merged commit 393309f into eclipse-platform:master May 7, 2025
17 checks passed
@HeikoKlare HeikoKlare deleted the Remove-initialNativeZoom-in-Image branch May 7, 2025 11:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove Image#initialNativeZoom
2 participants