-
Notifications
You must be signed in to change notification settings - Fork 185
Set zoom for source image as GCzoom when the GC is not autoscalable #2507
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Set zoom for source image as GCzoom when the GC is not autoscalable #2507
Conversation
Test Results 118 files ±0 118 suites ±0 10m 42s ⏱️ +14s For more details on these failures, see this check. Results for commit d892d79. ± Comparison against base commit cbf7f7a. ♻️ This comment has been updated with latest results. |
e0927d3 to
e696e5c
Compare
e696e5c to
2b1cc49
Compare
|
Test failures are unrelated: #2516 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be possible to add a test for this to ensure that we do not accidentally run into the same situation again? Something like a simplified version of the snippet in #2504 with a very simple image in which you can easily assert based on specific pixel values if the image was properly sized or not.
bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/GC.java
Outdated
Show resolved
Hide resolved
61f063d to
deb956d
Compare
Added test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The change looks fine and it properly fixes #2504
I have tested with the snippet provided in that issue.
Thank you also for adding a proper regression test. I only have minor comments regarding that test.
...ipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_GC.java
Outdated
Show resolved
Hide resolved
...ipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_GC.java
Outdated
Show resolved
Hide resolved
15a9920 to
28d0e34
Compare
The calculated image zoom for the source image should be the same as the GCzoom(100) when the drawable of GC is not scalable Fixes: eclipse-platform#2504
28d0e34 to
d892d79
Compare
|
Caused regression in #2557 |
This regression is in the test added in the same commit I think the reason here would be e.gc.drawImage()'s draw request to the OS, might not have completed by the time gcCopy.copyArea() was called, in the test. This was a consideration which was thought of, to add readAndDispatch() call but could see there were no failures in the CI for linux when this PR was made so I decided to skip the call. |
The calculated image zoom for the source image should be the same as the GCzoom(100) when the drawable of GC is not scalable
Steps to reproduce
Run the snippet in #2504
With source and destination at 1:2 the image would be cropped without this change
Fixes: #2504