Skip to content

Conversation

@amartya4256
Copy link
Contributor

This PR fixes the regression in #2346 caused by Region:copy. The copied region handle needs to be in the right state as of the original region handle since GC:getClipping(Region) can modify the original region's handle without storing region operations.

contributes to #2346

Note: This is a temporary fix and does not cover the effect for multi zoom scenarios for the case GC:getClipping(Region) is called. A proper follow up solution would be to implement operation strategy for the OS calls called in GC:getClipping(Region) for the region.

This commit fixes the regression in eclipse-platform#2346 caused by Region:copy. The
copied region handle needs to be in the right state as of the original
region handle since GC:getClipping(Region) can modify the original
region's handle without storing region operations.

contributes to eclipse-platform#2346
@github-actions
Copy link
Contributor

Test Results

   539 files   -  7     539 suites   - 7   34m 43s ⏱️ + 5m 45s
 4 358 tests  - 54   4 341 ✅  - 54   14 💤  - 3  2 ❌ +2  1 🔥 +1 
16 664 runs   - 54  16 535 ✅  - 56  126 💤  - 1  2 ❌ +2  1 🔥 +1 

For more details on these failures and errors, see this check.

Results for commit 59ffe67. ± Comparison against base commit 5b42ae5.

This pull request removes 54 tests.
AllWin32Tests ImageWin32Tests ‑ testDisposeDrawnImageBeforeRequestingTargetForOtherZoom
AllWin32Tests ImageWin32Tests ‑ testDrawImageAtDifferentZooms(boolean)[1] true
AllWin32Tests ImageWin32Tests ‑ testDrawImageAtDifferentZooms(boolean)[2] false
AllWin32Tests ImageWin32Tests ‑ testImageDataForDifferentFractionalZoomsShouldBeDifferent
AllWin32Tests ImageWin32Tests ‑ testImageShouldHaveDimesionAsPerZoomLevel
AllWin32Tests ImageWin32Tests ‑ testRetrieveImageDataAtDifferentZooms(boolean)[1] true
AllWin32Tests ImageWin32Tests ‑ testRetrieveImageDataAtDifferentZooms(boolean)[2] false
AllWin32Tests TestTreeColumn ‑ test_ColumnOrder
AllWin32Tests Test_org_eclipse_swt_dnd_DND ‑ testByteArrayTransfer
AllWin32Tests Test_org_eclipse_swt_dnd_DND ‑ testFileTransfer
…

HeikoKlare added a commit to vi-eclipse/eclipse.platform.swt that referenced this pull request Jul 24, 2025
…platform#2346

The GC#getClipping(Region) call sets the passed region to the current
clipping region of the GC. Currently, this is not represented as an
operation inside the passed Region, such that when calculating a handle
for a different zoom of that region or when copying that region the
according application of GC#getClipping(Region) to that region is
missing.

This change adds the missing operation to the Region. Since the clipping
needs to be calculated at the of executing the GC#getClipping(Region)
method and not at the time of applying the region operation when
retrieving a handle, the GC#getClipping(Region) stores an operation
inside GC that maintains handles for the according clipping region at
the time of executing the GC#getClipping(Region) method for every zoom
at which the GC is requested. This ensures that the proper clipping
state is available to the Region.

Fixes eclipse-platform#2347
@HeikoKlare HeikoKlare deleted the amartya/region_copy_fix branch July 24, 2025 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant