| Summary: | [HiDPI][GTK] Path cubic curves are not auto-scaled correctly with HiDPI settings | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Peter Severin <peter> | ||||||||||||||
| Component: | SWT | Assignee: | Sravan Kumar Lakkimsetti <sravankumarl> | ||||||||||||||
| Status: | VERIFIED FIXED | QA Contact: | |||||||||||||||
| Severity: | blocker | ||||||||||||||||
| Priority: | P3 | CC: | arunkumar.thondapu, daniel_megert, lshanmug, lufimtse, markus.kell.r, niraj.modi, sravankumarl | ||||||||||||||
| Version: | 4.6 | Flags: | markus.kell.r:
review+
lshanmug: review+ niraj.modi: review+ |
||||||||||||||
| Target Milestone: | 4.6 RC4 | ||||||||||||||||
| Hardware: | PC | ||||||||||||||||
| OS: | Linux | ||||||||||||||||
| See Also: |
https://git.eclipse.org/r/73902 https://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=ed5e45664229e6b5ca67a044b19e5e7f6c9faa0d |
||||||||||||||||
| Whiteboard: | |||||||||||||||||
| Bug Depends on: | |||||||||||||||||
| Bug Blocks: | 479614 | ||||||||||||||||
| Attachments: |
|
||||||||||||||||
Created attachment 262045 [details]
Cubic curve no scaling
Created attachment 262046 [details]
Cubic curve x2 scaling
Created attachment 262047 [details]
Snippet10 no scaling
Created attachment 262048 [details]
Snippet10 x2 scaling
Created attachment 262067 [details]
Win7: Output of Snippet10 and TestSnippet at 200% Zoom
Works fine on Win7 200%Zoom.
It looks like the x, y arguments in Path#cubicTo are not scaled on cairo graphics.
Here's the windows version:
public void cubicTo (float cx1, float cy1, float cx2, float cy2, float x, float y) {
cx1 = DPIUtil.autoScaleUp(cx1);
cy1 = DPIUtil.autoScaleUp(cy1);
cx2 = DPIUtil.autoScaleUp(cx2);
cy2 = DPIUtil.autoScaleUp(cy2);
x = DPIUtil.autoScaleUp(x);
y = DPIUtil.autoScaleUp(y);
cubicToInPixels(cx1, cy1, cx2, cy2, x, y);
}
Here's cairo version:
public void cubicTo(float cx1, float cy1, float cx2, float cy2, float x, float y) {
if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
cx1 = DPIUtil.autoScaleUp(cx1);
cy1 = DPIUtil.autoScaleUp(cy1);
cx2 = DPIUtil.autoScaleUp(cx2);
cy2 = DPIUtil.autoScaleUp(cy2);
cubicToInPixels(cx1, cy1, cx2, cy2, x, y);
}
quadTo on cairo has the same problem.
(In reply to Peter Severin from comment #6) > It looks like the x, y arguments in Path#cubicTo are not scaled on cairo > graphics. > > Here's the windows version: > > public void cubicTo (float cx1, float cy1, float cx2, float cy2, float x, > float y) { > cx1 = DPIUtil.autoScaleUp(cx1); > cy1 = DPIUtil.autoScaleUp(cy1); > cx2 = DPIUtil.autoScaleUp(cx2); > cy2 = DPIUtil.autoScaleUp(cy2); > x = DPIUtil.autoScaleUp(x); > y = DPIUtil.autoScaleUp(y); > cubicToInPixels(cx1, cy1, cx2, cy2, x, y); > } > > Here's cairo version: > > public void cubicTo(float cx1, float cy1, float cx2, float cy2, float x, > float y) { > if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED); > cx1 = DPIUtil.autoScaleUp(cx1); > cy1 = DPIUtil.autoScaleUp(cy1); > cx2 = DPIUtil.autoScaleUp(cx2); > cy2 = DPIUtil.autoScaleUp(cy2); > cubicToInPixels(cx1, cy1, cx2, cy2, x, y); > } > > quadTo on cairo has the same problem. Hi, Thank you for the analysis. Can you please let us know if this problem is affecting any products or epp packages? if so can you please point us to the bug associated. Thanks Sravan I am not in position to provide this information. I'm reproducing this bug with my own product (WireframeSketcher plugin) that I am testing with Eclipse 4.6. WireframeSketcher is unusable in the presence of this bug. New Gerrit change created: https://git.eclipse.org/r/73902 This bug affects the drawing of curves. I believe this will impact graphics packages like GEF, GMF etc. In my opinion this should be fixed for 4.6. The code change is quite simple. There are couple of places I missed to scaleup the coordinates. one for cubic curve and another for font. This doesnot affect Windows as these changes are already there is Windows. I have tested this using graphics example available in swt examples. Once all the approvals are in place we would like to push this to RC4. Risk assessment: low. Affected clients: Only GTK code that uses org.eclipse.swt.graphics.Path. The Path class is not used in SDK, which explains (but doesn't excuse) why this was not detected earlier. The code changes are small, local, and easy to understand. Gerrit change https://git.eclipse.org/r/73902 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=ed5e45664229e6b5ca67a044b19e5e7f6c9faa0d Verified in build 4.6.0.I20160530-2000 on Ubuntu 15.10 |
Created attachment 262044 [details] Test case for reproducing cubic curve scaling problem I am testing HiDPI auto scaling and comparing results of no-scaling and x2 scaling, and I see some scaling problems with SWT Paths. Specifically, it looks like cubic curves are not scaled correctly, but perhaps the bug is present in quad curves too. Moveto and Lineto operations seems to be scaled correctly. I've attached a snippet that shows the curve drawing differences between 2 scaling settings. I've also noticed differences when running SWT Snippet10 (draw using transformations, paths and alpha blending). I'm not sure if it's the same but, but I've attached images for this test too. I'm testing with the latest integration build I20160525-2000. I'm testing with Debian, but I believe that the bug is not platform specific.