-
Notifications
You must be signed in to change notification settings - Fork 195
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
Adapt double buffering use cases for multi-zoom #2722
Adapt double buffering use cases for multi-zoom #2722
Conversation
45fafea
to
a2298c9
Compare
a2298c9
to
15ecdb7
Compare
Some minor additions on the PR:
This is how the improvement looks on GTK when switching from 100% to 150% scaling: Before the changesAfter the changes |
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 good to me. I have tested it on all platforms together with eclipse-platform/eclipse.platform.swt#1734 and found no issues, but I will also test again today with the final state of the merged SWT changes.
I only have a minor comment on a potential code simplification.
bundles/org.eclipse.jface.text/src/org/eclipse/jface/text/source/AnnotationRulerColumn.java
Outdated
Show resolved
Hide resolved
fc3aee2
to
6284318
Compare
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.
Thank you for adding the use cases to test @akoch-yatta .
I tested (in Windows) and found no regressions and also that the 2 mentioned use cases were fixed by this PR. I couldn't find any more glitches,
bundles/org.eclipse.jface.text/src/org/eclipse/jface/text/source/VerticalRuler.java
Show resolved
Hide resolved
448fe66
to
6ab9306
Compare
bundles/org.eclipse.jface.text/src/org/eclipse/jface/text/source/LineNumberRulerColumn.java
Show resolved
Hide resolved
6ab9306
to
dd3939f
Compare
This commit replaces three use cases where GC together with Images where used to draw double buffered images. With new multi-zoom-setting in Windows this leads to desctructive scaling and fragments caused by the double buffering of Images/GCs created with different zoom. The changes utilize the newly added ImageGcDrawer to provide a dynamic callback to draw on a correctly initialized GC on demand.
dd3939f
to
57666c4
Compare
This PR replaces three use cases where GC together with Images where used to draw double buffered images. With new multi-zoom-setting in Windows this leads to multiple issues like:
The changes utilize the newly added ImageGcDrawer to provide a dynamic callback to draw on a correctly initialized GC on demand.
Most important changes are:
How to test
You need to use the branch from Callback for dynamic drawing with a GC on images eclipse.platform.swt#1734 for SWT.
Either make sure you have the the experimental monitor specific flag enabled or use
-Dswt.autoScale.updateOnRuntime=true -Dswt.autoScale=quarter
as additional VM argumentsHave at least two monitors with different zoom (e.g. one with 100, one with 150), detach a view and move it to the second monitor. Then you should be able to create fragments or other glitches in the text editors e.g. by just resizing it -> resizing always retriggers a full re-creation.
Example for OverviewRuler and LineNumberRulerColumn
If you have a monitor setup with 200% and 100%, have both (main view and detached view) on 200%, move one to the 100% monitor and resize the view remaining on 200%. You will see:
Before it blurry scales the 100% variant of the image and blurry scales the line number
After it correctly fetches the 200% variant of the image and the line numbers are redrawn sharply
Example for not refreshed line numbers
Use the same setup as above: 200% and 100% monitor, have both (main view and detached view) on 200%, move one to the 100% monitor and resize the view remaining on 200%. You should see the line number not correctly refreshed on scrolling though a file anymore
Important: As it is quite visible I want to mention, that the DefaultRangeIndicator will still looks glitchy like
in some scenarios. This is an additional issue related to ImageData and the destructive scaling of ImageData and will be fixed in a separate PR. This is a pre-existing issue, but the monitor aware scaling makes it way more obvious.