From 64518911395ee9698a326f4ca01b2ad28dabf673 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Sun, 8 Jun 2014 07:23:14 +0200 Subject: UpstreamSurfaceHook: Add 'NativeSurface getUpstreamSurface()' (from EGLUpstreamSurfaceHook) to generalize ProxySurfaceImpl.getUpstreamSurface() --- .../DelegatedUpstreamSurfaceHookWithSurfaceSize.java | 13 ++++++++++++- .../jogamp/nativewindow/UpstreamSurfaceHookMutableSize.java | 12 ++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) (limited to 'src/nativewindow/classes/com') diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/DelegatedUpstreamSurfaceHookWithSurfaceSize.java b/src/nativewindow/classes/com/jogamp/nativewindow/DelegatedUpstreamSurfaceHookWithSurfaceSize.java index 9a462105f..568ac20fa 100644 --- a/src/nativewindow/classes/com/jogamp/nativewindow/DelegatedUpstreamSurfaceHookWithSurfaceSize.java +++ b/src/nativewindow/classes/com/jogamp/nativewindow/DelegatedUpstreamSurfaceHookWithSurfaceSize.java @@ -10,7 +10,7 @@ public class DelegatedUpstreamSurfaceHookWithSurfaceSize implements UpstreamSurf /** * @param upstream optional upstream UpstreamSurfaceHook used for {@link #create(ProxySurface)} and {@link #destroy(ProxySurface)}. - * @param surface mandatory {@link NativeSurface} used for {@link #getSurfaceWidth(ProxySurface)} and {@link #getSurfaceHeight(ProxySurface)} + * @param surface mandatory {@link NativeSurface} used for {@link #getSurfaceWidth(ProxySurface)} and {@link #getSurfaceHeight(ProxySurface)}, not used for {@link #getUpstreamSurface()}. */ public DelegatedUpstreamSurfaceHookWithSurfaceSize(UpstreamSurfaceHook upstream, NativeSurface surface) { this.upstream = upstream; @@ -20,6 +20,17 @@ public class DelegatedUpstreamSurfaceHookWithSurfaceSize implements UpstreamSurf } } + /** + * {@inheritDoc} + *

+ * Returns null. + *

+ */ + @Override + public final NativeSurface getUpstreamSurface() { + return null; + } + @Override public final void create(ProxySurface s) { if(null != upstream) { diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/UpstreamSurfaceHookMutableSize.java b/src/nativewindow/classes/com/jogamp/nativewindow/UpstreamSurfaceHookMutableSize.java index 25e2bbd49..eca64db37 100644 --- a/src/nativewindow/classes/com/jogamp/nativewindow/UpstreamSurfaceHookMutableSize.java +++ b/src/nativewindow/classes/com/jogamp/nativewindow/UpstreamSurfaceHookMutableSize.java @@ -1,5 +1,6 @@ package com.jogamp.nativewindow; +import javax.media.nativewindow.NativeSurface; import javax.media.nativewindow.ProxySurface; import javax.media.nativewindow.UpstreamSurfaceHook; @@ -41,5 +42,16 @@ public class UpstreamSurfaceHookMutableSize implements UpstreamSurfaceHook.Mutab return getClass().getSimpleName()+"[pixel "+ pixWidth + "x" + pixHeight + "]"; } + /** + * {@inheritDoc} + *

+ * Returns null. + *

+ */ + @Override + public final NativeSurface getUpstreamSurface() { + return null; + } + } -- cgit v1.2.3