# Print output for @column tags ?>
public
static
class
SurfaceControl.Builder
extends Object
java.lang.Object | |
↳ | android.view.SurfaceControl.Builder |
Builder class for SurfaceControl
objects.
By default the surface will be hidden, and have "unset" bounds, meaning it can
be as large as the bounds of its parent if a buffer or child so requires.
It is necessary to set at least a name via Builder#setName
Public constructors | |
---|---|
Builder()
Begin building a SurfaceControl. |
Public methods | |
---|---|
SurfaceControl
|
build()
Construct a new |
SurfaceControl.Builder
|
setBufferSize(int width, int height)
Set the initial size of the controlled surface's buffers in pixels. |
SurfaceControl.Builder
|
setFormat(int format)
Set the pixel format of the controlled surface's buffers, using constants from
|
SurfaceControl.Builder
|
setName(String name)
Set a debugging-name for the SurfaceControl. |
SurfaceControl.Builder
|
setOpaque(boolean opaque)
Indicates whether the surface must be considered opaque, even if its pixel format is set to translucent. |
SurfaceControl.Builder
|
setParent(SurfaceControl parent)
Set a parent surface for our new SurfaceControl. |
Inherited methods | |
---|---|
public Builder ()
Begin building a SurfaceControl.
public SurfaceControl build ()
Construct a new SurfaceControl
with the set parameters. The builder
remains valid.
Returns | |
---|---|
SurfaceControl |
This value cannot be null . |
public SurfaceControl.Builder setBufferSize (int width, int height)
Set the initial size of the controlled surface's buffers in pixels.
Parameters | |
---|---|
width |
int : The buffer width in pixels.
Value is 0 or greater |
height |
int : The buffer height in pixels.
Value is 0 or greater |
Returns | |
---|---|
SurfaceControl.Builder |
This value cannot be null . |
public SurfaceControl.Builder setFormat (int format)
Set the pixel format of the controlled surface's buffers, using constants from
PixelFormat
.
Parameters | |
---|---|
format |
int : Value is PixelFormat.RGBA_8888 , PixelFormat.RGBX_8888 , PixelFormat.RGBA_F16 , PixelFormat.RGBA_1010102 , PixelFormat.RGB_888 , or PixelFormat.RGB_565 |
Returns | |
---|---|
SurfaceControl.Builder |
This value cannot be null . |
public SurfaceControl.Builder setName (String name)
Set a debugging-name for the SurfaceControl.
Parameters | |
---|---|
name |
String : A name to identify the Surface in debugging.
This value cannot be null . |
Returns | |
---|---|
SurfaceControl.Builder |
This value cannot be null . |
public SurfaceControl.Builder setOpaque (boolean opaque)
Indicates whether the surface must be considered opaque, even if its pixel format is set to translucent. This can be useful if an application needs full RGBA 8888 support for instance but will still draw every pixel opaque.
This flag only determines whether opacity will be sampled from the alpha channel. Plane-alpha from calls to setAlpha() can still result in blended composition regardless of the opaque setting. Combined effects are (assuming a buffer format with an alpha channel):
Parameters | |
---|---|
opaque |
boolean : Whether the Surface is OPAQUE. |
Returns | |
---|---|
SurfaceControl.Builder |
This value cannot be null . |
public SurfaceControl.Builder setParent (SurfaceControl parent)
Set a parent surface for our new SurfaceControl. Child surfaces are constrained to the onscreen region of their parent. Furthermore they stack relatively in Z order, and inherit the transformation of the parent.
Parameters | |
---|---|
parent |
SurfaceControl : The parent control.
This value may be null . |
Returns | |
---|---|
SurfaceControl.Builder |
This value cannot be null . |