java.lang.Object | |
↳ | org.libpag.PAGSurface |
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
|
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.
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.
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)
).
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)
).
Erases all pixels of this surface with transparent color. Returns true if the content has changed.
Copies pixels from current PAGSurface to the specified bitmap.
Free the cache created by the surface immediately. Call this method can reduce memory pressure.
The height of surface in pixels.
Returns a bitmap capturing the contents of the PAGSurface. Subsequent rendering of the PAGSurface will not be captured.
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.
Update the size of surface, and reset the internal surface.
The width of surface in pixels.