Commit 0ccebf5
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.
This change fixes the behavior of GC#copyArea() by explicitly buffering
the area to be copied. 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 60ef7e9 commit 0ccebf5
File tree
3 files changed
+63
-6
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
+63
-6
lines changedLines changed: 16 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
545 | 545 | | |
546 | 546 | | |
547 | 547 | | |
548 | | - | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
549 | 563 | | |
550 | 564 | | |
551 | 565 | | |
| 566 | + | |
552 | 567 | | |
553 | 568 | | |
554 | 569 | | |
| |||
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