-
Notifications
You must be signed in to change notification settings - Fork 137
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
Refactor Image for storing ImageMetadata #1496
base: master
Are you sure you want to change the base?
Conversation
Test Results 482 files - 1 482 suites - 1 8m 43s ⏱️ - 3m 51s For more details on these failures and errors, see this check. Results for commit 5d4076a. ± Comparison against base commit e6588c2. This pull request removes 35 tests.
♻️ This comment has been updated with latest results. |
68e8193
to
597c46d
Compare
597c46d
to
9acf71a
Compare
3832a24
to
e353b1a
Compare
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
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
Outdated
Show resolved
Hide resolved
8067b98
to
6225eae
Compare
6225eae
to
8f0c350
Compare
Converted it back to Draft, this one should be merged in 4.35 M1 |
689b931
to
42db14c
Compare
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 some comments regarding coding style and one missing return
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
if (zoom != null && !zoomLevelToHandle.containsKey(zoom)) { | ||
zoomLevelToHandle.put(zoom, handle); | ||
private void setImageMetadataForHandle(ImageHandle imageMetadata, Integer zoom) { | ||
if (zoom != null && !zoomLevelToImageHandle.containsKey(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.
Wouldn't it be a proper response to throw an exception if someone tries to override the existing metadata for a given zoom
? This way you are silently ignoring the case, which may have unintended consequences in the future.
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
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
Outdated
Show resolved
Hide resolved
1edd016
to
703bf95
Compare
This contribution encapsulates the metadata of the image in an innerclass ImageHandle which is used to create a hashmap of zoom level to imageHandle object inside an image object, making it straight forward to obtain any metadata information from an image for a zoom level. contributes to eclipse-platform#62 and eclipse-platform#127
a575ad0
to
ea52af4
Compare
This commit refactors usage of ImageDataProvider and ImageFilenameProvider to make the code more readable. contributes to eclipse-platform#62 and eclipse-platform#127
ea52af4
to
5d4076a
Compare
This PR contributes to the refactoring of
Image
class for win32.The goal is to store more than just the
handle
of the image for each zoom level. To do that, a new private class is created (it's calledImageHandle
) and an image contains one instance of this new class for each zoom level. The class contains the following fields:handle
height
width
contributes to #62 and #127