public abstract class DisplayList extends Object
Canvas
. Replaying the operations from a display list
avoids executing views drawing code on every frame, and is thus much more
efficient.Modifier and Type | Field and Description |
---|---|
static int |
FLAG_CLIP_CHILDREN
Flag used when calling
HardwareCanvas.drawDisplayList(DisplayList, android.graphics.Rect, int)
When this flag is set, draw operations lying outside of the bounds of the
display list will be culled early. |
static int |
STATUS_DONE
Indicates that the display list is done drawing.
|
static int |
STATUS_DRAW
Indicates that the display list needs another drawing pass.
|
static int |
STATUS_DREW
Indicates that the display list performed GL drawing operations.
|
static int |
STATUS_INVOKE
Indicates that the display list needs to re-execute its GL functors.
|
Constructor and Description |
---|
DisplayList() |
Modifier and Type | Method and Description |
---|---|
abstract void |
clear()
Clears additional resources held onto by this display list.
|
abstract void |
end()
Ends the recording for this display list.
|
abstract int |
getSize()
Return the amount of memory used by this display list.
|
abstract void |
invalidate()
Invalidates the display list, indicating that it should be repopulated
with new drawing commands prior to being used again.
|
abstract boolean |
isValid()
Returns whether the display list is currently usable.
|
abstract void |
offsetLeftRight(int offset)
Offsets the left and right values for the DisplayList
|
abstract void |
offsetTopBottom(int offset)
Offsets the top and bottom values for the DisplayList
|
abstract void |
reset()
Reset native resources.
|
abstract void |
setAlpha(float alpha)
Sets the alpha value for the DisplayList
|
abstract void |
setAnimationMatrix(Matrix matrix)
Set the Animation matrix on the DisplayList.
|
abstract void |
setBottom(int bottom)
Sets the bottom value for the DisplayList
|
abstract void |
setCaching(boolean caching)
Set the caching property on the DisplayList, which indicates whether the DisplayList
holds a layer.
|
abstract void |
setCameraDistance(float distance)
Sets the camera distance for the DisplayList
|
abstract void |
setClipChildren(boolean clipChildren)
Set whether the DisplayList should clip itself to its bounds.
|
abstract void |
setHasOverlappingRendering(boolean hasOverlappingRendering)
Sets whether the DisplayList renders content which overlaps.
|
abstract void |
setLeft(int left)
Sets the left value for the DisplayList
|
abstract void |
setLeftTop(int left,
int top)
Sets the left and top values for the DisplayList
|
abstract void |
setLeftTopRightBottom(int left,
int top,
int right,
int bottom)
Sets the left and top values for the DisplayList
|
abstract void |
setPivotX(float pivotX)
Sets the pivotX value for the DisplayList
|
abstract void |
setPivotY(float pivotY)
Sets the pivotY value for the DisplayList
|
abstract void |
setRight(int right)
Sets the right value for the DisplayList
|
abstract void |
setRotation(float rotation)
Sets the rotation value for the DisplayList
|
abstract void |
setRotationX(float rotationX)
Sets the rotationX value for the DisplayList
|
abstract void |
setRotationY(float rotationY)
Sets the rotationY value for the DisplayList
|
abstract void |
setScaleX(float scaleX)
Sets the scaleX value for the DisplayList
|
abstract void |
setScaleY(float scaleY)
Sets the scaleY value for the DisplayList
|
abstract void |
setStaticMatrix(Matrix matrix)
Set the static matrix on the DisplayList.
|
abstract void |
setTop(int top)
Sets the top value for the DisplayList
|
abstract void |
setTransformationInfo(float alpha,
float translationX,
float translationY,
float rotation,
float rotationX,
float rotationY,
float scaleX,
float scaleY)
Sets all of the transform-related values of the View onto the DisplayList
|
abstract void |
setTranslationX(float translationX)
Sets the translationX value for the DisplayList
|
abstract void |
setTranslationY(float translationY)
Sets the translationY value for the DisplayList
|
abstract HardwareCanvas |
start()
Starts recording the display list.
|
public static final int FLAG_CLIP_CHILDREN
HardwareCanvas.drawDisplayList(DisplayList, android.graphics.Rect, int)
When this flag is set, draw operations lying outside of the bounds of the
display list will be culled early. It is recommeneded to always set this
flag.public static final int STATUS_DONE
public static final int STATUS_DRAW
public static final int STATUS_INVOKE
public static final int STATUS_DREW
public abstract HardwareCanvas start()
public abstract void end()
public abstract void invalidate()
isValid()
to return false
.public abstract void clear()
invalidate()
.public abstract boolean isValid()
public abstract int getSize()
public abstract void setCaching(boolean caching)
caching
- true if the DisplayList represents a hardware layer, false otherwise.public abstract void setClipChildren(boolean clipChildren)
clipChildren
- true if the DisplayList should clip to its boundspublic abstract void setStaticMatrix(Matrix matrix)
ViewGroup.getChildStaticTransformation(View, android.view.animation.Transformation)
and also has ViewGroup.setStaticTransformationsEnabled(boolean)
set to true.
This matrix will be concatenated with any other matrices in the DisplayList to position
the view appropriately.matrix
- The matrixpublic abstract void setAnimationMatrix(Matrix matrix)
null
for the matrix parameter.matrix
- The matrix, null indicates that the matrix should be cleared.public abstract void setAlpha(float alpha)
alpha
- The translucency of the DisplayListView.setAlpha(float)
public abstract void setHasOverlappingRendering(boolean hasOverlappingRendering)
hasOverlappingRendering
- View.hasOverlappingRendering()
public abstract void setTranslationX(float translationX)
translationX
- The translationX value of the DisplayListView.setTranslationX(float)
public abstract void setTranslationY(float translationY)
translationY
- The translationY value of the DisplayListView.setTranslationY(float)
public abstract void setRotation(float rotation)
rotation
- The rotation value of the DisplayListView.setRotation(float)
public abstract void setRotationX(float rotationX)
rotationX
- The rotationX value of the DisplayListView.setRotationX(float)
public abstract void setRotationY(float rotationY)
rotationY
- The rotationY value of the DisplayListView.setRotationY(float)
public abstract void setScaleX(float scaleX)
scaleX
- The scaleX value of the DisplayListView.setScaleX(float)
public abstract void setScaleY(float scaleY)
scaleY
- The scaleY value of the DisplayListView.setScaleY(float)
public abstract void setTransformationInfo(float alpha, float translationX, float translationY, float rotation, float rotationX, float rotationY, float scaleX, float scaleY)
alpha
- The alpha value of the DisplayListtranslationX
- The translationX value of the DisplayListtranslationY
- The translationY value of the DisplayListrotation
- The rotation value of the DisplayListrotationX
- The rotationX value of the DisplayListrotationY
- The rotationY value of the DisplayListscaleX
- The scaleX value of the DisplayListscaleY
- The scaleY value of the DisplayListpublic abstract void setPivotX(float pivotX)
pivotX
- The pivotX value of the DisplayListView.setPivotX(float)
public abstract void setPivotY(float pivotY)
pivotY
- The pivotY value of the DisplayListView.setPivotY(float)
public abstract void setCameraDistance(float distance)
distance
- The distance in z of the camera of the DisplayListView.setCameraDistance(float)
public abstract void setLeft(int left)
left
- The left value of the DisplayListView.setLeft(int)
public abstract void setTop(int top)
top
- The top value of the DisplayListView.setTop(int)
public abstract void setRight(int right)
right
- The right value of the DisplayListView.setRight(int)
public abstract void setBottom(int bottom)
bottom
- The bottom value of the DisplayListView.setBottom(int)
public abstract void setLeftTop(int left, int top)
left
- The left value of the DisplayListtop
- The top value of the DisplayListView.setLeft(int)
,
View.setTop(int)
public abstract void setLeftTopRightBottom(int left, int top, int right, int bottom)
left
- The left value of the DisplayListtop
- The top value of the DisplayListView.setLeft(int)
,
View.setTop(int)
public abstract void offsetLeftRight(int offset)
offset
- The amount that the left and right values of the DisplayList are offsetView.offsetLeftAndRight(int)
public abstract void offsetTopBottom(int offset)
offset
- The amount that the top and bottom values of the DisplayList are offsetView.offsetTopAndBottom(int)
public abstract void reset()