Use the existing image to initialize the GC in ImageGcDrawerWrapper#2238
Use the existing image to initialize the GC in ImageGcDrawerWrapper#2238ShahzaibIbrahim wants to merge 3 commits intoeclipse-platform:masterfrom
Conversation
20cf50a to
a8d8a82
Compare
Test Results 115 files - 431 115 suites - 431 9m 49s ⏱️ - 22m 27s For more details on these failures and errors, see this check. Results for commit 01ddea2. ± Comparison against base commit 508ad4a. This pull request removes 37 and adds 1 tests. Note that renamed tests count towards both.♻️ This comment has been updated with latest results. |
HeikoKlare
left a comment
There was a problem hiding this comment.
I've tested the behavior with the LineNumberRuler and that seems to be work fine with different zooms. But with this change we will see the following warnings when strict checks are enabled, which need to be resolved:
***WARNING: Images with handles created for multiple zooms should not be modified. It should be created with an ImageGcDrawer (see SWT Snippet 384).
bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Image.java
Outdated
Show resolved
Hide resolved
|
Is this something we can only do for the Windows implementation or may we adapt all the MacOS and Linux implementations of |
This error should go away once this PR is merged. |
Yes, it make sense to adapt the MacOS and Linux implementation of Image. But since I can't test the changes, I will wait until @fedejeanne is back and can test those changes with him. |
d8bdef8 to
24fbd72
Compare
bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Image.java
Outdated
Show resolved
Hide resolved
099e31c to
d96e9ef
Compare
d96e9ef to
36a5fce
Compare
567f77a to
1e45dab
Compare
For Windows, In ImageGCDrawerWrapper#newImageHandle, we create a new image with existing data to initialize the GC, instead we could use the existing image object and the base handle should be created as it is done in PlainImageDataProvider. For GTK and Cocoa, We use init methods to create new handles instead of creating a new Image object.
1e45dab to
abc68c9
Compare
|
Closing this PR as removing temporary images does not reduce resource usage; handles still need to be created and disposed. A larger refactoring would be required to address this properly. More info here: vi-eclipse/Eclipse-Platform#328 (comment) |
In ImageGCDrawerWrapper#newImageHandle, we create a new image with existing data to initialize the GC, instead we could use the existing image object and the base handle should be created as it is done in PlainImageDataProvider.