src/macosx/classes/sun/java2d/opengl/CGLGraphicsConfig.java

Print this page

        

*** 78,91 **** private BufferCapabilities bufferCaps; private long pConfigInfo; private ContextCapabilities oglCaps; private OGLContext context; private final Object disposerReferent = new Object(); - - public static native int getDefaultPixFmt(int screennum); private static native boolean initCGL(); ! private static native long getCGLConfigInfo(int screennum, int visualnum, int swapInterval); private static native int getOGLCapabilities(long configInfo); static { cglAvailable = initCGL(); --- 78,89 ---- private BufferCapabilities bufferCaps; private long pConfigInfo; private ContextCapabilities oglCaps; private OGLContext context; private final Object disposerReferent = new Object(); private static native boolean initCGL(); ! private static native long getCGLConfigInfo(int displayID, int visualnum, int swapInterval); private static native int getOGLCapabilities(long configInfo); static { cglAvailable = initCGL();
*** 135,153 **** // getCGLConfigInfo() creates and destroys temporary // surfaces/contexts, so we should first invalidate the current // Java-level context and flush the queue... OGLContext.invalidateCurrentContext(); ! cfginfo = getCGLConfigInfo(device.getCoreGraphicsScreen(), pixfmt, kOpenGLSwapInterval); ! OGLContext.setScratchSurface(cfginfo); rq.flushAndInvokeNow(new Runnable() { public void run() { ids[0] = OGLContext.getOGLIdString(); } }); } finally { rq.unlock(); } if (cfginfo == 0) { return null; --- 133,152 ---- // getCGLConfigInfo() creates and destroys temporary // surfaces/contexts, so we should first invalidate the current // Java-level context and flush the queue... OGLContext.invalidateCurrentContext(); ! cfginfo = getCGLConfigInfo(device.getCGDisplayID(), pixfmt, kOpenGLSwapInterval); ! if (cfginfo != 0L) { OGLContext.setScratchSurface(cfginfo); rq.flushAndInvokeNow(new Runnable() { public void run() { ids[0] = OGLContext.getOGLIdString(); } }); + } } finally { rq.unlock(); } if (cfginfo == 0) { return null;
*** 251,262 **** updateTotalDisplayBounds(); } @Override public String toString() { ! int screen = getDevice().getCoreGraphicsScreen(); ! return ("CGLGraphicsConfig[dev="+screen+",pixfmt="+pixfmt+"]"); } @Override public SurfaceData createSurfaceData(CPlatformView pView) { return CGLSurfaceData.createData(pView); --- 250,261 ---- updateTotalDisplayBounds(); } @Override public String toString() { ! int displayID = getDevice().getCGDisplayID(); ! return ("CGLGraphicsConfig[dev="+displayID+",pixfmt="+pixfmt+"]"); } @Override public SurfaceData createSurfaceData(CPlatformView pView) { return CGLSurfaceData.createData(pView);
*** 411,422 **** return oglCaps; } @Override public void addDeviceEventListener(AccelDeviceEventListener l) { ! int screen = getDevice().getCoreGraphicsScreen(); ! AccelDeviceEventNotifier.addListener(l, screen); } @Override public void removeDeviceEventListener(AccelDeviceEventListener l) { AccelDeviceEventNotifier.removeListener(l); --- 410,421 ---- return oglCaps; } @Override public void addDeviceEventListener(AccelDeviceEventListener l) { ! int displayID = getDevice().getCGDisplayID(); ! AccelDeviceEventNotifier.addListener(l, displayID); } @Override public void removeDeviceEventListener(AccelDeviceEventListener l) { AccelDeviceEventNotifier.removeListener(l);