Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 494035 - [HiDpi][Win32][GTK] Rendering issues on Neon due to the new SWT Auto-scaling feature
Summary: [HiDpi][Win32][GTK] Rendering issues on Neon due to the new SWT Auto-scaling ...
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.6   Edit
Hardware: PC All
: P3 critical (vote)
Target Milestone: 4.6 RC3   Edit
Assignee: Sravan Kumar Lakkimsetti CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 494145
  Show dependency tree
 
Reported: 2016-05-19 11:17 EDT by Remi Schnekenburger CLA
Modified: 2016-05-26 11:12 EDT (History)
12 users (show)

See Also:
markus.kell.r: review+
niraj.modi: review+
lshanmug: review+


Attachments
Comparison of 2 debug sessions on the same project with autoscaling disabled on the left and enabled on the right (424.12 KB, image/png)
2016-05-19 11:19 EDT, Remi Schnekenburger CLA
no flags Details
Example of background not correctly drawn (629.99 KB, image/png)
2016-05-23 04:02 EDT, Laurent Redor CLA
no flags Details
SampleProject.zip for steps to reproduce of comment 8 (2.19 KB, application/x-zip-compressed)
2016-05-23 05:50 EDT, Laurent Redor CLA
no flags Details
snippet to reproduce the problem (1.95 KB, text/x-java)
2016-05-24 09:03 EDT, Sravan Kumar Lakkimsetti CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Remi Schnekenburger CLA 2016-05-19 11:17:14 EDT
Since the update of the Eclipse Platform on SWT and auto-scaling, gmf-runtime based diagrams have issues to be rendered on some Windows platform. This can be for example reproduced on the geoshape example shipped with the modeling tools distribution

Usage of the argument -Dswt.enable.autoScale=false removes the graphical glitches.

Version of Eclipse:
Eclipse Modeling Tools

Version: Neon Milestone 7 (4.6.0M7)
Build id: 20160505-1310
Comment 1 Remi Schnekenburger CLA 2016-05-19 11:19:10 EDT
Created attachment 261863 [details]
Comparison of 2 debug sessions on the same project with autoscaling disabled on the left and enabled on the right
Comment 2 Anthony Hunter CLA 2016-05-20 10:48:12 EDT
I am trying to escalate this critical issue within our own IBM internal Eclipse support team to connect with the SWT team and determine what to do here.

