aboutsummaryrefslogtreecommitdiffstats
path: root/src/nativewindow
diff options
context:
space:
mode:
Diffstat (limited to 'src/nativewindow')
-rw-r--r--src/nativewindow/classes/javax/media/nativewindow/ProxySurface.java15
-rw-r--r--src/nativewindow/classes/jogamp/nativewindow/ProxySurfaceImpl.java32
2 files changed, 31 insertions, 16 deletions
diff --git a/src/nativewindow/classes/javax/media/nativewindow/ProxySurface.java b/src/nativewindow/classes/javax/media/nativewindow/ProxySurface.java
index 395fdc818..a83739a1d 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/ProxySurface.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/ProxySurface.java
@@ -65,7 +65,20 @@ public interface ProxySurface extends MutableSurface {
/** Allow redefining the AbstractGraphicsConfiguration */
public void setGraphicsConfiguration(AbstractGraphicsConfiguration cfg);
- /** Returns the set {@link UpstreamSurfaceHook}, or null if not set. */
+ /**
+ * Return the upstream {@link NativeSurface} if used, otherwise <code>null</code>.
+ * <p>
+ * An upstream {@link NativeSurface} may backup this {@link ProxySurface} instance's representation,
+ * e.g. via a {@link #setUpstreamSurfaceHook(UpstreamSurfaceHook) set} {@link UpstreamSurfaceHook}.
+ * </p>
+ * <p>
+ * One example is the JOGL EGLWrappedSurface, which might be backed up by a
+ * native platform NativeSurface (X11, WGL, CGL, ..).
+ * </p>
+ */
+ public NativeSurface getUpstreamSurface();
+
+ /** Returns the {@link UpstreamSurfaceHook} if {@link #setUpstreamSurfaceHook(UpstreamSurfaceHook) set}, otherwise <code>null</code>. */
public UpstreamSurfaceHook getUpstreamSurfaceHook();
/**
diff --git a/src/nativewindow/classes/jogamp/nativewindow/ProxySurfaceImpl.java b/src/nativewindow/classes/jogamp/nativewindow/ProxySurfaceImpl.java
index 63f56cbae..56e342793 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/ProxySurfaceImpl.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/ProxySurfaceImpl.java
@@ -42,7 +42,6 @@ import com.jogamp.common.util.locks.RecursiveLock;
public abstract class ProxySurfaceImpl implements ProxySurface {
private final SurfaceUpdatedHelper surfaceUpdatedHelper = new SurfaceUpdatedHelper();
- protected long displayHandle; // convenient ref of config.screen.device.handle
private AbstractGraphicsConfiguration config; // control access due to delegation
private UpstreamSurfaceHook upstream;
private long surfaceHandle_old;
@@ -65,7 +64,6 @@ public abstract class ProxySurfaceImpl implements ProxySurface {
throw new IllegalArgumentException("null UpstreamSurfaceHook");
}
this.config = cfg;
- this.displayHandle=config.getNativeGraphicsConfiguration().getScreen().getDevice().getHandle();
this.upstream = upstream;
this.surfaceHandle_old = 0;
this.implBitfield = 0;
@@ -76,9 +74,12 @@ public abstract class ProxySurfaceImpl implements ProxySurface {
}
@Override
- public final UpstreamSurfaceHook getUpstreamSurfaceHook() { return upstream; }
+ public NativeSurface getUpstreamSurface() { return null; }
@Override
+ public final UpstreamSurfaceHook getUpstreamSurfaceHook() { return upstream; }
+
+ @Override
public void setUpstreamSurfaceHook(UpstreamSurfaceHook hook) {
if(null == hook) {
throw new IllegalArgumentException("null UpstreamSurfaceHook");
@@ -96,7 +97,6 @@ public abstract class ProxySurfaceImpl implements ProxySurface {
if(upstreamSurfaceHookLifecycleEnabled) {
upstream.create(this);
}
- this.displayHandle=config.getNativeGraphicsConfiguration().getScreen().getDevice().getHandle();
this.surfaceHandle_old = 0;
}
@@ -111,7 +111,6 @@ public abstract class ProxySurfaceImpl implements ProxySurface {
}
invalidateImpl();
}
- this.displayHandle = 0;
this.surfaceHandle_old = 0;
}
@@ -123,11 +122,6 @@ public abstract class ProxySurfaceImpl implements ProxySurface {
throw new InternalError("UpstreamSurfaceHook given, but required method not implemented.");
}
- @Override
- public final long getDisplayHandle() {
- return displayHandle;
- }
-
protected final AbstractGraphicsConfiguration getPrivateGraphicsConfiguration() {
return config;
}
@@ -138,6 +132,11 @@ public abstract class ProxySurfaceImpl implements ProxySurface {
}
@Override
+ public final long getDisplayHandle() {
+ return config.getNativeGraphicsConfiguration().getScreen().getDevice().getHandle();
+ }
+
+ @Override
public final void setGraphicsConfiguration(AbstractGraphicsConfiguration cfg) {
config = cfg;
}
@@ -305,12 +304,15 @@ public abstract class ProxySurfaceImpl implements ProxySurface {
if(null == sink) {
sink = new StringBuilder();
}
- sink.append(getUpstreamSurfaceHook()).
- append(", displayHandle 0x" + Long.toHexString(getDisplayHandle())).
- append(", surfaceHandle 0x" + Long.toHexString(getSurfaceHandle())).
- append(", size " + getWidth() + "x" + getHeight()).append(", ");
+ sink.append("displayHandle 0x" + Long.toHexString(getDisplayHandle())).
+ append("\n, surfaceHandle 0x" + Long.toHexString(getSurfaceHandle())).
+ append("\n, size " + getWidth() + "x" + getHeight()).append("\n, ");
getUpstreamOptionBits(sink);
- sink.append(", surfaceLock "+surfaceLock);
+ sink.append("\n, "+config).
+ append("\n, surfaceLock "+surfaceLock+"\n, ").
+ append(getUpstreamSurfaceHook()).
+ append("\n, upstreamSurface "+(null != getUpstreamSurface()));
+ // append("\n, upstreamSurface "+getUpstreamSurface());
return sink;
}