From 4d493ac36bd5d763d2af3243e799bbaef3679594 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Sat, 17 Oct 2009 13:44:12 -0700 Subject: 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 --- .../classes/com/sun/opengl/impl/GLContextImpl.java | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'src/jogl/classes/com/sun/opengl/impl/GLContextImpl.java') 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 -- cgit v1.2.3