aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/com/sun/opengl/impl/GLContextImpl.java
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2009-10-17 13:44:12 -0700
committerSven Gothel <[email protected]>2009-10-17 13:44:12 -0700
commit4d493ac36bd5d763d2af3243e799bbaef3679594 (patch)
tree3017bab34a8824f706e3ba63f835aaffd3317222 /src/jogl/classes/com/sun/opengl/impl/GLContextImpl.java
parent5ae314adc19c660f26f32839b2cc224cdccfbb59 (diff)
All tracker are aggregated in the GLContext now
and used within the GL*Impl. New GLStateTracker: - Tracking client/server states - Currently supports PixelStorei - Prologued in glPixelStorei and glGetIntegerv, the latter will return the tracked state if available and not call the GL method. Impacts performance and ES1 compatibility (supports ALIGNMENT). Fixed 'imageSizeInBytes' calculation: - skipPixels and skipRows is a static one time offset
Diffstat (limited to 'src/jogl/classes/com/sun/opengl/impl/GLContextImpl.java')
-rw-r--r--src/jogl/classes/com/sun/opengl/impl/GLContextImpl.java20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/jogl/classes/com/sun/opengl/impl/GLContextImpl.java b/src/jogl/classes/com/sun/opengl/impl/GLContextImpl.java
index 343ca7efe..97100208d 100644
--- a/src/jogl/classes/com/sun/opengl/impl/GLContextImpl.java
+++ b/src/jogl/classes/com/sun/opengl/impl/GLContextImpl.java
@@ -71,7 +71,9 @@ public abstract class GLContextImpl extends GLContext {
// Tracks creation and initialization of buffer objects to avoid
// repeated glGet calls upon glMapBuffer operations
- private GLBufferSizeTracker bufferSizeTracker;
+ private GLBufferSizeTracker bufferSizeTracker; // Singleton - Set by GLContextShareSet
+ private GLBufferStateTracker bufferStateTracker = new GLBufferStateTracker();
+ private GLStateTracker glStateTracker = new GLStateTracker();
protected GLDrawableImpl drawable;
protected GLDrawableImpl drawableRead;
@@ -232,6 +234,14 @@ public abstract class GLContextImpl extends GLContext {
if (bufferSizeTracker != null) {
bufferSizeTracker.clearCachedBufferSizes();
}
+
+ if (bufferStateTracker != null) {
+ bufferStateTracker.clearBufferObjectState();
+ }
+
+ if (glStateTracker != null) {
+ glStateTracker.clearStates();
+ }
destroyImpl();
} finally {
@@ -512,6 +522,14 @@ public abstract class GLContextImpl extends GLContext {
return bufferSizeTracker;
}
+ public GLBufferStateTracker getBufferStateTracker() {
+ return bufferStateTracker;
+ }
+
+ public GLStateTracker getGLStateTracker() {
+ return glStateTracker;
+ }
+
//---------------------------------------------------------------------------
// Helpers for context optimization where the last context is left
// current on the OpenGL worker thread