public class

PAGSurface

extends Object
java.lang.Object
   ↳ org.libpag.PAGSurface

Summary

Public Methods
static PAGSurface FromSurface(Surface surface)
static PAGSurface FromSurface(Surface surface, EGLContext shareContext)
static PAGSurface FromSurfaceTexture(SurfaceTexture surfaceTexture, EGLContext shareContext)
static PAGSurface FromSurfaceTexture(SurfaceTexture surfaceTexture)
static PAGSurface FromTexture(int textureID, int width, int height)
Create a PAGSurface from specified OpenGL texture, return null if there is no current OpenGL context or the texture is invalid.
static PAGSurface FromTexture(int textureID, int width, int height, boolean flipY)
Create a PAGSurface from specified OpenGL texture, return null if there is no current OpenGL context or the texture is invalid.
static PAGSurface FromTextureForAsyncThread(int textureID, int width, int height, boolean flipY)
Create a PAGSurface from specified OpenGL texture, return null if there is no current OpenGL context or the texture is invalid.
static PAGSurface FromTextureForAsyncThread(int textureID, int width, int height)
Create a PAGSurface from specified OpenGL texture, return null if there is no current OpenGL context or the texture is invalid.
static PAGSurface MakeOffscreen(int width, int height)
static long SetupFromTexture(int textureID, int width, int height, boolean flipY, boolean forAsyncThread)
boolean clearAll()
Erases all pixels of this surface with transparent color.
boolean copyPixelsTo(Bitmap bitmap)
Copies pixels from current PAGSurface to the specified bitmap.
void freeCache()
Free the cache created by the surface immediately.
int height()
The height of surface in pixels.
Bitmap makeSnapshot()
Returns a bitmap capturing the contents of the PAGSurface.
void release()
Free up resources used by the PAGSurface instance immediately instead of relying on the garbage collector to do this for you at some point in the future.
void updateSize()
Update the size of surface, and reset the internal surface.
int width()
The width of surface in pixels.
Protected Methods
void finalize()
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public static PAGSurface FromSurface (Surface surface)

public static PAGSurface FromSurface (Surface surface, EGLContext shareContext)

public static PAGSurface FromSurfaceTexture (SurfaceTexture surfaceTexture, EGLContext shareContext)

public static PAGSurface FromSurfaceTexture (SurfaceTexture surfaceTexture)

public static PAGSurface FromTexture (int textureID, int width, int height)

Create a PAGSurface from specified OpenGL texture, return null if there is no current OpenGL context or the texture is invalid. Note: 1. The target of texture must be GL_TEXTURE_2D. 2. The texture should not bind to any frameBuffer. 3. PAG will use the current (OpenGL) context.

public static PAGSurface FromTexture (int textureID, int width, int height, boolean flipY)

Create a PAGSurface from specified OpenGL texture, return null if there is no current OpenGL context or the texture is invalid. Note: 1. The target of texture must be GL_TEXTURE_2D. 2. The texture should not bind to any frameBuffer. 3. PAG will use the current (OpenGL) context.

public static PAGSurface FromTextureForAsyncThread (int textureID, int width, int height, boolean flipY)

Create a PAGSurface from specified OpenGL texture, return null if there is no current OpenGL context or the texture is invalid. Note: 1. The target of texture must be GL_TEXTURE_2D. 2. The texture should not bind to any frameBuffer. 3. PAG will use a shared (OpenGL) context with the current. 4. The caller can use fence sync objects to synchronise texture content (see flushAndFenceSync(long[]) and waitSync(long)).

public static PAGSurface FromTextureForAsyncThread (int textureID, int width, int height)

Create a PAGSurface from specified OpenGL texture, return null if there is no current OpenGL context or the texture is invalid. Note: 1. The target of texture must be GL_TEXTURE_2D. 2. The texture should not bind to any frameBuffer. 3. PAG will use a shared (OpenGL) context with the current. 4. The caller can use fence sync objects to synchronise texture content (see flushAndFenceSync(long[]) and waitSync(long)).

public static PAGSurface MakeOffscreen (int width, int height)

public static long SetupFromTexture (int textureID, int width, int height, boolean flipY, boolean forAsyncThread)

public boolean clearAll ()

Erases all pixels of this surface with transparent color. Returns true if the content has changed.

public boolean copyPixelsTo (Bitmap bitmap)

Copies pixels from current PAGSurface to the specified bitmap.

public void freeCache ()

Free the cache created by the surface immediately. Call this method can reduce memory pressure.

public int height ()

The height of surface in pixels.

public Bitmap makeSnapshot ()

Returns a bitmap capturing the contents of the PAGSurface. Subsequent rendering of the PAGSurface will not be captured.

public void release ()

Free up resources used by the PAGSurface instance immediately instead of relying on the garbage collector to do this for you at some point in the future.

public void updateSize ()

Update the size of surface, and reset the internal surface.

public int width ()

The width of surface in pixels.

Protected Methods

protected void finalize ()