From 3213573d5bae01d763265c08f3ca3c119707c0a9 Mon Sep 17 00:00:00 2001 From: Kenneth Russel Date: Wed, 8 Mar 2006 23:55:59 +0000 Subject: Restructured how GLObjectTracker destroys tracked objects during context destruction. Now, in addition to tracking sharing between contexts requested by the user, also tracks the behind-the-scenes sharing going on with e.g. Java2D. Makes determination of whether objects can be immediately destroyed by checking current context and seeing whether it shares the same deleted object pool as the one being destroyed. If objects can not be destroyed immediately, their destruction is deferred until the next makeCurrent of a context sharing objects with the one currently being destroyed (if one exists -- the case of this being the last context actually referencing the objects is handled by the OpenGL drivers). This fixes the resizing problems seen when -Dsun.java2d.opengl.fobject=true is specified along with -Dsun.java2d.opengl=true in Mustang. git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/trunk@655 232f8b59-042b-4e1e-8c03-345bb8c30851 --- src/classes/com/sun/opengl/impl/x11/DRIHack.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src/classes/com') diff --git a/src/classes/com/sun/opengl/impl/x11/DRIHack.java b/src/classes/com/sun/opengl/impl/x11/DRIHack.java index 181210982..1d3d15955 100644 --- a/src/classes/com/sun/opengl/impl/x11/DRIHack.java +++ b/src/classes/com/sun/opengl/impl/x11/DRIHack.java @@ -80,19 +80,24 @@ public class DRIHack { public static native long dlopen(String name); public static native int dlclose(long handle); + private static final boolean DEBUG = Debug.debug("DRIHack"); private static boolean driHackNeeded; private static long libGLHandle; public static void begin() { AccessController.doPrivileged(new PrivilegedAction() { public Object run() { - driHackNeeded = new File("/usr/lib/dri").exists(); + driHackNeeded = + (new File("/usr/lib/dri").exists() || + new File("/usr/X11R6/lib/modules/dri").exists()); return null; } }); if (driHackNeeded) { - System.err.println("Beginning DRI hack"); + if (DEBUG) { + System.err.println("Beginning DRI hack"); + } NativeLibLoader.loadDRIHack(); libGLHandle = dlopen("/usr/lib/libGL.so.1"); @@ -101,7 +106,9 @@ public class DRIHack { public static void end() { if (libGLHandle != 0) { - System.err.println("Ending DRI hack"); + if (DEBUG) { + System.err.println("Ending DRI hack"); + } dlclose(libGLHandle); } -- cgit v1.2.3