-
Notifications
You must be signed in to change notification settings - Fork 187
[win32] Create image handles on demand for width/height based constructors #1884
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
[win32] Create image handles on demand for width/height based constructors #1884
Conversation
d943889 to
5eeb513
Compare
Test Results 509 files + 509 509 suites +509 8m 7s ⏱️ + 8m 7s 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. |
5eeb513 to
5eba21f
Compare
f8377ad to
eae19e4
Compare
bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Image.java
Show resolved
Hide resolved
bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Image.java
Outdated
Show resolved
Hide resolved
bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Image.java
Outdated
Show resolved
Hide resolved
bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Image.java
Show resolved
Hide resolved
eae19e4 to
dd9b823
Compare
HeikoKlare
left a comment
There was a problem hiding this 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.
bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Image.java
Show resolved
Hide resolved
bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Image.java
Outdated
Show resolved
Hide resolved
dd9b823 to
95cec51
Compare
HeikoKlare
left a comment
There was a problem hiding this 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.
bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Image.java
Outdated
Show resolved
Hide resolved
| } | ||
|
|
||
| @Override | ||
| ImageHandle getImageMetadata(int zoom) { |
There was a problem hiding this comment.
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 inImage, which creates the image handle if missing (via above) and then just returns the value from thezoomLevelToImageHandlemap
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.
There was a problem hiding this comment.
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
bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Image.java
Outdated
Show resolved
Hide resolved
95cec51 to
05dcf9f
Compare
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.
05dcf9f to
f9a3656
Compare
fedejeanne
left a comment
There was a problem hiding this 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
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.