From 12342c9e6122051fbdc91493c4d63515ad4613d1 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Mon, 21 Nov 2011 08:30:02 +0100 Subject: Fix GLDrawableFactory: Move 'GLContext getOrCreateSharedContext(..)' to non public class GLDrawableFactoryImpl. Michael Weber's test case (commit e7388512b69979d00e5a213a1b166a1b1726ae0c) pointed me to the flaw in GLDrawableFactory which exposed a non-public method, ie. 'getOrCreateSharedContext()'. This lead to the assumption, that the 'shared' drawable/context of the factory is multi purpose and may be used for application context sharing - which is not the case. Changed Michael's test case to use a local shared pbuffer based drawable/context and made the method non-public, where it belongs. --- .../classes/javax/media/opengl/GLDrawableFactory.java | 16 ---------------- .../classes/jogamp/opengl/GLDrawableFactoryImpl.java | 16 ++++++++++++++++ 2 files changed, 16 insertions(+), 16 deletions(-) (limited to 'src/jogl') diff --git a/src/jogl/classes/javax/media/opengl/GLDrawableFactory.java b/src/jogl/classes/javax/media/opengl/GLDrawableFactory.java index 1282eb168..dbb91caaa 100644 --- a/src/jogl/classes/javax/media/opengl/GLDrawableFactory.java +++ b/src/jogl/classes/javax/media/opengl/GLDrawableFactory.java @@ -266,22 +266,6 @@ public abstract class GLDrawableFactory { */ public abstract boolean getWasSharedContextCreated(AbstractGraphicsDevice device); - /** - * Returns the shared context mapped to the device {@link AbstractGraphicsDevice#getConnection()}, - * either a pre-existing or newly created, or null if creation failed or not supported.
- * Creation of the shared context is tried only once. - * - * @param device which {@link javax.media.nativewindow.AbstractGraphicsDevice#getConnection() connection} denotes the shared the target device, may be null for the platform's default device. - */ - public final GLContext getOrCreateSharedContext(AbstractGraphicsDevice device) { - device = validateDevice(device); - if(null!=device) { - return getOrCreateSharedContextImpl(device); - } - return null; - } - protected abstract GLContext getOrCreateSharedContextImpl(AbstractGraphicsDevice device); - /** * Returns the sole GLDrawableFactory instance for the desktop (X11, WGL, ..) if exist or null */ diff --git a/src/jogl/classes/jogamp/opengl/GLDrawableFactoryImpl.java b/src/jogl/classes/jogamp/opengl/GLDrawableFactoryImpl.java index 068190cb2..cc0637200 100644 --- a/src/jogl/classes/jogamp/opengl/GLDrawableFactoryImpl.java +++ b/src/jogl/classes/jogamp/opengl/GLDrawableFactoryImpl.java @@ -80,6 +80,22 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory { super(); } + /** + * Returns the shared context mapped to the device {@link AbstractGraphicsDevice#getConnection()}, + * either a pre-existing or newly created, or null if creation failed or not supported.
+ * Creation of the shared context is tried only once. + * + * @param device which {@link javax.media.nativewindow.AbstractGraphicsDevice#getConnection() connection} denotes the shared the target device, may be null for the platform's default device. + */ + public final GLContext getOrCreateSharedContext(AbstractGraphicsDevice device) { + device = validateDevice(device); + if(null!=device) { + return getOrCreateSharedContextImpl(device); + } + return null; + } + protected abstract GLContext getOrCreateSharedContextImpl(AbstractGraphicsDevice device); + /** * Returns the shared device mapped to the device {@link AbstractGraphicsDevice#getConnection()}, * either a preexisting or newly created, or null if creation failed or not supported.
-- cgit v1.2.3