public interface SurfaceOps
This interface is implemented by users.
| 限定符和类型 | 接口 | 说明 |
|---|---|---|
static interface |
SurfaceOps.Callback |
Represents the callback of the surface ops.
|
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
void |
addCallback(SurfaceOps.Callback callback) |
Adds the callback of a surface ops.
|
Surface |
getSurface() |
Obtains the surface held by the surface ops.
|
Rect |
getSurfaceDimension() |
Obtains the dimension of this surface.
|
Canvas |
lockCanvas() |
Locks the
Canvas of a surface ops to enable drawing on the canvas. |
void |
removeCallback(SurfaceOps.Callback callback) |
Removes the callback of a surface ops.
|
void |
setFixedSize(int width,
int height) |
Sets a fixed size for the surface.
|
void |
setFormat(int format) |
Sets the pixel format of the surface.
|
void |
setKeepScreenOn(boolean isOn) |
Sets whether the screen is always on.
|
void |
unlockCanvasAndPost(Canvas canvas) |
Releases a
lockCanvas() instance and displays it on the screen. |
void addCallback(SurfaceOps.Callback callback)
callback - Indicates the callback of the surface ops.void removeCallback(SurfaceOps.Callback callback)
callback - Indicates the callback of the surface ops.void setFormat(int format)
format - Indicates the pixel format of the surface.Canvas lockCanvas()
Canvas of a surface ops to enable drawing on the canvas.void unlockCanvasAndPost(Canvas canvas)
lockCanvas() instance and displays it on the screen.canvas - Indicates the canvas to release.Surface getSurface()
void setFixedSize(int width,
int height)
width - Indicates the width of the surface.height - Indicates the height of the surface.void setKeepScreenOn(boolean isOn)
isOn - Specifies whether the screen is always on. True indicates that the screen is
always on; False indicates that the screen is not always on.