If anyone on the CC list is aware of a code fix we can apply to the GMF Runtime please let us know.
Comment 3 Lakshmi P Shanmugam CLA 2016-05-23 02:37:00 EDT
(In reply to Remi Schnekenburger from comment #0)
> Since the update of the Eclipse Platform on SWT and auto-scaling,
> gmf-runtime based diagrams have issues to be rendered on some Windows
> platform. This can be for example reproduced on the geoshape example shipped
> with the modeling tools distribution
> 
> Usage of the argument -Dswt.enable.autoScale=false removes the graphical
> glitches.
> 
> Version of Eclipse:
> Eclipse Modeling Tools
> 
> Version: Neon Milestone 7 (4.6.0M7)
> Build id: 20160505-1310

Are you using a high resolution monitor? or using zoomed resolution, what is the zoom factor? Can you try with a more recent build like 4.6RC1 or 4.6RC2?
Comment 4 Sravan Kumar Lakkimsetti CLA 2016-05-23 03:03:13 EDT
(In reply to Lakshmi Shanmugam from comment #3)
> (In reply to Remi Schnekenburger from comment #0)
> > Since the update of the Eclipse Platform on SWT and auto-scaling,
> > gmf-runtime based diagrams have issues to be rendered on some Windows
> > platform. This can be for example reproduced on the geoshape example shipped
> > with the modeling tools distribution
> > 
> > Usage of the argument -Dswt.enable.autoScale=false removes the graphical
> > glitches.
> > 
> > Version of Eclipse:
> > Eclipse Modeling Tools
> > 
> > Version: Neon Milestone 7 (4.6.0M7)
> > Build id: 20160505-1310
> 
> Are you using a high resolution monitor? or using zoomed resolution, what is
> the zoom factor? Can you try with a more recent build like 4.6RC1 or 4.6RC2?

By default windows runs at 125%. In M7 we supported 25% intervals. Due to this they are seeing this problem. In RC1 we have reverted to 100% multiples. They may not see this problem now. 

We definitely need to test it at 200% to confirm whether this problem exists or not.
Comment 5 Laurent Redor CLA 2016-05-23 03:58:17 EDT
As explained in bug 494145, I reproduce the problem with this configuration:
* Windows 10
* Resolution : 3840x2160
* Font size modification : 250% (recommanded)
* org.eclipse.swt.internal.deviceZoom=200
* java.runtime.version=1.8.0_77-b03
* org.eclipse.draw2d.sdk (3.10.100.201605020204) "Draw2d"
* org.eclipse.gmf.runtime.sdk (1.10.0.201605032009) "Graphical Modeling Framework Runtime SDK"
Comment 6 Laurent Redor CLA 2016-05-23 04:02:01 EDT
Created attachment 261933 [details]
Example of background not correctly drawn

With the above configuration, it seems that there is a link between the backgound shift and the org.eclipse.swt.internal.deviceZoom (200%).
Comment 7 Niraj Modi CLA 2016-05-23 05:21:17 EDT
Couple of queries:
1. Do you have any simplified SWT snippet to reproduce this issue at our end.
Please share detailed steps to reproduce this issue, suggest you to give it a try with latest Eclipse RC1 J2EE build(it has may important fixes w.r.t. HighDPI)
https://www.eclipse.org/downloads/packages/eclipse-ide-java-ee-developers/neonrc1
 
2. Can you see this issue on Linux/GTK at 200% zoom settings ?
Comment 8 Laurent Redor CLA 2016-05-23 05:49:38 EDT
(In reply to Niraj Modi from comment #7)
> Couple of queries:
> 1. Do you have any simplified SWT snippet to reproduce this issue at our end.
> Please share detailed steps to reproduce this issue, suggest you to give it
> a try with latest Eclipse RC1 J2EE build(it has may important fixes w.r.t.
> HighDPI)
> https://www.eclipse.org/downloads/packages/eclipse-ide-java-ee-developers/
> neonrc1
>  

I have not really a simple snippet. But I have scenario with a fresh NeonRc1 modeling install:
1- Download Eclipse Neon RC1 Modeling: http://www.eclipse.org/downloads/packages/eclipse-modeling-tools/neonrc1
2- Create a new "Modeling Project"
3- Create a new "Ecore Model" in this project
4- Activate the Viewpoint "Design" on this project: use contextual menu "Viewpoints Selection" on the project
5- Create a diagram of the root package of the ecore file: use contextual menu "New Representation/xxx class diagram" on the root package of ecore file
6- Add a Note in this diagram: KO, the background of the Node is not correctly drawn.
6bis- Step 2 to 6 can be replaced by importing the project from SampleProject.zip and open diagram "root class diagram"

> 2. Can you see this issue on Linux/GTK at 200% zoom settings ?

I try it on a virtual box with the above scenario and the problem is here.
Comment 9 Laurent Redor CLA 2016-05-23 05:50:25 EDT
Created attachment 261937 [details]
SampleProject.zip for steps to reproduce of comment 8
Comment 10 Sravan Kumar Lakkimsetti CLA 2016-05-23 14:04:30 EDT
Thank you for providing the steps. We found the root cause this problem is there in the SWT layer.

In GMF drawing the background is done in the following steps

1. Get the points list (corners/vertices)
2. create SWT Path (at this point the SWT scales up the points and addtem to the path)
3. Get the points list from the SWT Path (extract the points again from the created path)
4. Scale up or down based on the zoom selected in the diagram(please note this is zoom at GMF level)
5. recreate the path
6. Use it to fill the background

here at step 3 SWT in required to scaledown the points list. But this is missed. Due to this the background dimensions are not calculated correctly. Actually scaling is getting applied twice at step 2 and step 5. This the root cause. the fix is very simple and I will attach gerrit patch very shortly
Comment 11 Eclipse Genie CLA 2016-05-23 14:07:03 EDT
New Gerrit change created: https://git.eclipse.org/r/73418
Comment 12 Niraj Modi CLA 2016-05-24 07:36:57 EDT
(In reply to Eclipse Genie from comment #11)
> New Gerrit change created: https://git.eclipse.org/r/73418

+1
Latest patch looks good to me, verified tested on Win7 as per steps in comment 8 on the bug.
Comment 13 Sravan Kumar Lakkimsetti CLA 2016-05-24 09:03:39 EDT
Created attachment 261974 [details]
snippet to reproduce the problem
Comment 14 Markus Keller CLA 2016-05-24 10:32:45 EDT
Pushed patch set 4 that removes a redundant "if (isDisposed()) ..." on Windows.

+1 for RC3. Verified on GTK3 and Win 7.
Comment 16 Sravan Kumar Lakkimsetti CLA 2016-05-26 07:44:09 EDT
Verified on I20160525-2000 in linux 64 bit.
Comment 17 Niraj Modi CLA 2016-05-26 11:12:58 EDT
Verified the fix in Build id: I20160525-2000 on Win7.