Commit 6e865bc
committed
[Win32] Ensure consistent image data returned for filename/data provider
Due to the on-demand creation of image handles, there is not necessarily
a handles anymore from which image data is retrieved when requesting is
via the getImageData(...) methods. This results in potentially different
kinds of image data (including different anti-aliasing results)
depending on whether a handle has already been created for an image at
the given zoom or not.
This change adapts the Image implementation for ImageDataProvider and
ImageFileNameProvider to always use the image data retrieved from a
native handle. To this end, it temporarily creates a handle if
necessary. In order to avoid repeated loading and handle creation for
the same source of image, a cache for the already retrieved image data
is introduced. For both the consistent retrieval of image data and the
avoidance of repeated loading of image data according test cases are
added.1 parent 0f21a6e commit 6e865bc
File tree
2 files changed
+98
-41
lines changed- bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics
- tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit
2 files changed
+98
-41
lines changedLines changed: 38 additions & 41 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| |||
2176 | 2177 | | |
2177 | 2178 | | |
2178 | 2179 | | |
| 2180 | + | |
| 2181 | + | |
2179 | 2182 | | |
2180 | | - | |
2181 | 2183 | | |
2182 | 2184 | | |
2183 | 2185 | | |
| |||
2190 | 2192 | | |
2191 | 2193 | | |
2192 | 2194 | | |
2193 | | - | |
2194 | | - | |
2195 | | - | |
2196 | | - | |
2197 | | - | |
2198 | | - | |
2199 | | - | |
2200 | | - | |
2201 | | - | |
| 2195 | + | |
| 2196 | + | |
| 2197 | + | |
| 2198 | + | |
| 2199 | + | |
| 2200 | + | |
| 2201 | + | |
| 2202 | + | |
| 2203 | + | |
| 2204 | + | |
| 2205 | + | |
| 2206 | + | |
| 2207 | + | |
| 2208 | + | |
| 2209 | + | |
2202 | 2210 | | |
2203 | | - | |
| 2211 | + | |
| 2212 | + | |
| 2213 | + | |
| 2214 | + | |
| 2215 | + | |
| 2216 | + | |
| 2217 | + | |
| 2218 | + | |
| 2219 | + | |
| 2220 | + | |
| 2221 | + | |
| 2222 | + | |
| 2223 | + | |
| 2224 | + | |
| 2225 | + | |
| 2226 | + | |
2204 | 2227 | | |
2205 | 2228 | | |
2206 | 2229 | | |
| |||
2210 | 2233 | | |
2211 | 2234 | | |
2212 | 2235 | | |
2213 | | - | |
| 2236 | + | |
2214 | 2237 | | |
2215 | 2238 | | |
2216 | 2239 | | |
| |||
2226 | 2249 | | |
2227 | 2250 | | |
2228 | 2251 | | |
2229 | | - | |
2230 | | - | |
2231 | | - | |
2232 | | - | |
2233 | | - | |
2234 | | - | |
2235 | | - | |
2236 | | - | |
2237 | | - | |
2238 | | - | |
2239 | | - | |
2240 | | - | |
2241 | | - | |
2242 | | - | |
2243 | | - | |
2244 | | - | |
2245 | | - | |
| 2252 | + | |
2246 | 2253 | | |
2247 | 2254 | | |
2248 | 2255 | | |
| |||
2455 | 2462 | | |
2456 | 2463 | | |
2457 | 2464 | | |
2458 | | - | |
2459 | | - | |
2460 | | - | |
2461 | | - | |
2462 | | - | |
2463 | | - | |
2464 | | - | |
2465 | | - | |
2466 | | - | |
2467 | | - | |
2468 | | - | |
2469 | | - | |
| 2465 | + | |
| 2466 | + | |
2470 | 2467 | | |
2471 | 2468 | | |
2472 | 2469 | | |
| |||
Lines changed: 60 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
23 | 24 | | |
24 | 25 | | |
| 26 | + | |
| 27 | + | |
25 | 28 | | |
26 | 29 | | |
27 | 30 | | |
28 | 31 | | |
29 | 32 | | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
30 | 36 | | |
31 | 37 | | |
32 | 38 | | |
| |||
1262 | 1268 | | |
1263 | 1269 | | |
1264 | 1270 | | |
| 1271 | + | |
| 1272 | + | |
| 1273 | + | |
| 1274 | + | |
| 1275 | + | |
| 1276 | + | |
| 1277 | + | |
| 1278 | + | |
| 1279 | + | |
| 1280 | + | |
| 1281 | + | |
| 1282 | + | |
| 1283 | + | |
| 1284 | + | |
| 1285 | + | |
| 1286 | + | |
| 1287 | + | |
| 1288 | + | |
| 1289 | + | |
| 1290 | + | |
| 1291 | + | |
| 1292 | + | |
| 1293 | + | |
| 1294 | + | |
| 1295 | + | |
| 1296 | + | |
| 1297 | + | |
| 1298 | + | |
| 1299 | + | |
| 1300 | + | |
| 1301 | + | |
| 1302 | + | |
| 1303 | + | |
| 1304 | + | |
| 1305 | + | |
| 1306 | + | |
| 1307 | + | |
| 1308 | + | |
| 1309 | + | |
| 1310 | + | |
| 1311 | + | |
| 1312 | + | |
| 1313 | + | |
| 1314 | + | |
| 1315 | + | |
| 1316 | + | |
| 1317 | + | |
| 1318 | + | |
| 1319 | + | |
| 1320 | + | |
| 1321 | + | |
| 1322 | + | |
| 1323 | + | |
| 1324 | + | |
1265 | 1325 | | |
0 commit comments