Community
Participate
Working Groups
The following tests in AdvancedGraphicsTests fail on at least one platform. testInterpolation() testPathDraw() testPathFill() They have been commented out for now and are most likely caused by bugs in SWT. Regardless, we should investigate the problems and open bugs against SWT.
Verified that testInterpolation() and testPathFill() run without problems on Mac OS X Carbon and Cocoa, while testPathDraw() fails on both platforms.
The problem seems to be related to the fact that either SWTGraphics or in the underlying GC path drawing does not seem to be side-effect free. When executing each test within testPathDraw() individually (by uncommenting all others and running the test) it does not lead to problems (as the SWTGraphics and GC are disposed by teardown() and replaced by new instances by setUp() in between). If however changing the method to execute the tests individually but without diposing/creating new GC/SWTGraphics in between (as listed below) on Mac Cocoa (with SWT 3.7M5) an invalid memory access error (Invalid memory access of location 0x11c07b1cc rip=0x7fff832dfb3a) can be reproduced. public void testPathDraw() { class PathSettings implements Runnable { private final int antialias; private final Color color; private final int style; private final int width; PathSettings(int antialias, int width, int style, Color color) { this.antialias = antialias; this.width = width; this.style = style; this.color = color; } public void run() { g.setAntialias(antialias); g.setLineWidth(width); g.setLineStyle(style); g.setForegroundColor(color); } } g.setBackgroundColor(ColorConstants.darkBlue); Runnable tests[] = new Runnable[5]; tests[0] = new PathSettings(SWT.ON, 3, SWT.LINE_SOLID, ColorConstants.darkBlue); tests[1] = new PathSettings(SWT.OFF, 0, SWT.LINE_DOT, ColorConstants.red); tests[2] = new PathSettings(SWT.DEFAULT, 1, SWT.LINE_DOT, ColorConstants.darkBlue); tests[3] = new PathSettings(SWT.DEFAULT, 2, SWT.LINE_DOT, ColorConstants.darkGreen); tests[4] = new PathSettings(SWT.ON, 2, SWT.LINE_DASHDOTDOT, ColorConstants.black); for (int i = 0; i < tests.length; i++) { performTestcase(new Runnable() { public void run() { g.drawPath(path1); g.drawPath(path2); } }, new Runnable[] { tests[i] }); } }
> If however changing the method to execute the tests individually but without > diposing/creating new GC/SWTGraphics in between (as listed below) on Mac Cocoa > (with SWT 3.7M5) an invalid memory access error (Invalid memory access of > location 0x11c07b1cc rip=0x7fff832dfb3a) can be reproduced. You need to report this to the SWT team with minimum set of steps on how to reproduce.
(In reply to comment #3) > > If however changing the method to execute the tests individually but without > > diposing/creating new GC/SWTGraphics in between (as listed below) on Mac Cocoa > > (with SWT 3.7M5) an invalid memory access error (Invalid memory access of > > location 0x11c07b1cc rip=0x7fff832dfb3a) can be reproduced. > > You need to report this to the SWT team with minimum set of steps on how to > reproduce. Yes, I know. I am currently working on an SWT-only snippet to reproduce it.
(In reply to comment #1) > Verified that testInterpolation() and testPathFill() run without problems on > Mac OS X Carbon and Cocoa, while testPathDraw() fails on both platforms. On Windows 7, testInterpolation() and testDrawPath() fails.
(In reply to comment #5) > (In reply to comment #1) > > Verified that testInterpolation() and testPathFill() run without problems on > > Mac OS X Carbon and Cocoa, while testPathDraw() fails on both platforms. > > On Windows 7, testInterpolation() and testDrawPath() fails. The same holds for Windows XP. On Ubuntu, all tests run fine. The HACK within assertImageEquality to tolerate a color difference of 4 does not seem to be needed (a difference of 1 is also enough on all platforms where the respective tests succeed).
(In reply to comment #4) > (In reply to comment #3) > > > If however changing the method to execute the tests individually but without > > > diposing/creating new GC/SWTGraphics in between (as listed below) on Mac Cocoa > > > (with SWT 3.7M5) an invalid memory access error (Invalid memory access of > > > location 0x11c07b1cc rip=0x7fff832dfb3a) can be reproduced. > > > > You need to report this to the SWT team with minimum set of steps on how to > > reproduce. > > Yes, I know. I am currently working on an SWT-only snippet to reproduce it. Reported this as SWT bug #340214.
(In reply to comment #5) > (In reply to comment #1) > > Verified that testInterpolation() and testPathFill() run without problems on > > Mac OS X Carbon and Cocoa, while testPathDraw() fails on both platforms. > > On Windows 7, testInterpolation() and testDrawPath() fails. Actually, on Windows 7 the discrepancy between the related two path images can be observed with the naked eye. On Mac and Windows XP it is less obvious.
Opened SWT bug #340256 to keep track of the interpolation problem that occurs on Windows (attached an SWT-only snippet to reproduce the underlying problem there).