| Modifier and Type | Class and Description |
|---|---|
| public static interface |
| Modifier and Type | Field and Description |
|---|---|
| private GLAnimatorControl | |
| private boolean | |
| protected static final boolean | |
| private static final boolean | |
| private volatile int | exclusiveContextSwitch
-1 release, 0 nop, 1 claim |
| private volatile Thread | |
| private volatile int | |
| private ArrayList | |
| private final Object | |
| private final ArrayList | |
| private final Object | |
| private final HashSet | |
| private static final int | MAX_RELEASE_ITER
Limit release calls of |
| private static Runnable | |
| private static final boolean | PERF_STATS
true if property |
| private static final ThreadLocal | |
| private GLAutoDrawable | |
| private GLContext |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public final void | |
| public final void | |
| public final boolean | |
| public final void | |
| private final void | |
| public final int | Returns: the disposal countDisposes all added initialized |
| public final void | disposeAllGLEventListener(final GLAutoDrawable autoDrawable, final GLDrawable drawable, final GLContext context, final boolean remove)
Principal helper method which runs |
| public final void | disposeGL(final GLAutoDrawable autoDrawable, final GLContext context, final boolean
destroy context in the end while holding the lock destroyContext)Principal helper method which runs
|
| public final GLEventListener | Returns: the disposed and/or removed listener, otherwise null if neither action is performedif true, the listener gets removed remove)Disposes the given |
| public final GLEventListener | disposeGLEventListener(final GLAutoDrawable autoDrawable, final GLDrawable drawable, final GLContext context, final GLEventListener listener, final boolean remove)
Principal helper method which runs |
| public final void | |
| private final boolean | |
| public final void | |
| public static final void | forceNativeRelease(final GLContext ctx)
Since GLContext's |
| public final GLAnimatorControl | |
| public final boolean | |
| private final String | |
| public final Thread | |
| public final GLEventListener | |
| public final int | |
| public final boolean | |
| private static final Runnable | |
| protected static String | |
| private final void | |
| public final void | init(final GLAutoDrawable drawable, final boolean
set to true if the subsequent display call won't reshape, otherwise false to avoid double reshape. sendReshape)The default init action to be called once after ctx is being created @ 1st makeCurrent(). |
| public final boolean | invoke(final GLAutoDrawable
the drawable, boolean GLAutoDrawable to be usedif wait, final GLRunnable true block until execution of glRunnable is finished, otherwise return immediatly w/o waitingthe glRunnable)GLRunnable to execute within display()
If |
| public final boolean | |
| public final void | invokeGL(final GLDrawable drawable, final GLContext context, final Runnable runnable, final Runnable initAction)
Principal helper method which runs a Runnable with the context made current. |
| private final void | invokeGLImpl(final GLDrawable drawable, final GLContext context, final Runnable runnable, final Runnable initAction)
|
| private final void | invokeGLImplStats(final GLDrawable drawable, final GLContext context, final Runnable runnable, final Runnable initAction)
|
| public final boolean | |
| public final boolean | |
| public final boolean | |
| public final boolean | |
| public static final boolean | |
| public static final boolean | |
| public boolean | Returns: true if initialization is pending due to a set shared GLAutoDrawable or GLContext which is not ready yet. Otherwise false.returns the shared GLContext, based on set shared GLAutoDrawable
or GLContext. Maybe null if none is set. shared)
|
| public static final GLDrawableImpl | Returns: the new drawablemaybe null context)If the drawable is not realized, OP is a NOP. |
| public final GLEventListener | Returns: the removed listener, or null if listener was not addedNote that no |
| public final GLEventListener | |
| public final void | |
| public final void | |
| public static final GLDrawableImpl | Returns: the new drawable in case of an pbuffer/pixmap drawable, otherwise the passed drawable is being returned.the new width, it's minimum is capped to 1 newWidth, int the new height, it's minimum is capped to 1 newHeight)Performs resize operation on the given drawable, assuming it is offscreen. |
| public final void | runForAllGLEventListener(final GLAutoDrawable drawable, final GLDrawableHelper.
private static GLEventListenerAction displayAction = new GLEventListenerAction() { public void run(final GLAutoDrawable drawable, final GLEventListener listener) { listener.display(drawable); } }; |
| public final void | runOutsideOfExclusiveContextThread(final GLContext context, final Runnable runnable)
Runs given |
| public final void | |
| public final void | |
| public final Thread | Returns: previous exclusive context threadthe exclusive thread to claim the context, or t, final GLContext context)null for default operation.Dedicates this instance's |
| public final void | |
| private static final void | |
| public final void | setSharedAutoDrawable(final GLAutoDrawable thisAutoDrawable, final GLAutoDrawable sharedAutoDrawable)
|
| public final void | |
| private final void | setViewportAndClear(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height)
Bug 1206: Security: Clear exposed framebuffer after creation and before visibility - Clear framebuffer after setting viewport - Since we only attempt to help against leaking un-initialized framebuffer content not against user-app faults, we do not clear a 2nd-buffer (double-buffering). |
| public static final void | switchContext(final GLDrawable
the drawable which context is changed drawable, final GLContext the old context, maybe oldCtx, final boolean null.if destroyOldCtx, final GLContext true, destroy the oldCtxthe new context, maybe newCtx, final int null for dis-association.additional creation flags if newCtx is not null and not been created yet, see newCtxCreationFlags)GLContext#setContextCreationFlags(int)Switch |
| public final String |
| animatorCtrl | back to summary |
|---|---|
| private GLAnimatorControl animatorCtrl | |
| autoSwapBufferMode | back to summary |
|---|---|
| private boolean autoSwapBufferMode | |
| DEBUG | back to summary |
|---|---|
| protected static final boolean DEBUG | |
| DEBUG_SETCLEAR | back to summary |
|---|---|
| private static final boolean DEBUG_SETCLEAR | |
| exclusiveContextSwitch | back to summary |
|---|---|
| private volatile int exclusiveContextSwitch -1 release, 0 nop, 1 claim | |
| exclusiveContextThread | back to summary |
|---|---|
| private volatile Thread exclusiveContextThread | |
| glRunnableCount | back to summary |
|---|---|
| private volatile int glRunnableCount | |
| glRunnables | back to summary |
|---|---|
| private ArrayList<GLRunnableTask> glRunnables | |
| glRunnablesLock | back to summary |
|---|---|
| private final Object glRunnablesLock | |
| listeners | back to summary |
|---|---|
| private final ArrayList<GLEventListener> listeners | |
| listenersLock | back to summary |
|---|---|
| private final Object listenersLock | |
| listenersToBeInit | back to summary |
|---|---|
| private final HashSet<GLEventListener> listenersToBeInit | |
| MAX_RELEASE_ITER | back to summary |
|---|---|
| private static final int MAX_RELEASE_ITER Limit release calls of | |
| nop | back to summary |
|---|---|
| private static Runnable nop | |
| PERF_STATS | back to summary |
|---|---|
| private static final boolean PERF_STATS true if property | |
| perThreadInitAction | back to summary |
|---|---|
| private static final ThreadLocal<WeakReference<Runnable>> perThreadInitAction | |
| sharedAutoDrawable | back to summary |
|---|---|
| private GLAutoDrawable sharedAutoDrawable | |
| sharedContext | back to summary |
|---|---|
| private GLContext sharedContext | |
| GLDrawableHelper | back to summary |
|---|---|
| public GLDrawableHelper() | |
| addGLEventListener | back to summary |
|---|---|
| public final void addGLEventListener(final GLEventListener listener) | |
| addGLEventListener | back to summary |
|---|---|
| public final void addGLEventListener(int index, final GLEventListener listener) | |
| areAllGLEventListenerInitialized | back to summary |
|---|---|
| public final boolean areAllGLEventListenerInitialized() | |
| display | back to summary |
|---|---|
| public final void display(final GLAutoDrawable drawable) | |
| displayImpl | back to summary |
|---|---|
| private final void displayImpl(final GLAutoDrawable drawable) | |
| disposeAllGLEventListener | back to summary |
|---|---|
| public final int disposeAllGLEventListener(final GLAutoDrawable autoDrawable, final boolean remove) throws GLException Disposes all added initialized
If
Please consider using
| |
| disposeAllGLEventListener | back to summary |
|---|---|
| public final void disposeAllGLEventListener(final GLAutoDrawable autoDrawable, final GLDrawable drawable, final GLContext context, final boolean remove) Principal helper method which runs
If an | |
| disposeGL | back to summary |
|---|---|
| public final void disposeGL(final GLAutoDrawable autoDrawable, final GLContext context, final boolean destroyContext) throws GLException Principal helper method which runs
If
If
| |
| disposeGLEventListener | back to summary |
|---|---|
| public final GLEventListener disposeGLEventListener(final GLAutoDrawable autoDrawable, final GLEventListener listener, final boolean remove) Disposes the given
If
Please consider using
| |
| disposeGLEventListener | back to summary |
|---|---|
| public final GLEventListener disposeGLEventListener(final GLAutoDrawable autoDrawable, final GLDrawable drawable, final GLContext context, final GLEventListener listener, final boolean remove) Principal helper method which runs
If an | |
| enqueue | back to summary |
|---|---|
| public final void enqueue(final GLRunnable glRunnable) | |
| execGLRunnables | back to summary |
|---|---|
| private final boolean execGLRunnables(final GLAutoDrawable drawable) | |
| flushGLRunnables | back to summary |
|---|---|
| public final void flushGLRunnables() | |
| forceNativeRelease | back to summary |
|---|---|
| public static final void forceNativeRelease(final GLContext ctx) Since GLContext's
This methods continues calling | |
| getAnimator | back to summary |
|---|---|
| public final GLAnimatorControl getAnimator() | |
| getAutoSwapBufferMode | back to summary |
|---|---|
| public final boolean getAutoSwapBufferMode() | |
| getExclusiveContextSwitchString | back to summary |
|---|---|
| private final String getExclusiveContextSwitchString() | |
| getExclusiveContextThread | back to summary |
|---|---|
| public final Thread getExclusiveContextThread() | |
| getGLEventListener | back to summary |
|---|---|
| public final GLEventListener getGLEventListener(int index) throws IndexOutOfBoundsException | |
| getGLEventListenerCount | back to summary |
|---|---|
| public final int getGLEventListenerCount() | |
| getGLEventListenerInitState | back to summary |
|---|---|
| public final boolean getGLEventListenerInitState(final GLEventListener listener) | |
| getLastInitAction | back to summary |
|---|---|
| private static final Runnable getLastInitAction() | |
| getThreadName | back to summary |
|---|---|
| protected static String getThreadName() | |
| init | back to summary |
|---|---|
| private final void init(final GLEventListener l, final GLAutoDrawable drawable, final boolean sendReshape) | |
| init | back to summary |
|---|---|
| public final void init(final GLAutoDrawable drawable, final boolean sendReshape) The default init action to be called once after ctx is being created @ 1st makeCurrent().
| |
| invoke | back to summary |
|---|---|
| public final boolean invoke(final GLAutoDrawable drawable, boolean wait, final GLRunnable glRunnable) throws IllegalStateException
If
If
0 == deferredHere && 0 == isGLThread -> display() will issue on GL thread, blocking!
deferredHere wait isGLThread lockedByThisThread Note
OK 0 x 1 x
OK 0 x 0 0
ERROR 0 x 0 1 Will be deferred on GL thread by display() (blocking),
but locked by this thread -> ERROR
1 0 x x All good, due to no wait, non blocking
1 1 1 0
1 1 0 0
SWITCH 1 1 1 1 Run immediately, don't defer since locked by this thread, but isGLThread
ERROR 1 1 0 1 Locked by this thread, but _not_ isGLThread -> ERROR
| |
| invoke | back to summary |
|---|---|
| public final boolean invoke(final GLAutoDrawable drawable, boolean wait, final List<GLRunnable> newGLRunnables) throws IllegalStateException | |
| invokeGL | back to summary |
|---|---|
| public final void invokeGL(final GLDrawable drawable, final GLContext context, final Runnable runnable, final Runnable initAction) Principal helper method which runs a Runnable with the context made current. This could have been made part of GLContext, but a desired goal is to be able to implement GLAutoDrawable's in terms of the GLContext's public APIs, and putting it into a separate class helps ensure that we don't inadvertently use private methods of the GLContext or its implementing classes. Note Locking of the surface is implicit done by | |
| invokeGLImpl | back to summary |
|---|---|
| private final void invokeGLImpl(final GLDrawable drawable, final GLContext context, final Runnable runnable, final Runnable initAction) | |
| invokeGLImplStats | back to summary |
|---|---|
| private final void invokeGLImplStats(final GLDrawable drawable, final GLContext context, final Runnable runnable, final Runnable initAction) | |
| isAnimatorAnimating | back to summary |
|---|---|
| public final boolean isAnimatorAnimating() | |
| isAnimatorAnimatingOnOtherThread | back to summary |
|---|---|
| public final boolean isAnimatorAnimatingOnOtherThread() | |
| isAnimatorStarted | back to summary |
|---|---|
| public final boolean isAnimatorStarted() | |
| isAnimatorStartedOnOtherThread | back to summary |
|---|---|
| public final boolean isAnimatorStartedOnOtherThread() | |
| isLockedByOtherThread | back to summary |
|---|---|
| public static final boolean isLockedByOtherThread(final GLAutoDrawable d) | |
| isLockedByThisThread | back to summary |
|---|---|
| public static final boolean isLockedByThisThread(final GLAutoDrawable d) | |
| isSharedGLContextPending | back to summary |
|---|---|
public boolean isSharedGLContextPending(final GLContext[] shared)
| |
| recreateGLDrawable | back to summary |
|---|---|
| public static final GLDrawableImpl recreateGLDrawable(GLDrawableImpl drawable, final GLContext context) If the drawable is not realized, OP is a NOP.
Locking is performed via
| |
| removeGLEventListener | back to summary |
|---|---|
| public final GLEventListener removeGLEventListener(final GLEventListener listener) Note that no
| |
| removeGLEventListener | back to summary |
|---|---|
| public final GLEventListener removeGLEventListener(int index) throws IndexOutOfBoundsException | |
| reset | back to summary |
|---|---|
| public final void reset() | |
| reshape | back to summary |
|---|---|
| public final void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) | |
| resizeOffscreenDrawable | back to summary |
|---|---|
| public static final GLDrawableImpl resizeOffscreenDrawable(GLDrawableImpl drawable, final GLContext context, int newWidth, int newHeight) throws NativeWindowException, GLException Performs resize operation on the given drawable, assuming it is offscreen.
The
May recreate the drawable via FBO drawables are resized w/o drawable destruction. Offscreen resize operation is validated w/ drawable size in the end. An exception is thrown if not successful.
| |
| runForAllGLEventListener | back to summary |
|---|---|
| public final void runForAllGLEventListener(final GLAutoDrawable drawable, final GLDrawableHelper. private static GLEventListenerAction displayAction = new GLEventListenerAction() { public void run(final GLAutoDrawable drawable, final GLEventListener listener) { listener.display(drawable); } }; | |
| runOutsideOfExclusiveContextThread | back to summary |
|---|---|
| public final void runOutsideOfExclusiveContextThread(final GLContext context, final Runnable runnable) Runs given
| |
| setAnimator | back to summary |
|---|---|
| public final void setAnimator(final GLAnimatorControl animator) throws GLException | |
| setAutoSwapBufferMode | back to summary |
|---|---|
| public final void setAutoSwapBufferMode(final boolean enable) | |
| setExclusiveContextThread | back to summary |
|---|---|
| public final Thread setExclusiveContextThread(final Thread t, final GLContext context) throws GLException Dedicates this instance's
Default non-exclusive behavior is requested via
To release a previous made exclusive thread, a user issues Note Setting a new exclusive thread without properly releasing a previous one will throw an GLException.
One scenario could be to dedicate the context to the
| |
| setGLEventListenerInitState | back to summary |
|---|---|
| public final void setGLEventListenerInitState(final GLEventListener listener, final boolean initialized) | |
| setLastInitAction | back to summary |
|---|---|
| private static final void setLastInitAction(final Runnable initAction) | |
| setSharedAutoDrawable | back to summary |
|---|---|
| public final void setSharedAutoDrawable(final GLAutoDrawable thisAutoDrawable, final GLAutoDrawable sharedAutoDrawable) throws IllegalStateException | |
| setSharedContext | back to summary |
|---|---|
| public final void setSharedContext(final GLContext thisContext, final GLContext sharedContext) throws IllegalStateException | |
| setViewportAndClear | back to summary |
|---|---|
| private final void setViewportAndClear(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) Bug 1206: Security: Clear exposed framebuffer after creation and before visibility - Clear framebuffer after setting viewport - Since we only attempt to help against leaking un-initialized framebuffer content not against user-app faults, we do not clear a 2nd-buffer (double-buffering). | |
| switchContext | back to summary |
|---|---|
| public static final void switchContext(final GLDrawable drawable, final GLContext oldCtx, final boolean destroyOldCtx, final GLContext newCtx, final int newCtxCreationFlags) Switch Remarks:
| |
| toString | back to summary |
|---|---|
| public final String toString() Overrides java. Doc from java. Returns a string representation of the object. | |
| Modifier and Type | Method and Description |
|---|---|
| public void |
| run | back to summary |
|---|---|
| public void run(final GLAutoDrawable drawable, final GLEventListener listener) | |