Skip to content

Conversation

@amartya4256
Copy link
Contributor

This PR refactors GC.SetClippingRegionOperation to store Region and hence refactors GC:setClipping(Region) to call the Operation instead of GC:setClipping(long) for a better behaviour on a GC refresh. Additionally this PR also makes Region operations compatible with GC Operation Strategy by following:

  1. Copy Resource on Operation Creation
  2. Register the region object as a disposable

Contributes to
#62 and #128

@github-actions
Copy link
Contributor

github-actions bot commented Jul 22, 2025

Test Results

   546 files  ±0     546 suites  ±0   30m 55s ⏱️ -4s
 4 412 tests ±0   4 395 ✅ ±0   17 💤 ±0  0 ❌ ±0 
16 718 runs  ±0  16 591 ✅ ±0  127 💤 ±0  0 ❌ ±0 

Results for commit eb8fb59. ± Comparison against base commit 3bfde61.

♻️ This comment has been updated with latest results.

Copy link
Contributor

@HeikoKlare HeikoKlare left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes look sound to me. I have tested them also with GEF Classic, as GEF Classic makes quite some use of this functionality and did not find any issues yet.

I have some rather minor proposals for improvement to avoid unnecessary disposal checks and other executions.

This commit refactors GC.SetClippingRegionOperation to store Region and
hence refactors GC:setClipping(Region) to call the Operation instead of
GC:setClipping(long) for a better behaviour on a GC refresh.

Contributes to
eclipse-platform#62 and
eclipse-platform#128
@amartya4256 amartya4256 force-pushed the amartya4256/gc_set_clipping_fix branch from 1dc4da2 to eb8fb59 Compare July 23, 2025 11:25
Copy link
Member

@fedejeanne fedejeanne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

I tested with the org.eclipse.swt.examples.graphics.GraphicsExample application and passing -Dswt.autoScale=quarter and -Dswt.autoScale.updateOnRuntime=true as parameters.

This one runs through your code:
image

@fedejeanne fedejeanne merged commit 7cf1145 into eclipse-platform:master Jul 23, 2025
17 checks passed
@fedejeanne fedejeanne deleted the amartya4256/gc_set_clipping_fix branch July 23, 2025 13:00
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.

Refactor GC:setClipping(Region) to store Region Object instead of a handle

3 participants