SurfaceControl.Transaction
public
static
class
SurfaceControl.Transaction
extends Object
implements
Closeable
| java.lang.Object | |
| ↳ | android.view.SurfaceControl.Transaction |
An atomic set of changes to a set of SurfaceControl.
Summary
Public constructors | |
|---|---|
SurfaceControl.Transaction()
Open a new transaction object. |
|
Public methods | |
|---|---|
void
|
apply()
Apply the transaction, clearing it's state, and making it usable as a new transaction. |
void
|
close()
Release the native transaction object, without applying it. |
SurfaceControl.Transaction
|
merge(SurfaceControl.Transaction other)
Merge the other transaction into this transaction, clearing the other transaction as if it had been applied. |
SurfaceControl.Transaction
|
reparent(SurfaceControl sc, SurfaceControl newParent)
Re-parents a given layer to a new parent. |
SurfaceControl.Transaction
|
setAlpha(SurfaceControl sc, float alpha)
Set the alpha for a given surface. |
SurfaceControl.Transaction
|
setBufferSize(SurfaceControl sc, int w, int h)
Set the default buffer size for the SurfaceControl, if there is a
|
SurfaceControl.Transaction
|
setGeometry(SurfaceControl sc, Rect sourceCrop, Rect destFrame, int orientation)
Specify how the buffer assosciated with this Surface is mapped in to the parent coordinate space. |
SurfaceControl.Transaction
|
setLayer(SurfaceControl sc, int z)
Set the Z-order for a given SurfaceControl, relative to it's siblings. |
SurfaceControl.Transaction
|
setVisibility(SurfaceControl sc, boolean visible)
Toggle the visibility of a given Layer and it's sub-tree. |
Inherited methods | |
|---|---|
Public constructors
SurfaceControl.Transaction
public SurfaceControl.Transaction ()
Open a new transaction object. The transaction may be filed with commands to
manipulate SurfaceControl instances, and then applied atomically with
apply(). Eventually the user should invoke close(), when the object
is no longer required. Note however that re-using a transaction after a call to apply
is allowed as a convenience.
Public methods
apply
public void apply ()
Apply the transaction, clearing it's state, and making it usable as a new transaction.
close
public void close ()
Release the native transaction object, without applying it.
merge
public SurfaceControl.Transaction merge (SurfaceControl.Transaction other)
Merge the other transaction into this transaction, clearing the other transaction as if it had been applied.
| Parameters | |
|---|---|
other |
SurfaceControl.Transaction: The transaction to merge in to this one.
This value must never be null. |
| Returns | |
|---|---|
SurfaceControl.Transaction |
This transaction.
This value will never be null. |
reparent
public SurfaceControl.Transaction reparent (SurfaceControl sc, SurfaceControl newParent)
Re-parents a given layer to a new parent. Children inherit transform (position, scaling) crop, visibility, and Z-ordering from their parents, as if the children were pixels within the parent Surface.
| Parameters | |
|---|---|
sc |
SurfaceControl: The SurfaceControl to reparent
This value must never be null. |
newParent |
SurfaceControl: The new parent for the given control.
This value may be null. |
| Returns | |
|---|---|
SurfaceControl.Transaction |
This Transaction
This value will never be null. |
setAlpha
public SurfaceControl.Transaction setAlpha (SurfaceControl sc, float alpha)
Set the alpha for a given surface. If the alpha is non-zero the SurfaceControl will be blended with the Surfaces under it according to the specified ratio.
| Parameters | |
|---|---|
sc |
SurfaceControl: The given SurfaceControl.
This value must never be null. |
alpha |
float: The alpha to set.
Value is between 0.0 and 1.0 inclusive |
| Returns | |
|---|---|
SurfaceControl.Transaction |
This value will never be null. |
setBufferSize
public SurfaceControl.Transaction setBufferSize (SurfaceControl sc, int w, int h)
Set the default buffer size for the SurfaceControl, if there is a
Surface associated with the control, then
this will be the default size for buffers dequeued from it.
| Parameters | |
|---|---|
sc |
SurfaceControl: The surface to set the buffer size for.
This value must never be null. |
w |
int: The default width
Value is 0 or greater |
h |
int: The default height
Value is 0 or greater |
| Returns | |
|---|---|
SurfaceControl.Transaction |
This Transaction
This value will never be null. |
setGeometry
public SurfaceControl.Transaction setGeometry (SurfaceControl sc, Rect sourceCrop, Rect destFrame, int orientation)
Specify how the buffer assosciated with this Surface is mapped in to the parent coordinate space. The source frame will be scaled to fit the destination frame, after being rotated according to the orientation parameter.
| Parameters | |
|---|---|
sc |
SurfaceControl: The SurfaceControl to specify the geometry of
This value must never be null. |
sourceCrop |
Rect: The source rectangle in buffer space. Or null for the entire buffer.
This value may be null. |
destFrame |
Rect: The destination rectangle in parent space. Or null for the source frame.
This value may be null. |
orientation |
int: The buffer rotation
Value is Surface.ROTATION_0, Surface.ROTATION_90, Surface.ROTATION_180, or Surface.ROTATION_270 |
| Returns | |
|---|---|
SurfaceControl.Transaction |
This transaction object. |
setLayer
public SurfaceControl.Transaction setLayer (SurfaceControl sc, int z)
Set the Z-order for a given SurfaceControl, relative to it's siblings. If two siblings share the same Z order the ordering is undefined. Surfaces with a negative Z will be placed below the parent surface.
| Parameters | |
|---|---|
sc |
SurfaceControl: The SurfaceControl to set the Z order on
This value must never be null. |
z |
int: The Z-order
Value is between Integer.MIN_VALUE and Integer.MAX_VALUE inclusive |
| Returns | |
|---|---|
SurfaceControl.Transaction |
This Transaction.
This value will never be null. |
setVisibility
public SurfaceControl.Transaction setVisibility (SurfaceControl sc, boolean visible)
Toggle the visibility of a given Layer and it's sub-tree.
| Parameters | |
|---|---|
sc |
SurfaceControl: The SurfaceControl for which to set the visibility
This value must never be null. |
visible |
boolean: The new visibility |
| Returns | |
|---|---|
SurfaceControl.Transaction |
This transaction object.
This value will never be null. |