aboutsummaryrefslogtreecommitdiffstats
path: root/src/test
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2012-09-20 23:12:48 +0200
committerSven Gothel <[email protected]>2012-09-20 23:12:48 +0200
commit923d9dd7f1d40db72d35ca76a761ca14babf147f (patch)
tree754fdccc679898e9699cb76feeb54b97fcb2e605 /src/test
parent0f531ec116245b10fcb41e7b0905f240b91aa93a (diff)
Add GLRendererQuirks; Fix shared EGL/ES resources;
Add GLRendererQuirks: - Contains centralized 'tagged' workarounds for GL renderer bugs (quirks) - Accessible via GLContext and GLDrawableFactory - Initialized in GLContext.setAvailability* - Simplify GLGraphicsConfigurationUtil.fixOffscreenGLCapabilities(..) & use Quirks - use quirks - instead of passing booleans for each config, pass factory & device Fix shared EGL/ES resources: - GLProfile needs to initialize EGLDrawableFactory's shared resources before desktop, so EGLDrawableFactory can use the fallback defaultDisplay & defaultSharedResource for host mapped sharedResources (hack). - If using defaultSharedResources for host mapped ones, do not go through initialization cycles - simply map (sharedResource + context). - EGLDrawableFactory: Use device's unique-key instead of connection only, since the latter causes a collision (EGL-connection == X11-connection).
Diffstat (limited to 'src/test')
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableDelegateOnOffscrnCapsNEWT.java7
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableFactoryOffscrnCapsNEWT.java11
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableGLCanvasOnOffscrnCapsAWT.java5
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableGLWindowOnOffscrnCapsNEWT.java5
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableNewtCanvasAWTOnOffscrnCapsAWT.java9
5 files changed, 12 insertions, 25 deletions
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableDelegateOnOffscrnCapsNEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableDelegateOnOffscrnCapsNEWT.java
index 4628a5a58..829739caa 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableDelegateOnOffscrnCapsNEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableDelegateOnOffscrnCapsNEWT.java
@@ -84,10 +84,7 @@ public class TestGLAutoDrawableDelegateOnOffscrnCapsNEWT extends UITestCase {
void doTest(GLCapabilitiesImmutable reqGLCaps, GLEventListener demo) throws InterruptedException {
System.out.println("Requested GL Caps: "+reqGLCaps);
final GLDrawableFactory factory = GLDrawableFactory.getFactory(reqGLCaps.getGLProfile());
-
- final boolean fboAvailable = factory.canCreateFBO(null, reqGLCaps.getGLProfile());
- final boolean pbufferAvailable = factory.canCreateGLPbuffer(null);
- final GLCapabilitiesImmutable expGLCaps = GLGraphicsConfigurationUtil.fixGLCapabilities(reqGLCaps, fboAvailable, pbufferAvailable);
+ final GLCapabilitiesImmutable expGLCaps = GLGraphicsConfigurationUtil.fixGLCapabilities(reqGLCaps, factory, null);
System.out.println("Expected GL Caps: "+expGLCaps);
//
// Create native windowing resources .. X11/Win/OSX
@@ -238,7 +235,7 @@ public class TestGLAutoDrawableDelegateOnOffscrnCapsNEWT extends UITestCase {
reqGLCaps.setDoubleBuffered(false);
doTest(reqGLCaps, new GearsES2(1));
}
-
+
@Test
public void testGL2OffScreenAutoDblBuf() throws InterruptedException {
final GLCapabilities reqGLCaps = getCaps(GLProfile.GL2);
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableFactoryOffscrnCapsNEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableFactoryOffscrnCapsNEWT.java
index d318446d2..1f5ac9b8a 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableFactoryOffscrnCapsNEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableFactoryOffscrnCapsNEWT.java
@@ -73,10 +73,7 @@ public class TestGLAutoDrawableFactoryOffscrnCapsNEWT extends UITestCase {
void doTest(GLCapabilitiesImmutable reqGLCaps, GLEventListener demo) throws InterruptedException {
System.out.println("Requested GL Caps: "+reqGLCaps);
final GLDrawableFactory factory = GLDrawableFactory.getFactory(reqGLCaps.getGLProfile());
-
- final boolean fboAvailable = factory.canCreateFBO(null, reqGLCaps.getGLProfile());
- final boolean pbufferAvailable = factory.canCreateGLPbuffer(null);
- final GLCapabilitiesImmutable expGLCaps = GLGraphicsConfigurationUtil.fixGLCapabilities(reqGLCaps, fboAvailable, pbufferAvailable);
+ final GLCapabilitiesImmutable expGLCaps = GLGraphicsConfigurationUtil.fixGLCapabilities(reqGLCaps, factory, null);
System.out.println("Expected GL Caps: "+expGLCaps);
//
@@ -212,8 +209,8 @@ public class TestGLAutoDrawableFactoryOffscrnCapsNEWT extends UITestCase {
reqGLCaps.setStencilBits(1);
reqGLCaps.setSampleBuffers(true);
doTest(reqGLCaps, new GearsES2(1));
- }
-
+ }
+
@Test
public void testGL2OffScreenPbufferDblBuf() throws InterruptedException {
final GLCapabilities reqGLCaps = getCaps(GLProfile.GL2);
@@ -221,7 +218,7 @@ public class TestGLAutoDrawableFactoryOffscrnCapsNEWT extends UITestCase {
reqGLCaps.setOnscreen(false);
reqGLCaps.setPBuffer(true);
doTest(reqGLCaps, new GearsES2(1));
- }
+ }
@Test
public void testGL2OffScreenPbufferSglBuf() throws InterruptedException {
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableGLCanvasOnOffscrnCapsAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableGLCanvasOnOffscrnCapsAWT.java
index fac40de35..a2ffa9069 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableGLCanvasOnOffscrnCapsAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableGLCanvasOnOffscrnCapsAWT.java
@@ -106,10 +106,7 @@ public class TestGLAutoDrawableGLCanvasOnOffscrnCapsAWT extends UITestCase {
}
System.out.println("Requested GL Caps: "+reqGLCaps);
final GLDrawableFactory factory = GLDrawableFactory.getFactory(reqGLCaps.getGLProfile());
-
- final boolean fboAvailable = factory.canCreateFBO(null, reqGLCaps.getGLProfile());
- final boolean pbufferAvailable = factory.canCreateGLPbuffer(null);
- final GLCapabilitiesImmutable expGLCaps = GLGraphicsConfigurationUtil.fixGLCapabilities(reqGLCaps, fboAvailable, pbufferAvailable);
+ final GLCapabilitiesImmutable expGLCaps = GLGraphicsConfigurationUtil.fixGLCapabilities(reqGLCaps, factory, null);
System.out.println("Expected GL Caps: "+expGLCaps);
//
// Create native windowing resources .. X11/Win/OSX
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableGLWindowOnOffscrnCapsNEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableGLWindowOnOffscrnCapsNEWT.java
index 145078629..da5456777 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableGLWindowOnOffscrnCapsNEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableGLWindowOnOffscrnCapsNEWT.java
@@ -78,10 +78,7 @@ public class TestGLAutoDrawableGLWindowOnOffscrnCapsNEWT extends UITestCase {
void doTest(GLCapabilitiesImmutable reqGLCaps, GLEventListener demo) throws InterruptedException {
System.out.println("Requested GL Caps: "+reqGLCaps);
final GLDrawableFactory factory = GLDrawableFactory.getFactory(reqGLCaps.getGLProfile());
-
- final boolean fboAvailable = factory.canCreateFBO(null, reqGLCaps.getGLProfile());
- final boolean pbufferAvailable = factory.canCreateGLPbuffer(null);
- final GLCapabilitiesImmutable expGLCaps = GLGraphicsConfigurationUtil.fixGLCapabilities(reqGLCaps, fboAvailable, pbufferAvailable);
+ final GLCapabilitiesImmutable expGLCaps = GLGraphicsConfigurationUtil.fixGLCapabilities(reqGLCaps, factory, null);
System.out.println("Expected GL Caps: "+expGLCaps);
//
// Create native windowing resources .. X11/Win/OSX
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableNewtCanvasAWTOnOffscrnCapsAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableNewtCanvasAWTOnOffscrnCapsAWT.java
index 47fc99844..37483f7e7 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableNewtCanvasAWTOnOffscrnCapsAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableNewtCanvasAWTOnOffscrnCapsAWT.java
@@ -33,6 +33,7 @@ import java.awt.Dimension;
import java.awt.Frame;
import java.io.IOException;
+import javax.media.nativewindow.AbstractGraphicsDevice;
import javax.media.nativewindow.CapabilitiesImmutable;
import javax.media.opengl.GLAutoDrawable;
import javax.media.opengl.GLCapabilities;
@@ -108,12 +109,10 @@ public class TestGLAutoDrawableNewtCanvasAWTOnOffscrnCapsAWT extends UITestCase
}
System.out.println("Requested GL Caps: "+reqGLCaps);
final GLDrawableFactory factory = GLDrawableFactory.getFactory(reqGLCaps.getGLProfile());
-
- final boolean fboAvailable = factory.canCreateFBO(null, reqGLCaps.getGLProfile());
- final boolean pbufferAvailable = factory.canCreateGLPbuffer(null);
+ final AbstractGraphicsDevice device = factory.getDefaultDevice();
final GLCapabilitiesImmutable expGLCaps = offscreenLayer ?
- GLGraphicsConfigurationUtil.fixOffscreenGLCapabilities(reqGLCaps, fboAvailable, pbufferAvailable) :
- GLGraphicsConfigurationUtil.fixGLCapabilities(reqGLCaps, fboAvailable, pbufferAvailable);
+ GLGraphicsConfigurationUtil.fixOffscreenGLCapabilities(reqGLCaps, factory, device) :
+ GLGraphicsConfigurationUtil.fixGLCapabilities(reqGLCaps, factory, device);
System.out.println("Expected GL Caps: "+expGLCaps);
final GLWindow glad = GLWindow.create(reqGLCaps);