Skip to content

Conversation

@akoch-yatta
Copy link
Contributor

This PR refactors the Image constructor using width and height to create a bitmap to create the handles always on demand instead of creating its first handle in the constructor.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 7, 2025

Test Results

   509 files  +   509     509 suites  +509   8m 7s ⏱️ + 8m 7s
 4 308 tests + 4 308   4 296 ✅ + 4 296   11 💤 + 11  1 ❌ +1 
16 576 runs  +16 576  16 467 ✅ +16 467  108 💤 +108  1 ❌ +1 

For more details on these failures, see this check.

Results for commit f9a3656. ± Comparison against base commit 971b9a6.

♻️ This comment has been updated with latest results.

@akoch-yatta akoch-yatta force-pushed the refactor-image-branch branch from 5eeb513 to 5eba21f Compare March 7, 2025 08:04
@akoch-yatta akoch-yatta marked this pull request as draft March 7, 2025 10:49
@akoch-yatta akoch-yatta force-pushed the refactor-image-branch branch 2 times, most recently from f8377ad to eae19e4 Compare March 10, 2025 07:42
@akoch-yatta akoch-yatta marked this pull request as ready for review March 10, 2025 07:55
@akoch-yatta akoch-yatta force-pushed the refactor-image-branch branch from eae19e4 to dd9b823 Compare March 10, 2025 11:16
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.

I have initial questions regarding the overall design, including duplication of logic and the proper usage of memGC.

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.

I have just one nitpick comment and a question remaining that we may also follow-up on in a separate PR.

}

@Override
ImageHandle getImageMetadata(int zoom) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I am always a bit confused by this getImageMetadata method. Isn't this actually what we want to have:

  • A provider-specific createImageHandleIfMissing()
  • A gerneric getOrCreateImageHandle() directly in Image, which creates the image handle if missing (via above) and then just returns the value from the zoomLevelToImageHandle map

As far as I can see, that's what each of the implementations does.

This is not necessarily something to improve in this PR, but since I stumped upon it again in this PR, I wanted to take the chance to ask.

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, I agree. One issue is, that most handles are created implicitly in the different init methods. When we have transformed all constructors to use the wrappers and the handles are created more explicitly, we can probably drag out some common logic back into Image

@akoch-yatta akoch-yatta force-pushed the refactor-image-branch branch from 95cec51 to 05dcf9f Compare March 14, 2025 11:52
This commit refactors the Image constructor using width and height to
create a bitmap to create handles on demand instead of creating a first
handle in the constructor.
@HeikoKlare HeikoKlare force-pushed the refactor-image-branch branch from 05dcf9f to f9a3656 Compare March 14, 2025 12:36
Copy link
Member

@fedejeanne fedejeanne left a comment

Choose a reason for hiding this comment

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

Test failure is unrelated (#1843) and the check for the freeze period shows a failure even though it succeeded

@fedejeanne fedejeanne merged commit 0a0b40c into eclipse-platform:master Mar 14, 2025
12 of 14 checks passed
@fedejeanne fedejeanne deleted the refactor-image-branch branch March 14, 2025 13:22
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.

Extract width/height based image into additional AbstractImageProviderWrapper to create handles on demand

3 participants