-
Notifications
You must be signed in to change notification settings - Fork 162
Follow-Up Feature: Icon-Enablement with Rasterization of SVGs #1647
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
base: master
Are you sure you want to change the base?
Follow-Up Feature: Icon-Enablement with Rasterization of SVGs #1647
Conversation
This is a good thing for me. :) We could utilize the new behaviour from this draft, which means the pre-created PNGs can be removed and we have a little improvement in the look of the icons without changing their appearance (gray tone) too much. |
e0a66ba
to
67d7433
Compare
81714d1
to
b85ad40
Compare
b632c14
to
c8f72f4
Compare
c8f72f4
to
c9d6397
Compare
Test Results 218 files - 321 218 suites - 321 10m 47s ⏱️ - 19m 12s Results for commit 4afe499. ± Comparison against base commit 22e8829. This pull request removes 37 and adds 37 tests. Note that renamed tests count towards both.
This pull request removes 2 skipped tests and adds 3 skipped tests. Note that renamed tests count towards both.
This pull request skips 47 tests.
♻️ This comment has been updated with latest results. |
3bbb308
to
ad19a22
Compare
927252f
to
173577f
Compare
f667bc7
to
e23f321
Compare
SWT currently loads icons exclusively as raster graphics (e.g., PNGs) without support for vector formats like SVG (except for Linux). A major drawback of raster graphics is their inability to scale without degrading image quality. Additionally, generating icons of different sizes requires manually rasterization of SVGs as a preparatory step, leading to unnecessary effort and many icon files. This change introduces support for vector graphics in images, enabling SVGs to be used for images. An SVG rasterizer can be provided via an SWT fragment. This change adds an according fragment based on the JSVG library. An according FileFormat implementation is added, which utilized a present SVG rasterization fragment to rasterize images for the desired zoom factor. Fixes eclipse-platform#1438 Revert "Add support for SVG images" This reverts commit e03b214dc664848d0e1723a1ec80b4a419d2bd59. Introduce functionality for icon disablement with SVGs merge new API (flag parameter) into existing API ImageDataProvider functionality is ignored for now.
e23f321
to
4afe499
Compare
What is the status of this one? |
We are currently working on this PR in Platform UI, so that SVGs can be also used by external consumers like The icon disablement as proposed in this Draft needs further adjustments as it does not work in Cocoa yet and also new API needs to be added so that icons can be created with arbitrary Hue, Saturation and Brightness at runtime. Additionally we should first merge this PR to unify the disablement algorithms for all OS. Apart from that the functionality in this draft is working and allows the disablement for all icons by perprocessing SVGs before rasterization. Please note that due to the different implementation for cocoa it could happen that the changes proposed in this draft will be dismissed completely. |
This draft outlines the follow-up functionality for the PR (Feature Proposal: Rasterization of SVGs at Runtime for Eclipse Icons).
The commit 4e6abc7 contains the new functionality that extends the base functionality of the mentioned PR. All future changes to the PR will be performed to this draft.
The new functionality extends the current automatic customization of icons in the
Image(Device device, Image srcImage, int flag)
constructor. While all of the core functionality is implemented within SWT, some changes are required in Platform UI, which can be found in the following Draft.When the
Image
constructor is invoked, the new functionality attempts to create a graphically customized icon by passing a specific flag (e.g.,SWT.IMAGE_DISABLE
) to the rasterization functionality introduced in the base PR. This functionality is enhanced by a preprocessing step that automatically adds a filter to the SVG before rasterization. These filters are designed to ensure that the resulting icons resemble the current pre-created disabled/gray icons loaded at runtime.It is important to note that the automatic icon customization differs between GTK and Cocoa/Win32. As such, the icons generated with the new functionality may not align perfectly with the automatically customized GTK icons. However, this discrepancy is also present with the current pre-created icons, so the impact is minimal. Additionally, most icons are pre-created and not automatically customized at runtime.
Below is a comparison between the current pre-created icons and the icons customized automatically at runtime using the new functionality. The color/saturation/brightness can be changed by adjusting the filter:
Pre-created and scaled down to 125% device zoom:

Automatically customized at runtime with the new functionality:

The following tasks need to be completed for this draft:
plugin.xml
files to ensure the automatic customization is triggered.Fixes #1438.