Commit 5c2611d
committed
[GTK] Fix GC#copyArea() for overlapping source and target areas #1756
The GC provides a #copyArea() method that copies an area inside the
surface of the GC to another area in the same surface. When using a
surface directly created via the Cairo API (or with the GDK API on
Wayland), this operation is broken.
When the source and target area are overlapping and the source is
above-left of the target area, the source area will appear replicated in
the target area, as Cairo does not perform any buffering but does a
linewise/chunkwise write from the source area to the target area by
default.
This change fixes the behavior of GC#copyArea() by explicitly making
Cairo first pipe the copied area into an intermediate surface to be
painted into the actual target area afterwards. It also removes the
existing workaround in images
that avoids the instantiation of a surface via the Cairo API, as the
reason for that workaround was the issue fixed by this change. It
improves the behavior of consumers of that functionality on GTK4 and
Wayland. An according regression test is added.
Fixes #17561 parent 8d65ddc commit 5c2611d
File tree
3 files changed
+53
-5
lines changed- bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics
- tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit
3 files changed
+53
-5
lines changedLines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
548 | 548 | | |
549 | 549 | | |
550 | 550 | | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
551 | 555 | | |
| 556 | + | |
| 557 | + | |
552 | 558 | | |
553 | 559 | | |
554 | 560 | | |
| |||
Lines changed: 1 addition & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1260 | 1260 | | |
1261 | 1261 | | |
1262 | 1262 | | |
1263 | | - | |
1264 | | - | |
1265 | | - | |
1266 | | - | |
1267 | | - | |
| 1263 | + | |
1268 | 1264 | | |
1269 | 1265 | | |
1270 | 1266 | | |
| |||
Lines changed: 46 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
172 | 172 | | |
173 | 173 | | |
174 | 174 | | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
175 | 221 | | |
176 | 222 | | |
177 | 223 | | |
| |||
0 commit comments