Skip to content

Conversation

@HeikoKlare
Copy link
Contributor

@HeikoKlare HeikoKlare commented Aug 11, 2025

When refreshing a GC with another zoom, that zoom is unnecessarily duplicated in the DrawableWrapper of the Image and as a parameter of the refresh method of the GC. This refresh method than unnecessarily uses that zoom to initialize the GCData's native zoom with it, even though that's overwritten with the proper zoom by initializing the GC with the DrawableWrapper afterwards.

This change removes the zoom duplication by removing the parameter in the refresh method of the GC. It removes the unnecessary assignment of the GCData's native zoom and moves the check for whether a refresh is necessary because of a zoom change from the GC to the image. In addition, it ensures that the memGC of an image is not accidentally set to null in case the memGC's zoom does already fit to the requested zoom.

@github-actions
Copy link
Contributor

github-actions bot commented Aug 11, 2025

Test Results

   546 files  ±0     546 suites  ±0   29m 34s ⏱️ -6s
 4 425 tests ±0   4 408 ✅ ±0   17 💤 ±0  0 ❌ ±0 
16 746 runs  ±0  16 619 ✅ ±0  127 💤 ±0  0 ❌ ±0 

Results for commit 7e00285. ± Comparison against base commit 97855ad.

♻️ This comment has been updated with latest results.

Copy link
Contributor

@akoch-yatta akoch-yatta left a comment

Choose a reason for hiding this comment

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

Getting rid of the probably confusing parameter and inlining the logic into image makes sense. tested it with fixed zoom, integer200 and quarter

When refreshing a GC with another zoom, that zoom is unnecessarily
duplicated in the DrawableWrapper of the Image and as a parameter of the
refresh method of the GC. This refresh method than unnecessarily uses
that zoom to initialize the GCData's native zoom with it, even though
that's overwritten with the proper zoom by initializing the GC with the
DrawableWrapper afterwards.

This change removes the zoom duplication by removing the parameter in
the refresh method of the GC. It removes the unnecessary assignment of
the GCData's native zoom and moves the check for whether a refresh is
necessary because of a zoom change from the GC to the image. In
addition, it ensures that the memGC of an image is not accidentally set
to null in case the memGC's zoom does already fit to the requested zoom.
@HeikoKlare HeikoKlare force-pushed the gc-remove-obsolete-parameter branch from f45bd64 to 7e00285 Compare August 11, 2025 13:02
@akoch-yatta akoch-yatta merged commit 812289e into eclipse-platform:master Aug 11, 2025
17 checks passed
@akoch-yatta akoch-yatta deleted the gc-remove-obsolete-parameter branch August 11, 2025 13:23
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.

2 participants