aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/jogamp/opengl/GLContextShareSet.java
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2014-01-14 19:38:49 +0100
committerSven Gothel <[email protected]>2014-01-14 19:38:49 +0100
commitf8a74c9831c65725a699320c27e62161a0378241 (patch)
treed98f024c84ab31404e4b8bb7608dd60941965f4b /src/jogl/classes/jogamp/opengl/GLContextShareSet.java
parent961930f9e2cd40dc4de736201bcfa68c1ff09909 (diff)
Revert "Bug 942 - Share GLBufferStateTracker ; Unify GLBufferStateTracker and GLBufferSizeTracker (simplification)"
This reverts commit 7c5483d5b20aed9c87c5ce3f6bc840b6546edcd1.
Diffstat (limited to 'src/jogl/classes/jogamp/opengl/GLContextShareSet.java')
-rw-r--r--src/jogl/classes/jogamp/opengl/GLContextShareSet.java24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/jogl/classes/jogamp/opengl/GLContextShareSet.java b/src/jogl/classes/jogamp/opengl/GLContextShareSet.java
index c057c904c..483767b44 100644
--- a/src/jogl/classes/jogamp/opengl/GLContextShareSet.java
+++ b/src/jogl/classes/jogamp/opengl/GLContextShareSet.java
@@ -262,6 +262,30 @@ public class GLContextShareSet {
return false;
}
+ /** In order to avoid glGet calls for buffer object checks related
+ to glVertexPointer, etc. calls as well as glMapBuffer calls, we
+ need to share the same GLBufferSizeTracker object between
+ contexts sharing textures and display lists. For now we keep
+ this mechanism orthogonal to the GLObjectTracker to hopefully
+ keep things easier to understand. (The GLObjectTracker is
+ currently only needed in a fairly esoteric case, when the
+ Java2D/JOGL bridge is active, but the GLBufferSizeTracker
+ mechanism is now always required.) */
+ public static void synchronizeBufferObjectSharing(final GLContext olderContextOrNull, final GLContext newContext) {
+ final GLContextImpl older = (GLContextImpl) olderContextOrNull;
+ final GLContextImpl newer = (GLContextImpl) newContext;
+ GLBufferSizeTracker tracker = null;
+ if (older != null) {
+ tracker = older.getBufferSizeTracker();
+ assert (tracker != null)
+ : "registerForBufferObjectSharing was not called properly for the older context, or has a bug in it";
+ }
+ if (tracker == null) {
+ tracker = new GLBufferSizeTracker();
+ }
+ newer.setBufferSizeTracker(tracker);
+ }
+
//----------------------------------------------------------------------
// Internals only below this point