@Override public Object clone() { return super.clone(); } }
@Override public String toString() { return getClass().getSimpleName()+"[type "+getType()+", connection "+getConnection()+", unitID "+getUnitID()+", handle 0x"+Long.toHexString(getHandle())+", owner "+isHandleOwner()+", "+toolkitLock+"]"; }
public static final void swapDeviceHandleAndOwnership(final DefaultGraphicsDevice aDevice1, final DefaultGraphicsDevice aDevice2) { aDevice1.lock(); try { aDevice2.lock(); try { final long aDevice1Handle = aDevice1.getHandle(); final long aDevice2Handle = aDevice2.setHandle(aDevice1Handle); aDevice1.setHandle(aDevice2Handle); final Object aOwnership1 = aDevice1.getHandleOwnership(); final Object aOwnership2 = aDevice2.setHandleOwnership(aOwnership1); aDevice1.setHandleOwnership(aOwnership2); } finally { aDevice2.unlock(); } } finally { aDevice1.unlock(); } }
if( !aDevice1.getUniqueID().equals( aDevice2.getUniqueID() ) ) { throw new GLException("Incompatible devices: Preserved <"+aDevice2.getUniqueID()+">, target <"+aDevice1.getUniqueID()+">"); System.err.println("GLEventListenerState.moveTo.0b: pres 0x"+Integer.toHexString(aDevice2.hashCode())+", "+aDevice2); DefaultGraphicsDevice.swapDeviceHandleAndOwnership(aDevice1, aDevice2); aDevice2.close(); if( DEBUG ) { System.err.println("GLEventListenerState.moveTo.1a: orig 0x"+Integer.toHexString(aDevice1.hashCode())+", "+aDevice1); final DefaultGraphicsDevice aUpDevice1 = (DefaultGraphicsDevice) aUpCfg.getScreen().getDevice(); final DefaultGraphicsDevice aUpDevice2 = (DefaultGraphicsDevice)upstreamDevice; if( !aUpDevice1.getUniqueID().equals( aUpDevice2.getUniqueID() ) ) { throw new GLException("Incompatible updtream devices: Preserved <"+aUpDevice2.getUniqueID()+">, target <"+aUpDevice1.getUniqueID()+">"); System.err.println("GLEventListenerState.moveTo.2c: "+aUpSurface.getClass().getName()/*+", "+aUpSurface+", "*/+aProxy.getUpstreamOptionBits(null).toString()); DefaultGraphicsDevice.swapDeviceHandleAndOwnership(aUpDevice1, aUpDevice2); aUpDevice2.close(); if( proxyOwnsUpstreamDevice ) { aProxy.addUpstreamOptionBits( ProxySurface.OPT_PROXY_OWNS_UPSTREAM_DEVICE );
@Override public boolean close() { if(handleOwner && 0 != handle) { if(DEBUG) { System.err.println(Thread.currentThread().getName() + " - X11GraphicsDevice.close(): "+this); } X11Util.closeDisplay(handle); } return super.close(); }
public static AbstractGraphicsScreen createDefault(final String type) { return new DefaultGraphicsScreen(new DefaultGraphicsDevice(type, AbstractGraphicsDevice.DEFAULT_CONNECTION, AbstractGraphicsDevice.DEFAULT_UNIT), 0); }
/** * Create an instance with the given {@link ToolkitLock} instance, or <i>null</i> {@link ToolkitLock} if null. * @param type * @param handle * @param locker if null, a non blocking <i>null</i> lock is used. */ public DefaultGraphicsDevice(final String type, final String connection, final int unitID, final long handle, final ToolkitLock locker) { this.type = type; this.connection = connection; this.unitID = unitID; this.uniqueID = getUniqueID(type, connection, unitID); this.handle = handle; this.toolkitLock = null != locker ? locker : NativeWindowFactoryImpl.getNullToolkitLock(); }
/** * Closes the EGL device if handle is not null and it's {@link EGLDisplayLifecycleCallback} is valid. * <p> * {@inheritDoc} * </p> */ @Override public boolean close() { if(null != eglLifecycleCallback && 0 != handle) { if(DEBUG) { System.err.println(Thread.currentThread().getName() + " - EGLGraphicsDevice.close(): "+this); } eglLifecycleCallback.eglTerminate(handle); } return super.close(); }
@Override public Object clone() { return super.clone(); } }
@Override public Object clone() { return super.clone(); }
@Override public Object clone() { return super.clone(); }
@Override public Object clone() { return super.clone(); }