aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2020-01-06 18:58:01 +0100
committerSven Gothel <[email protected]>2020-01-06 18:58:01 +0100
commit141fa0fba0f47851f20acfcb078e11659ebc74cc (patch)
treef48b53ab99bc6682aaadc81abcbf0b3801ed8984
parent0209655c26e9240639c5f0a76ca6ca54ae0584b1 (diff)
Bug 1421: Tackle wrong position of TabFolder, SashForm etc
getClientArea() on MacOS produces a 'difficult' result regarding the position, which usually is returned as zero. Using a zero position issues the bug w/ SashForm, where the offset doesn't seems to be covered by the native NSView nor an SWT parent Composition. Then using the getLocation() as is (i.e. the view's frame position) may also cause issues with the TabFolder, as it includes the tab's trimming. Here the native NSView 's position includes the tab's trimming, gladly the parent (TabFolder or a Composition)'s clientArea includes this offset. Therefor, as a testbed - on OSX, getClientArea2(..) returns - position: getLocation() - getParent().getClientArea().position - size: getSize() This at least works OK'sh using - no special layout parent - TabFolder - SashForm ++++ Unit test TestGLCanvasSWTNewtCanvasSWTPosInTabs: Adding 'addComposite' to test matrix. 'addComposite' wraps our GLCanvas or NewtCanvasSWT into a Composite instead of adding it directly into the layouting parent. It demonstrates an issue with the new test 'test32_NewtCanvasSWTTabSashGLWComp', i.e. the NewtCanvasSWT is shown on the left as the SashForm's offset is being dropped. Summary: - No more issues with High-DPI pixelScale observed! - GLCanvas is being most well layouted, no issues in tests - NewtCanvasSWT may show severe positioning issues -> test32_NewtCanvasSWTTabSashGLWComp - NewtCanvasSWT always shows a small positioning offset into the lower-right corner w/ overlapping - NewtCanvasSWT overall positioning is not perfectly understood - NewtCanvasSWT misses to hide the NEWT child when changing tabs in TabFolder
-rw-r--r--src/newt/classes/com/jogamp/newt/swt/NewtCanvasSWT.java82
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/swt/TestGLCanvasSWTNewtCanvasSWTPosInTabs.java132
2 files changed, 154 insertions, 60 deletions
diff --git a/src/newt/classes/com/jogamp/newt/swt/NewtCanvasSWT.java b/src/newt/classes/com/jogamp/newt/swt/NewtCanvasSWT.java
index fe1dab3c3..35458b9cc 100644
--- a/src/newt/classes/com/jogamp/newt/swt/NewtCanvasSWT.java
+++ b/src/newt/classes/com/jogamp/newt/swt/NewtCanvasSWT.java
@@ -55,6 +55,7 @@ import jogamp.newt.swt.SWTEDTUtil;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.internal.DPIUtil;
import org.eclipse.swt.widgets.Canvas;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Event;
@@ -131,8 +132,8 @@ public class NewtCanvasSWT extends Canvas implements NativeWindowHolder, WindowC
SWTAccessor.setRealized(this, true);
- clientAreaPixels = SWTAccessor.getClientAreaInPixels(this);
- clientAreaWindow = getClientArea();
+ clientAreaPixels = getClientArea2InPixels();
+ clientAreaWindow = getClientArea2();
if( 0 < clientAreaWindow.width && 0 < clientAreaWindow.height ) {
pixelScale[0] = clientAreaPixels.width / clientAreaWindow.width;
pixelScale[1] = clientAreaPixels.height / clientAreaWindow.height;
@@ -215,6 +216,50 @@ public class NewtCanvasSWT extends Canvas implements NativeWindowHolder, WindowC
addListener (SWT.Dispose, listener);
}
+ private Rectangle getClientArea2() {
+ final Rectangle r = this.getClientArea();
+ if( SWTAccessor.isOSX ) {
+ // On MacOS SWT implementation is as follows:
+ // Scrollable.getClientArea():
+ // - Either using scrollView.contenview.bounds.position and scrollView.contentSize
+ // - Or using 0/0 and view.bounds.size
+ //
+ // Control's getSize() and getLocation() uses position and size of topView().frame()
+ //
+ final Rectangle parentClientArea = getParent().getClientArea();
+ final org.eclipse.swt.graphics.Point l = getLocation();
+ final org.eclipse.swt.graphics.Point s = getSize();
+ if( DEBUG ) {
+ System.err.println("XXX parent.clientArea: "+parentClientArea);
+ System.err.println("XXX clientArea: "+r);
+ System.err.println("XXX location: "+l);
+ System.err.println("XXX size: "+s);
+ }
+ // Bug 1421
+ // Subtracting parentClientArea's position fixes using:
+ // - CTabFolder parent: y-position no more pushed down about tab-height (parentClientArea.x/y)
+ // - SashForm parent: Offset is preserved, as it is not part of parentClientArea.x/y
+ // Notable, this almost mimics the original 'getClientArea()' but
+ // preserves SashForm's offset.
+ //
+ // The resulting offset still shows a 1-2 pixel x/y
+ // lower-left corner overlap ..
+ // Our GLCanvas doesn't show this behavior.
+ r.x = l.x - parentClientArea.x; // FIXME +1?
+ r.y = l.y - parentClientArea.y; // FIXME -1?
+ r.width = s.x;
+ r.height = s.y;
+ if( DEBUG ) {
+ System.err.println("XXX clientArea2:"+r);
+ }
+ }
+ return r;
+ }
+ private Rectangle getClientArea2InPixels() {
+ // SWTAccessor.getClientAreaInPixels(this);
+ return DPIUtil.autoScaleUp(getClientArea2());
+ }
+
@Override
public void setBounds(final int x, final int y, final int width, final int height) {
super.setBounds(x, y, width, height);
@@ -270,38 +315,40 @@ public class NewtCanvasSWT extends Canvas implements NativeWindowHolder, WindowC
}
protected final void updatePosSizeCheck(final boolean updatePos) {
+ final Rectangle oClientAreaWindow = clientAreaWindow;
+ final Rectangle nClientAreaPixels = getClientArea2InPixels();
+ final Rectangle nClientAreaWindow = getClientArea2();
final boolean sizeChanged, posChanged;
- Rectangle nClientAreaPixels = SWTAccessor.getClientAreaInPixels(this);
{
- final Rectangle oClientAreaPixels = clientAreaPixels;
- sizeChanged = nClientAreaPixels.width != oClientAreaPixels.width || nClientAreaPixels.height != oClientAreaPixels.height;
- posChanged = nClientAreaPixels.x != oClientAreaPixels.x || nClientAreaPixels.y != oClientAreaPixels.y;
+ sizeChanged = nClientAreaWindow.width != oClientAreaWindow.width || nClientAreaWindow.height != oClientAreaWindow.height;
+ posChanged = nClientAreaWindow.x != oClientAreaWindow.x || nClientAreaWindow.y != oClientAreaWindow.y;
if( sizeChanged || posChanged ) {
clientAreaPixels = nClientAreaPixels;
- clientAreaWindow = getClientArea();
- if( 0 < clientAreaWindow.width && 0 < clientAreaWindow.height ) {
- pixelScale[0] = clientAreaPixels.width / clientAreaWindow.width;
- pixelScale[1] = clientAreaPixels.height / clientAreaWindow.height;
+ clientAreaWindow = nClientAreaWindow;
+ if( 0 < nClientAreaWindow.width && 0 < nClientAreaWindow.height ) {
+ pixelScale[0] = nClientAreaPixels.width / nClientAreaWindow.width;
+ pixelScale[1] = nClientAreaPixels.height / nClientAreaWindow.height;
} else {
pixelScale[0] = 1f;
pixelScale[1] = 1f;
}
- } else {
- nClientAreaPixels = clientAreaPixels;
}
}
if(DEBUG) {
final long nsh = newtChildReady ? newtChild.getSurfaceHandle() : 0;
System.err.println("NewtCanvasSWT.updatePosSizeCheck: sizeChanged "+sizeChanged+", posChanged "+posChanged+", updatePos "+updatePos+
", ("+Thread.currentThread().getName()+"): newtChildReady "+newtChildReady+
- ", pixel "+clientAreaPixels.x+"/"+clientAreaPixels.y+" "+clientAreaPixels.width+"x"+clientAreaPixels.height+
- ", window "+clientAreaWindow.x+"/"+clientAreaWindow.y+" "+clientAreaWindow.width+"x"+clientAreaWindow.height+
+ ", pixel "+nClientAreaPixels.x+"/"+nClientAreaPixels.y+" "+nClientAreaPixels.width+"x"+nClientAreaPixels.height+
+ ", window "+nClientAreaWindow.x+"/"+nClientAreaWindow.y+" "+nClientAreaWindow.width+"x"+nClientAreaWindow.height+
", scale "+pixelScale[0]+"/"+pixelScale[1]+
" - surfaceHandle 0x"+Long.toHexString(nsh));
+ System.err.println("NewtCanvasSWT.updatePosSizeCheck.self: pixel-units pos "+SWTAccessor.getLocationInPixels(this)+", size "+SWTAccessor.getSizeInPixels(this));
+ System.err.println("NewtCanvasSWT.updatePosSizeCheck.self: window-units pos "+this.getLocation()+", size "+this.getSize());
+ System.err.println("NewtCanvasSWT.updatePosSizeCheck.self: LOS.0: "+SWTAccessor.getLocationOnScreen(new Point(), this));
}
if( sizeChanged ) {
if( newtChildReady ) {
- newtChild.setSize(clientAreaWindow.width, clientAreaWindow.height);
+ newtChild.setSize(nClientAreaWindow.width, nClientAreaWindow.height);
newtChild.setSurfaceScale(pixelScale);
} else {
postSetSize = true;
@@ -309,11 +356,14 @@ public class NewtCanvasSWT extends Canvas implements NativeWindowHolder, WindowC
}
if( updatePos && posChanged ) {
if( newtChildReady ) {
- newtChild.setPosition(clientAreaWindow.x, clientAreaWindow.y);
+ newtChild.setPosition(nClientAreaWindow.x, nClientAreaWindow.y);
} else {
postSetPos = true;
}
}
+ if( DEBUG ) {
+ System.err.println("NewtCanvasSWT.updatePosSizeCheck.X END");
+ }
}
@Override
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/swt/TestGLCanvasSWTNewtCanvasSWTPosInTabs.java b/src/test/com/jogamp/opengl/test/junit/jogl/swt/TestGLCanvasSWTNewtCanvasSWTPosInTabs.java
index 597fe1b0b..776c72385 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/swt/TestGLCanvasSWTNewtCanvasSWTPosInTabs.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/swt/TestGLCanvasSWTNewtCanvasSWTPosInTabs.java
@@ -56,7 +56,6 @@ import org.eclipse.swt.widgets.Shell;
import org.junit.After;
import org.junit.Assert;
import org.junit.Assume;
-import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.FixMethodOrder;
import org.junit.Test;
@@ -108,7 +107,6 @@ public class TestGLCanvasSWTNewtCanvasSWTPosInTabs extends UITestCase {
CTabItem tabItem1 = null;
CTabItem tabItem2 = null;
SashForm sash = null;
- Composite sashRightComposite = null;
static PointImmutable wpos = null;
static DimensionImmutable wsize = new Dimension(640, 480), rwsize = null;
@@ -124,9 +122,6 @@ public class TestGLCanvasSWTNewtCanvasSWTPosInTabs extends UITestCase {
if( null != display ) {
display.syncExec(new Runnable() {
public void run() {
- if( null != sashRightComposite ) {
- sashRightComposite.dispose();
- }
if( null != sash ) {
sash.dispose();
}
@@ -159,7 +154,6 @@ public class TestGLCanvasSWTNewtCanvasSWTPosInTabs extends UITestCase {
tabItem1 = null;
tabItem2 = null;
sash = null;
- sashRightComposite = null;
}
class WaitAction implements Runnable {
@@ -180,7 +174,7 @@ public class TestGLCanvasSWTNewtCanvasSWTPosInTabs extends UITestCase {
final WaitAction waitAction = new WaitAction(AWTRobotUtil.TIME_SLICE);
final WaitAction generalWaitAction = new WaitAction(10);
- protected void runTestInLayout(final boolean focusOnTab1, final boolean useNewtCanvasSWT, final GLCapabilitiesImmutable caps)
+ protected void runTestInLayout(final boolean focusOnTab1, final boolean useNewtCanvasSWT, final boolean addComposite, final GLCapabilitiesImmutable caps)
throws InterruptedException
{
display = new Display();
@@ -190,6 +184,9 @@ public class TestGLCanvasSWTNewtCanvasSWTPosInTabs extends UITestCase {
shell.setText( getSimpleTestName(".") );
shell.setLayout(new FillLayout());
shell.setSize( wsize.getWidth(), wsize.getHeight() );
+ if( null != wpos ) {
+ shell.setLocation(wpos.getX(), wpos.getY());
+ }
composite = new Composite(shell, SWT.NONE);
composite.setLayout(new FillLayout());
@@ -200,14 +197,14 @@ public class TestGLCanvasSWTNewtCanvasSWTPosInTabs extends UITestCase {
tabItem1.setText("PlainGL");
tabItem2 = new CTabItem(tabFolder, SWT.NONE, 1);
tabItem2.setText("SashGL");
- sash = new SashForm(tabFolder, SWT.NONE);
- Assert.assertNotNull( sash );
- final org.eclipse.swt.widgets.Label c = new org.eclipse.swt.widgets.Label(sash, SWT.NONE);
- c.setText("Left cell");
- sashRightComposite = new Composite(sash, SWT.NONE);
- Assert.assertNotNull( sashRightComposite );
- sashRightComposite.setLayout( new FillLayout() );
- tabItem2.setControl(sash);
+ final Composite tab1Comp;
+ if( addComposite ) {
+ tab1Comp = new Composite(tabFolder, SWT.NONE);
+ tab1Comp.setLayout(new FillLayout());
+ tabItem1.setControl(tab1Comp);
+ } else {
+ tab1Comp = null;
+ }
final GLWindow glWindow1;
final NewtCanvasSWT newtCanvasSWT1;
@@ -219,22 +216,37 @@ public class TestGLCanvasSWTNewtCanvasSWTPosInTabs extends UITestCase {
glWindow1 = GLWindow.create(caps);
glad1 = glWindow1;
Assert.assertNotNull(glWindow1);
- newtCanvasSWT1 = NewtCanvasSWT.create( tabFolder, 0, glWindow1 );
+ newtCanvasSWT1 = NewtCanvasSWT.create( addComposite ? tab1Comp : tabFolder, 0, glWindow1 );
Assert.assertNotNull( newtCanvasSWT1 );
canvas1 = newtCanvasSWT1;
} else {
glWindow1 = null;
newtCanvasSWT1 = null;
- glCanvas1 = GLCanvas.create( tabFolder, 0, caps, null);
+ glCanvas1 = GLCanvas.create( addComposite ? tab1Comp : tabFolder, 0, caps, null);
glad1 = glCanvas1;
Assert.assertNotNull(glCanvas1);
canvas1 = glCanvas1;
}
Assert.assertNotNull(canvas1);
Assert.assertNotNull(glad1);
- tabItem1.setControl(canvas1);
final GearsES2 demo1 = new GearsES2(1);
glad1.addGLEventListener(demo1);
+ if( !addComposite ) {
+ tabItem1.setControl(canvas1);
+ }
+
+ sash = new SashForm(tabFolder, SWT.NONE);
+ Assert.assertNotNull( sash );
+ final org.eclipse.swt.widgets.Label c = new org.eclipse.swt.widgets.Label(sash, SWT.NONE);
+ c.setText("Left cell");
+ final Composite sashRight;
+ if( addComposite ) {
+ sashRight = new Composite(sash, SWT.NONE);
+ sashRight.setLayout(new FillLayout());
+ } else {
+ sashRight = null;
+ }
+ tabItem2.setControl(sash);
final Animator animator1 = new Animator();
animator1.setModeBits(false, AnimatorBase.MODE_EXPECT_AWT_RENDERING_THREAD);
@@ -250,11 +262,11 @@ public class TestGLCanvasSWTNewtCanvasSWTPosInTabs extends UITestCase {
glad2 = glWindow2;
glCanvas2 = null;
Assert.assertNotNull(glWindow2);
- newtCanvasSWT2 = NewtCanvasSWT.create( sashRightComposite, 0, glWindow2 );
+ newtCanvasSWT2 = NewtCanvasSWT.create( addComposite ? sashRight : sash, 0, glWindow2 );
Assert.assertNotNull( newtCanvasSWT2 );
canvas2 = newtCanvasSWT2;
} else {
- glCanvas2 = GLCanvas.create( sashRightComposite, 0, caps, null);
+ glCanvas2 = GLCanvas.create( addComposite ? sashRight : sash, 0, caps, null);
glad2 = glCanvas2;
glWindow2 = null;
Assert.assertNotNull(glCanvas2);
@@ -338,24 +350,26 @@ public class TestGLCanvasSWTNewtCanvasSWTPosInTabs extends UITestCase {
shell.open(); // from here on, manipulation of SWT elements might be thread sensitive
+ Assert.assertEquals(true, GLTestUtil.waitForRealized( focusOnTab1 ? glad1 : glad2, true, waitAction));
+ {
+ final Canvas canvas = focusOnTab1 ? canvas1 : canvas2;
+ System.err.println("Canvas pixel-units pos/siz.0: pos "+SWTAccessor.getLocationInPixels(canvas)+", size "+SWTAccessor.getSizeInPixels(canvas));
+ System.err.println("Canvas window-units pos/siz.0: pos "+canvas.getLocation()+", size "+canvas.getSize());
+ System.err.println("Canvas LOS.0: "+SWTAccessor.getLocationOnScreen(new Point(), canvas));
+ }
if( useNewtCanvasSWT ) {
final GLWindow glWindow = focusOnTab1 ? glWindow1 : glWindow2;
final NewtCanvasSWT newtCanvasSWT = focusOnTab1 ? newtCanvasSWT1 : newtCanvasSWT2;
- Assert.assertTrue("GLWindow didn't become visible natively!", NewtTestUtil.waitForRealized(glWindow, true, waitAction));
Assert.assertNotNull( newtCanvasSWT.getNativeWindow() );
System.err.println("NewtCanvasSWT LOS.0: "+newtCanvasSWT.getNativeWindow().getLocationOnScreen(null));
+ System.err.println("GLWindow LOS.0: "+glWindow.getLocationOnScreen(null));
+ System.err.println("GLWindow pos/siz.0: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight()+", "+glWindow.getInsets());
System.err.println("NW chosen: "+glWindow.getDelegatedWindow().getChosenCapabilities());
System.err.println("GL chosen: "+glWindow.getChosenCapabilities());
- System.err.println("window pos/siz.0: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight()+", "+glWindow.getInsets());
- System.err.println("GLWindow LOS.0: "+glWindow.getLocationOnScreen(null));
} else {
final GLCanvas glCanvas = focusOnTab1 ? glCanvas1: glCanvas2;
System.err.println("GL chosen: "+glCanvas.getChosenGLCapabilities());
- System.err.println("GLCanvas pixel-units pos/siz.0: pos "+SWTAccessor.getLocationInPixels(glCanvas)+", size "+SWTAccessor.getSizeInPixels(glCanvas));
- System.err.println("GLCanvas window-units pos/siz.0: pos "+glCanvas.getLocation()+", size "+glCanvas.getSize());
- System.err.println("GLCanvas LOS.0: "+SWTAccessor.getLocationOnScreen(new Point(), glCanvas));
}
- Assert.assertEquals(true, GLTestUtil.waitForRealized( focusOnTab1 ? glad1 : glad2, true, waitAction));
if( null != rwsize ) {
for(int i=0; i<50; i++) { // 500 ms dispatched delay
@@ -366,17 +380,18 @@ public class TestGLCanvasSWTNewtCanvasSWTPosInTabs extends UITestCase {
shell.setSize( rwsize.getWidth(), rwsize.getHeight() );
}
});
+ {
+ final Canvas canvas = focusOnTab1 ? canvas1 : canvas2;
+ System.err.println("Canvas pixel-units pos/siz.1: pos "+SWTAccessor.getLocationInPixels(canvas)+", size "+SWTAccessor.getSizeInPixels(canvas));
+ System.err.println("Canvas window-units pos/siz.1: pos "+canvas.getLocation()+", size "+canvas.getSize());
+ System.err.println("Canvas LOS.1: "+SWTAccessor.getLocationOnScreen(new Point(), canvas));
+ }
if( useNewtCanvasSWT ) {
final GLWindow glWindow = focusOnTab1 ? glWindow1 : glWindow2;
final NewtCanvasSWT newtCanvasSWT = focusOnTab1 ? newtCanvasSWT1 : newtCanvasSWT2;
- System.err.println("window resize pos/siz.1: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight()+", "+glWindow.getInsets());
- System.err.println("GLWindow LOS.1: "+glWindow.getLocationOnScreen(null));
System.err.println("NewtCanvasSWT LOS.1: "+newtCanvasSWT.getNativeWindow().getLocationOnScreen(null));
- } else {
- final GLCanvas glCanvas = focusOnTab1 ? glCanvas1: glCanvas2;
- System.err.println("GLCanvas pixel-units pos/siz.1: pos "+SWTAccessor.getLocationInPixels(glCanvas)+", size "+SWTAccessor.getSizeInPixels(glCanvas));
- System.err.println("GLCanvas window-units pos/siz.1: pos "+glCanvas.getLocation()+", size "+glCanvas.getSize());
- System.err.println("GLCanvas LOS.1: "+SWTAccessor.getLocationOnScreen(new Point(), glCanvas));
+ System.err.println("GLWindow LOS.1: "+glWindow.getLocationOnScreen(null));
+ System.err.println("window resize pos/siz.1: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight()+", "+glWindow.getInsets());
}
}
@@ -391,9 +406,9 @@ public class TestGLCanvasSWTNewtCanvasSWTPosInTabs extends UITestCase {
Assert.assertTrue( "NewtCanvasAWT2 LOS "+pNatWinLOS+" not >= sash-right "+pSashRightClient, pNatWinLOS.compareTo(pSashRightClient) >= 0 );
} else {
pGLWinLOS = SWTAccessor.getLocationOnScreen(new Point(), glCanvas2);
- System.err.println("GLCanvas LOS: "+pGLWinLOS);
+ System.err.println("GLCanvas2 LOS: "+pGLWinLOS);
}
- Assert.assertTrue( "GLWindow LOS "+pGLWinLOS+" not >= sash-right "+pSashRightClient, pGLWinLOS.compareTo(pSashRightClient) >= 0 );
+ Assert.assertTrue( "GLWindow2 LOS "+pGLWinLOS+" not >= sash-right "+pSashRightClient, pGLWinLOS.compareTo(pSashRightClient) >= 0 );
}
while( animator1.isAnimating() || animator2.isAnimating() ) {
@@ -437,32 +452,61 @@ public class TestGLCanvasSWTNewtCanvasSWTPosInTabs extends UITestCase {
}
@Test
- public void test01_GLCanvasTabPlainGL() throws InterruptedException {
+ public void test01_GLCanvasTabPlainGLDirect() throws InterruptedException {
if( 0 != manualTest && 1 != manualTest ) {
return;
}
- runTestInLayout(true /* focusOnTab1 */, false /* useNewtCanvasSWT */, new GLCapabilities(GLProfile.getGL2ES2()));
+ runTestInLayout(true /* focusOnTab1 */, false /* useNewtCanvasSWT */, false /* addComposite */, new GLCapabilities(GLProfile.getGL2ES2()));
}
@Test
- public void test02_GLCanvasTabSashGL() throws InterruptedException {
+ public void test02_GLCanvasTabSashGLDirect() throws InterruptedException {
if( 0 != manualTest && 2 != manualTest ) {
return;
}
- runTestInLayout(false /* focusOnTab1 */, false /* useNewtCanvasSWT */, new GLCapabilities(GLProfile.getGL2ES2()));
+ runTestInLayout(false /* focusOnTab1 */, false /* useNewtCanvasSWT */, false /* addComposite */, new GLCapabilities(GLProfile.getGL2ES2()));
}
@Test
- public void test11_NewtCanvasSWTTabPlainGL() throws InterruptedException {
+ public void test11_GLCanvasTabPlainGLWComp() throws InterruptedException {
if( 0 != manualTest && 11 != manualTest ) {
return;
}
- runTestInLayout(true /* focusOnTab1 */, true /* useNewtCanvasSWT */, new GLCapabilities(GLProfile.getGL2ES2()));
+ runTestInLayout(true /* focusOnTab1 */, false /* useNewtCanvasSWT */, true /* addComposite */, new GLCapabilities(GLProfile.getGL2ES2()));
}
@Test
- public void test12_NewtCanvasSWTTabSashGL() throws InterruptedException {
+ public void test12_GLCanvasTabSashGLWComp() throws InterruptedException {
if( 0 != manualTest && 12 != manualTest ) {
return;
}
- runTestInLayout(false /* focusOnTab1 */, true /* useNewtCanvasSWT */, new GLCapabilities(GLProfile.getGL2ES2()));
+ runTestInLayout(false /* focusOnTab1 */, false /* useNewtCanvasSWT */, true /* addComposite */, new GLCapabilities(GLProfile.getGL2ES2()));
+ }
+
+ @Test
+ public void test21_NewtCanvasSWTTabPlainGLDirect() throws InterruptedException {
+ if( 0 != manualTest && 21 != manualTest ) {
+ return;
+ }
+ runTestInLayout(true /* focusOnTab1 */, true /* useNewtCanvasSWT */, false /* addComposite */, new GLCapabilities(GLProfile.getGL2ES2()));
+ }
+ @Test
+ public void test22_NewtCanvasSWTTabSashGLDirect() throws InterruptedException {
+ if( 0 != manualTest && 22 != manualTest ) {
+ return;
+ }
+ runTestInLayout(false /* focusOnTab1 */, true /* useNewtCanvasSWT */, false /* addComposite */, new GLCapabilities(GLProfile.getGL2ES2()));
+ }
+ @Test
+ public void test31_NewtCanvasSWTTabPlainGLWComp() throws InterruptedException {
+ if( 0 != manualTest && 31 != manualTest ) {
+ return;
+ }
+ runTestInLayout(true /* focusOnTab1 */, true /* useNewtCanvasSWT */, true /* addComposite */, new GLCapabilities(GLProfile.getGL2ES2()));
+ }
+ @Test
+ public void test32_NewtCanvasSWTTabSashGLWComp() throws InterruptedException {
+ if( 0 != manualTest && 32 != manualTest ) {
+ return;
+ }
+ runTestInLayout(false /* focusOnTab1 */, true /* useNewtCanvasSWT */, true /* addComposite */, new GLCapabilities(GLProfile.getGL2ES2()));
}
static int manualTest = 0;