Commit f767746
committed
Allow to test for loading image at zoom and fix faulty Win32 image load
The ImageLoader and FileFormat implementations currently combine the
check whether an image can be provided at a specific scale value and the
provision of an image in the scale itself. In case a consumer wants to
only test whether an image can be provided at a specific scale, it needs
to request that image at that scale, even if it will not be used later
one, e.g., because it cannot be provided in the required scale.
With this change, ImageLoader and FileFormat provide separate methods
for validating whether an image can be retrieved at a specific zoom
(such as from an SVG) and the retrieval of the image itself. This is
employed by the Cocoa Image implementation to avoid unnecessary load
operations and in the Win32 Image implementation to correct erroneous
scaling from an already initialized handle instead of loading at proper
zoom (such as for an SVG). In addition, this fixes a faulty reuse of the
same stream in the Cocoa Image implementation at the same place.1 parent 3670670 commit f767746
File tree
5 files changed
+55
-23
lines changed- bundles/org.eclipse.swt/Eclipse SWT
- cocoa/org/eclipse/swt/graphics
- common/org/eclipse/swt
- graphics
- internal/image
- win32/org/eclipse/swt/graphics
5 files changed
+55
-23
lines changedLines changed: 20 additions & 22 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
24 | 23 | | |
25 | 24 | | |
26 | 25 | | |
| |||
695 | 694 | | |
696 | 695 | | |
697 | 696 | | |
698 | | - | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
699 | 700 | | |
| 701 | + | |
| 702 | + | |
700 | 703 | | |
701 | 704 | | |
702 | 705 | | |
| |||
741 | 744 | | |
742 | 745 | | |
743 | 746 | | |
744 | | - | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
745 | 751 | | |
746 | 752 | | |
747 | 753 | | |
| |||
795 | 801 | | |
796 | 802 | | |
797 | 803 | | |
798 | | - | |
| 804 | + | |
799 | 805 | | |
800 | | - | |
801 | | - | |
802 | | - | |
803 | | - | |
804 | | - | |
805 | | - | |
806 | | - | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
807 | 811 | | |
808 | 812 | | |
809 | 813 | | |
| |||
1484 | 1488 | | |
1485 | 1489 | | |
1486 | 1490 | | |
1487 | | - | |
1488 | | - | |
1489 | | - | |
1490 | | - | |
1491 | | - | |
1492 | | - | |
1493 | | - | |
1494 | | - | |
1495 | | - | |
1496 | | - | |
1497 | | - | |
| 1491 | + | |
| 1492 | + | |
| 1493 | + | |
| 1494 | + | |
| 1495 | + | |
1498 | 1496 | | |
1499 | 1497 | | |
1500 | 1498 | | |
| |||
Lines changed: 8 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
40 | 44 | | |
41 | 45 | | |
42 | 46 | | |
43 | 47 | | |
44 | 48 | | |
45 | 49 | | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
46 | 54 | | |
47 | 55 | | |
48 | 56 | | |
| |||
Lines changed: 15 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
163 | 163 | | |
164 | 164 | | |
165 | 165 | | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
166 | 171 | | |
167 | 172 | | |
168 | 173 | | |
| |||
196 | 201 | | |
197 | 202 | | |
198 | 203 | | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
199 | 214 | | |
200 | 215 | | |
201 | 216 | | |
| |||
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
136 | 136 | | |
137 | 137 | | |
138 | 138 | | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
139 | 143 | | |
140 | 144 | | |
141 | 145 | | |
| |||
Lines changed: 8 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2212 | 2212 | | |
2213 | 2213 | | |
2214 | 2214 | | |
| 2215 | + | |
| 2216 | + | |
| 2217 | + | |
| 2218 | + | |
| 2219 | + | |
| 2220 | + | |
| 2221 | + | |
| 2222 | + | |
2215 | 2223 | | |
2216 | 2224 | | |
2217 | 2225 | | |
2218 | 2226 | | |
2219 | 2227 | | |
2220 | 2228 | | |
2221 | | - | |
2222 | 2229 | | |
2223 | 2230 | | |
2224 | 2231 | | |
| |||
0 commit comments