public class UpstreamSurfaceHookMutableSize extends Object implements UpstreamSurfaceHook.MutableSize
UpstreamSurfaceHook.MutableSize
Constructor and Description |
---|
UpstreamSurfaceHookMutableSize(int width,
int height) |
Modifier and Type | Method and Description |
---|---|
void |
create(ProxySurface s)
called within
ProxySurface.createNotify() within lock, before using surface. |
void |
destroy(ProxySurface s)
called within
ProxySurface.destroyNotify() within lock, before clearing fields. |
int |
getSurfaceHeight(ProxySurface s)
Returns the height of the upstream surface in pixels, used if
ProxySurface#UPSTREAM_PROVIDES_SIZE is set. |
int |
getSurfaceWidth(ProxySurface s)
Returns the width of the upstream surface in pixels, used if
ProxySurface#UPSTREAM_PROVIDES_SIZE is set. |
NativeSurface |
getUpstreamSurface()
Returns the optional upstream
NativeSurface if used by implementation, otherwise null . |
void |
setSurfaceSize(int width,
int height)
Resizes the upstream surface.
|
String |
toString() |
public UpstreamSurfaceHookMutableSize(int width, int height)
width
- initial widthheight
- initial heightpublic final void setSurfaceSize(int width, int height)
UpstreamSurfaceHook.MutableSize
setSurfaceSize
in interface UpstreamSurfaceHook.MutableSize
width
- new width in pixel unitsheight
- new height in pixel unitspublic final int getSurfaceWidth(ProxySurface s)
UpstreamSurfaceHook
ProxySurface#UPSTREAM_PROVIDES_SIZE
is set.getSurfaceWidth
in interface UpstreamSurfaceHook
public final int getSurfaceHeight(ProxySurface s)
UpstreamSurfaceHook
ProxySurface#UPSTREAM_PROVIDES_SIZE
is set.getSurfaceHeight
in interface UpstreamSurfaceHook
public void create(ProxySurface s)
UpstreamSurfaceHook
ProxySurface.createNotify()
within lock, before using surface.create
in interface UpstreamSurfaceHook
public void destroy(ProxySurface s)
UpstreamSurfaceHook
ProxySurface.destroyNotify()
within lock, before clearing fields.destroy
in interface UpstreamSurfaceHook
public final NativeSurface getUpstreamSurface()
NativeSurface
if used by implementation, otherwise null
.
One example is the JOGL EGLWrappedSurface, which might be backed up by a native platform NativeSurface (X11, WGL, CGL, ..).
Returns null
.
getUpstreamSurface
in interface UpstreamSurfaceHook
Copyright 2010 JogAmp Community.