GC#DrawImage(image, destX, destY, destWidth, destHeight) now tries to load images at the requested destination size before drawing#2526
Merged
akoch-yatta merged 1 commit intoOct 1, 2025
Conversation
Contributor
01766e0 to
fa4a774
Compare
8cf1bfb to
063d70b
Compare
063d70b to
a9b9404
Compare
82c03f5 to
daf247e
Compare
HeikoKlare
reviewed
Sep 26, 2025
Contributor
HeikoKlare
left a comment
There was a problem hiding this comment.
I scanned the PR and commented on some obvious or essential points I came across.
HeikoKlare
reviewed
Sep 28, 2025
e7af9a1 to
d25c48a
Compare
HeikoKlare
reviewed
Sep 29, 2025
0e9ab55 to
d3575ff
Compare
30de03f to
fe7048d
Compare
3875d39 to
d07939a
Compare
akoch-yatta
approved these changes
Oct 1, 2025
Contributor
akoch-yatta
left a comment
There was a problem hiding this comment.
Changes look good to me and I didn't find any regression testing it with the Runtime or the CustomControlExample that already use the new GC API that triggers the changed logic
d07939a to
db2d773
Compare
HeikoKlare
approved these changes
Oct 1, 2025
8c1661a to
627d661
Compare
…en possible. The DrawImage API with just destination coordinates now tries to load images at the requested size. If the requested size is not available, it falls back to the closest available size by calculating the appropriate zoom. Images are loadable at the target size if the image is created from an SVG stream or filename, or The image is created with an ImageDataProvider that is ImageDataAtSizeProvider. This commit also introduces the ImageDataAtSizeProvider interface to support dynamic sizing. Co-authored-by: Michael Bangas <michael.bangas@vector.com>
627d661 to
b238dec
Compare
This was referenced Oct 2, 2025
arunjose696
added a commit
to vi-eclipse/eclipse.platform.swt
that referenced
this pull request
Oct 17, 2025
This commit reverts the changes introduced in eclipse-platform#2526 where getImageData and getScaledImageData were mistakenly interchanged. The initial approach aimed to use this method in loadImageDataClosestTo when images couldn't be loaded at the exact size. However, the final implementation used loadImageData(zoom) instead, making those changes unnecessary. These leftover modifications were an unintended side effect, and this commit removes them.
HeikoKlare
pushed a commit
that referenced
this pull request
Oct 17, 2025
This commit reverts the changes introduced in #2526 where getImageData and getScaledImageData were mistakenly interchanged. The initial approach aimed to use this method in loadImageDataClosestTo when images couldn't be loaded at the exact size. However, the final implementation used loadImageData(zoom) instead, making those changes unnecessary. These leftover modifications were an unintended side effect, and this commit removes them.
HeikoKlare
pushed a commit
to vi-eclipse/eclipse.platform.swt
that referenced
this pull request
Oct 17, 2025
This commit reverts the changes introduced in eclipse-platform#2526 where getImageData and getScaledImageData were mistakenly interchanged. The initial approach aimed to use this method in loadImageDataClosestTo when images couldn't be loaded at the exact size. However, the final implementation used loadImageData(zoom) instead, making those changes unnecessary. These leftover modifications were an unintended side effect, and this commit removes them.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The DrawImage API with just destination coordinates now tries to load images at the requested size.
If the requested size is not available, it falls back to the closest available size by calculating the appropriate zoom.
Images are loadable at the target size if the image is created from an SVG stream or filename, or The image is created with an ImageDataProvider that is ImageDataAtSizeProvider.
This commit also introduces the ImageDataAtSizeProvider interface to support dynamic sizing.
With this changes we need to test the following
Steps to reproduce:
snippet 1 to check drawing svgs at custom sizes (click to show snippet)
**Step 1**: Copy the eclipse.svg to same path where the snippets are and run the below snippet. **Step 2**: Run the snippetpackage org.eclipse.swt.snippets;
before
after
**snippet 2** Drawing images with ImageDataAtSizeProvider
package org.eclipse.swt.snippets;
This depends on #2514 and #2509, Only last commit is relevant to this PR