@Override public void releaseSharedResource(SharedResourceRunner.Resource shared) { SharedResource sr = (SharedResource) shared; if (DEBUG) { System.err.println("Shutdown Shared:"); System.err.println("Device : " + sr.device); System.err.println("Screen : " + sr.screen); System.err.println("Drawable: " + sr.drawable); System.err.println("CTX : " + sr.context); Thread.dumpStack(); } if (null != sr.context) { // may cause JVM SIGSEGV, or freeze (ATI fglrx 3-6-beta2 32on64 shared ctx): sr.context.destroy(); // will also pull the dummy MutableSurface sr.context = null; } if (null != sr.drawable) { // may cause JVM SIGSEGV: sr.drawable.setRealized(false); sr.drawable = null; } if (null != sr.screen) { sr.screen = null; } if (null != sr.device) { // may cause JVM SIGSEGV: sr.device.close(); sr.device = null; } }
@Override protected final GLDrawableImpl createOffscreenDrawableImpl(NativeSurface target) { if (target == null) { throw new IllegalArgumentException("Null target"); } AbstractGraphicsConfiguration config = target.getGraphicsConfiguration(); GLCapabilitiesImmutable caps = (GLCapabilitiesImmutable) config.getChosenCapabilities(); if (!caps.isPBuffer()) { return new X11PixmapGLXDrawable(this, target); } // PBuffer GLDrawable Creation GLDrawableImpl pbufferDrawable; AbstractGraphicsDevice device = config.getScreen().getDevice(); /** * Due to the ATI Bug https://bugzilla.mozilla.org/show_bug.cgi?id=486277, we need to have a * context current on the same Display to create a PBuffer. The dummy context shall also use the * same Display, since switching Display in this regard is another ATI bug. */ SharedResource sr = (SharedResource) sharedResourceRunner.getOrCreateShared(device); if (null != sr && sr.isGLXVendorATI() && null == GLContext.getCurrent()) { sr.getContext().makeCurrent(); try { pbufferDrawable = new X11PbufferGLXDrawable(this, target); } finally { sr.getContext().release(); } } else { pbufferDrawable = new X11PbufferGLXDrawable(this, target); } return pbufferDrawable; }
public final boolean isGLXMultisampleAvailable(AbstractGraphicsDevice device) { if (null != device) { SharedResource sr = (SharedResource) sharedResourceRunner.getOrCreateShared(device); if (null != sr) { return sr.isGLXMultisampleAvailable(); } } return false; }
public final VersionNumber getGLXVersionNumber(AbstractGraphicsDevice device) { if (null != device) { SharedResource sr = (SharedResource) sharedResourceRunner.getOrCreateShared(device); if (null != sr) { return sr.getGLXVersion(); } if (device instanceof X11GraphicsDevice) { return GLXUtil.getGLXServerVersionNumber((X11GraphicsDevice) device); } } return null; }
public final boolean isGLXVersionGreaterEqualOneThree(AbstractGraphicsDevice device) { if (null != device) { SharedResource sr = (SharedResource) sharedResourceRunner.getOrCreateShared(device); if (null != sr) { return sr.isGLXVersionGreaterEqualOneThree(); } if (device instanceof X11GraphicsDevice) { final VersionNumber glXServerVersion = GLXUtil.getGLXServerVersionNumber((X11GraphicsDevice) device); return glXServerVersion.compareTo(versionOneThree) >= 0; } } return false; }
@Override public void handleAsyncEvent() { devices.Console.println("---------- PEH2.handleAsyncEvent"); shared.go(); devices.Console.println(" PEH2: " + count); count++; }
private void dumpMap() { synchronized (sharedMap) { System.err.println("EGLDrawableFactory.map " + sharedMap.size()); int i = 0; Set<String> keys = sharedMap.keySet(); for (Iterator<String> keyI = keys.iterator(); keyI.hasNext(); i++) { String key = keyI.next(); SharedResource sr = sharedMap.get(key); System.err.println( "EGLDrawableFactory.map[" + i + "] " + key + " -> " + sr.getDevice() + ", " + "es1 [avail " + sr.wasES1ContextCreated + ", pbuffer " + sr.hasPBufferES1 + ", quirks " + sr.rendererQuirksES1 + ", ctp " + EGLContext.getGLVersion(1, 0, sr.ctpES1, null) + "], " + "es2/3 [es2 " + sr.wasES2ContextCreated + ", es3 " + sr.wasES3ContextCreated + ", [pbuffer " + sr.hasPBufferES3ES2 + ", quirks " + sr.rendererQuirksES3ES2 + ", ctp " + EGLContext.getGLVersion(2, 0, sr.ctpES3ES2, null) + "]]"); } ; } }
@Override @IcecapCompileMe public void handleAsyncEvent() { devices.Console.println("---------- PEH1.handleAsyncEvent"); shared.waitForGo(); count++; devices.Console.println(" PEH1: " + count); if (count == 3) { m.requestTermination(); devices.Console.println(" Mission T"); } }