@Override public int getScreenIndex() { return config.getScreen().getIndex(); }
@Override public final int getScreenIndex() { return getGraphicsConfiguration().getScreen().getIndex(); }
@Override public final int getScreenIndex() { return getGraphicsConfiguration().getScreen().getIndex(); }
@Override public long getDisplayHandle() { return config.getScreen().getDevice().getHandle(); }
@Override public final long getDisplayHandle() { return getGraphicsConfiguration().getScreen().getDevice().getHandle(); }
public static StringBuilder getGLInfo(final GL gl, StringBuilder sb, final boolean withCapabilitiesAndExtensionInfo) { final AbstractGraphicsDevice device = gl.getContext().getGLDrawable().getNativeSurface() .getGraphicsConfiguration().getScreen().getDevice(); if(null==sb) { sb = new StringBuilder(); } sb.append(VersionUtil.SEPERATOR).append(Platform.getNewline()); sb.append(device.getClass().getSimpleName()).append("[type ") .append(device.getType()).append(", connection ").append(device.getConnection()).append("]: ").append(Platform.getNewline()); GLProfile.glAvailabilityToString(device, sb, "\t", 1); sb.append(Platform.getNewline()); sb = getGLStrings(gl, sb, withCapabilitiesAndExtensionInfo); if( withCapabilitiesAndExtensionInfo ) { sb = getAllAvailableCapabilitiesInfo(device, sb); } return sb; }
@Override public final long getDisplayHandle() { return config.getNativeGraphicsConfiguration().getScreen().getDevice().getHandle(); }
@Override public final long getDisplayHandle() { return config.getNativeGraphicsConfiguration().getScreen().getDevice().getHandle(); }
private void dispose() { if( null != jawtWindow ) { jawtWindow.destroy(); if(Window.DEBUG_IMPLEMENTATION) { System.err.println(getThreadName()+": AWTCanvas.disposeJAWTWindowAndAWTDeviceOnEDT(): post JAWTWindow: "+jawtWindow); } jawtWindow=null; } if(null != awtConfig) { final AbstractGraphicsDevice adevice = awtConfig.getNativeGraphicsConfiguration().getScreen().getDevice(); String adeviceMsg=null; if(Window.DEBUG_IMPLEMENTATION) { adeviceMsg = adevice.toString(); } final boolean closed = adevice.close(); if(Window.DEBUG_IMPLEMENTATION) { System.err.println(getThreadName()+": AWTCanvas.dispose(): closed GraphicsDevice: "+adeviceMsg+", result: "+closed); } } }
public static void destroyNativeWindow(final JAWTWindow jawtWindow) { final AbstractGraphicsConfiguration config = jawtWindow.getGraphicsConfiguration(); jawtWindow.destroy(); config.getScreen().getDevice().close(); }
@Override protected void destroyHandle() { final EGLWrappedSurface eglws = (EGLWrappedSurface) surface; if(DEBUG) { System.err.println(getThreadName() + ": destroyHandle of "+eglws); } if( EGL.EGL_NO_SURFACE == eglws.getSurfaceHandle() ) { throw new InternalError("Nil surface but claimed to be valid: "+eglws); } final EGLGraphicsDevice eglDevice = (EGLGraphicsDevice) eglws.getGraphicsConfiguration().getScreen().getDevice(); if( eglws.containsUpstreamOptionBits( ProxySurface.OPT_PROXY_OWNS_UPSTREAM_SURFACE ) ) { EGL.eglDestroySurface(eglDevice.getHandle(), eglws.getSurfaceHandle()); eglws.setSurfaceHandle(EGL.EGL_NO_SURFACE); } }
protected final boolean isGLXVersionGreaterEqualOneThree() { // fast-path: use cached boolean if(null != glXServerVersion) { return isGLXVersionGreaterEqualOneThree; } glXServerVersion = ((X11GLXDrawableFactory)drawable.getFactoryImpl()).getGLXVersionNumber(drawable.getNativeSurface().getGraphicsConfiguration().getScreen().getDevice()); isGLXVersionGreaterEqualOneThree = null != glXServerVersion ? glXServerVersion.compareTo(X11GLXDrawableFactory.versionOneThree) >= 0 : false; return isGLXVersionGreaterEqualOneThree; } protected final void forceGLXVersionOneOne() {
public static boolean isScreenCompatible(final NativeWindow parent, final Screen childScreen) { // Get parent's NativeWindow details final AbstractGraphicsConfiguration parentConfig = parent.getGraphicsConfiguration(); final AbstractGraphicsScreen parentScreen = parentConfig.getScreen(); final AbstractGraphicsDevice parentDevice = parentScreen.getDevice(); final DisplayImpl childDisplay = (DisplayImpl) childScreen.getDisplay(); final String parentDisplayName = childDisplay.validateDisplayName(null, parentDevice.getHandle()); final String childDisplayName = childDisplay.getName(); if( ! parentDisplayName.equals( childDisplayName ) ) { return false; } if( parentScreen.getIndex() != childScreen.getIndex() ) { return false; } return true; }
@Override public synchronized final void resetDisplayGamma(final NativeSurface surface) { if( NativeSurface.LOCK_SURFACE_NOT_READY >= surface.lockSurface() ) { return; } try { final AbstractGraphicsScreen screen = surface.getGraphicsConfiguration().getScreen(); final DeviceScreenID deviceScreenID = new DeviceScreenID(screen.getDevice().getConnection(), screen.getIndex()); final Buffer originalGammaRamp = screen2OrigGammaRamp.remove(deviceScreenID); if( null != originalGammaRamp ) { resetGammaRamp(surface, originalGammaRamp); } } finally { surface.unlockSurface(); } }
@Override public final void unlockSurface() { final RecursiveLock _wlock = windowLock; _wlock.validateLocked(); if ( 1 == surfaceLockCount ) { final AbstractGraphicsDevice adevice = getGraphicsConfiguration().getScreen().getDevice(); try { unlockSurfaceImpl(); } finally { adevice.unlock(); } } surfaceLockCount--; _wlock.unlock(); }
@Override public void destroyNotify() { if(upstreamSurfaceHookLifecycleEnabled) { upstream.destroy(this); if( containsUpstreamOptionBits( ProxySurface.OPT_PROXY_OWNS_UPSTREAM_DEVICE ) ) { final AbstractGraphicsDevice aDevice = getGraphicsConfiguration().getScreen().getDevice(); aDevice.close(); clearUpstreamOptionBits( ProxySurface.OPT_PROXY_OWNS_UPSTREAM_DEVICE ); } invalidateImpl(); } this.surfaceHandle_old = 0; }
@Override protected final void swapBuffersImpl(final boolean doubleBuffered) { if(doubleBuffered) { final EGLGraphicsDevice eglDevice = (EGLGraphicsDevice) surface.getGraphicsConfiguration().getScreen().getDevice(); // single-buffer is already filtered out @ GLDrawableImpl#swapBuffers() if(!EGL.eglSwapBuffers(eglDevice.getHandle(), surface.getSurfaceHandle())) { throw new GLException("Error swapping buffers, eglError "+toHexString(EGL.eglGetError())+", "+this); } } }
@Override public final void unlockSurface() { surfaceLock.validateLocked(); drawable_old = drawable; if (surfaceLock.getHoldCount() == 1) { final AbstractGraphicsDevice adevice = getGraphicsConfiguration().getScreen().getDevice(); try { if(null != jawt) { unlockSurfaceImpl(); } } finally { adevice.unlock(); } } surfaceLock.unlock(); }
@Override public final void unlockSurface() { surfaceLock.validateLocked(); surfaceHandle_old = getSurfaceHandle(); if (surfaceLock.getHoldCount() == 1) { final AbstractGraphicsDevice adevice = getGraphicsConfiguration().getScreen().getDevice(); try { unlockSurfaceImpl(); } finally { adevice.unlock(); } } surfaceLock.unlock(); }
@Override public final void create(final ProxySurface s) { final EGLGraphicsDevice eglDevice = (EGLGraphicsDevice) s.getGraphicsConfiguration().getScreen().getDevice(); eglDevice.lock(); try { if(0 == eglDevice.getHandle()) { eglDevice.open(); s.addUpstreamOptionBits( ProxySurface.OPT_PROXY_OWNS_UPSTREAM_DEVICE ); } if( EGL.EGL_NO_SURFACE == s.getSurfaceHandle() ) { s.setSurfaceHandle( EGLDrawableFactory.createPBufferSurfaceImpl((EGLGraphicsConfiguration)s.getGraphicsConfiguration(), 64, 64, false) ); s.addUpstreamOptionBits( ProxySurface.OPT_PROXY_OWNS_UPSTREAM_SURFACE ); } s.addUpstreamOptionBits(ProxySurface.OPT_UPSTREAM_WINDOW_INVISIBLE); } finally { eglDevice.unlock(); } }