Commit 41f7b9a
committed
[Win32] Ensure consistent image data returned for data-based images
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 implementation of Image based on static ImageData
and streams 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.
Fixes #20521 parent 7502fc6 commit 41f7b9a
File tree
2 files changed
+57
-11
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
+57
-11
lines changedLines changed: 32 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1892 | 1892 | | |
1893 | 1893 | | |
1894 | 1894 | | |
1895 | | - | |
| 1895 | + | |
| 1896 | + | |
| 1897 | + | |
| 1898 | + | |
| 1899 | + | |
1896 | 1900 | | |
1897 | 1901 | | |
1898 | 1902 | | |
1899 | 1903 | | |
1900 | | - | |
| 1904 | + | |
1901 | 1905 | | |
1902 | | - | |
| 1906 | + | |
1903 | 1907 | | |
1904 | 1908 | | |
1905 | 1909 | | |
| |||
1947 | 1951 | | |
1948 | 1952 | | |
1949 | 1953 | | |
| 1954 | + | |
1950 | 1955 | | |
1951 | 1956 | | |
1952 | 1957 | | |
1953 | 1958 | | |
1954 | 1959 | | |
1955 | 1960 | | |
1956 | | - | |
1957 | | - | |
1958 | | - | |
| 1961 | + | |
1959 | 1962 | | |
1960 | 1963 | | |
1961 | 1964 | | |
1962 | 1965 | | |
1963 | | - | |
1964 | | - | |
| 1966 | + | |
| 1967 | + | |
| 1968 | + | |
| 1969 | + | |
| 1970 | + | |
| 1971 | + | |
| 1972 | + | |
| 1973 | + | |
| 1974 | + | |
| 1975 | + | |
| 1976 | + | |
| 1977 | + | |
| 1978 | + | |
| 1979 | + | |
1965 | 1980 | | |
1966 | | - | |
1967 | | - | |
1968 | | - | |
| 1981 | + | |
1969 | 1982 | | |
| 1983 | + | |
| 1984 | + | |
| 1985 | + | |
| 1986 | + | |
| 1987 | + | |
| 1988 | + | |
| 1989 | + | |
| 1990 | + | |
1970 | 1991 | | |
1971 | 1992 | | |
1972 | 1993 | | |
| |||
Lines changed: 25 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1033 | 1033 | | |
1034 | 1034 | | |
1035 | 1035 | | |
| 1036 | + | |
| 1037 | + | |
| 1038 | + | |
| 1039 | + | |
| 1040 | + | |
| 1041 | + | |
| 1042 | + | |
| 1043 | + | |
| 1044 | + | |
| 1045 | + | |
| 1046 | + | |
| 1047 | + | |
| 1048 | + | |
| 1049 | + | |
| 1050 | + | |
| 1051 | + | |
| 1052 | + | |
| 1053 | + | |
| 1054 | + | |
| 1055 | + | |
| 1056 | + | |
| 1057 | + | |
| 1058 | + | |
| 1059 | + | |
| 1060 | + | |
1036 | 1061 | | |
1037 | 1062 | | |
1038 | 1063 | | |
| |||
0 commit comments