Skip to content

Conversation

@ShahzaibIbrahim
Copy link
Contributor

@ShahzaibIbrahim ShahzaibIbrahim commented Mar 5, 2025

Initializing image handle only using initNative method for both the cases where zoom is equal to the filezoom and when its not equal to the filezoom. The handle in case of not equal is created temporarily and destroyed later before calling init.

Dependent on:

@github-actions
Copy link
Contributor

github-actions bot commented Mar 5, 2025

Test Results

   510 files  + 1     510 suites  +1   8m 42s ⏱️ +13s
 4 345 tests +37   4 331 ✅ +35   14 💤 +3  0 ❌  - 1 
16 613 runs  +37  16 502 ✅ +35  111 💤 +3  0 ❌  - 1 

Results for commit f2c137b. ± Comparison against base commit 011a490.

♻️ This comment has been updated with latest results.

@ShahzaibIbrahim ShahzaibIbrahim force-pushed the master-235 branch 2 times, most recently from 8d3985b to c51c9c9 Compare March 10, 2025 10:37
@ShahzaibIbrahim ShahzaibIbrahim changed the title Using initNative in all cases and refactoring initNative Method Unify instantiation of image handles in ImageFileNameProvider Mar 10, 2025
@ShahzaibIbrahim ShahzaibIbrahim marked this pull request as ready for review March 10, 2025 10:39
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.

There is a failing test for image initialization on Windows, so the change does to not seem to be correct as is.

@ShahzaibIbrahim
Copy link
Contributor Author

Tests that are failing will be resolved once #1898 is merged. So it makes this PR dependent.

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.

This PR now basically reverts the commit made to Image recently pushed on master. Please adapt to current behavior of the class first.

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 looks good. I only have a remark regarding adaptation of gray/disabled images.

Initializing image handle only using initNative method for both the
cases where zoom is equal to the filezoom and when its not equal to the
filezoom. The handle in case of not equal is created temporarily and
destroyed later before calling init.
imageDataAtZoom = ImageDataLoader.load(fileForZoom.element(), fileForZoom.zoom(), zoom);
} else {
imageDataAtZoom = new ElementAtZoom<>(nativeInitializedImage.getImageData(), fileForZoom.zoom());
destroyHandleForZoom(zoom);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it correct to destroy the handle if it was retireved from the zoomLevelToImageHandle map? I guess we should only do that if it was not in that map before (i.e., if it was temporarily created for retrieving the image data), shouldn't we?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is confusing, yes, but logically okay. zoom != fileForZoom.zoom(). It is again a place, where we will need to do a second round, when we refactored all the places to be able to better create temporary handles.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I see, it is because the calling method Image#getImageData(int) ensures that. I didn't see that. Yes, that's definitely confusing and we should clean up in a second round.

@HeikoKlare HeikoKlare merged commit 870571c into eclipse-platform:master Mar 14, 2025
14 checks passed
@HeikoKlare HeikoKlare deleted the master-235 branch March 14, 2025 19:26
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.

Unify instantation of image handles with ImageFileNameProvider

3 participants