public class DisplayListCanvas extends Canvas
Canvas.EdgeType, Canvas.Saveflags, Canvas.VertexMode
ALL_SAVE_FLAG, CLIP_SAVE_FLAG, CLIP_TO_LAYER_SAVE_FLAG, FULL_COLOR_LAYER_SAVE_FLAG, HAS_ALPHA_LAYER_SAVE_FLAG, MATRIX_SAVE_FLAG, mDensity, mNativeCanvasWrapper, mScreenDensity, sCompatibilityRestore
Modifier and Type | Method and Description |
---|---|
void |
callDrawGLFunction2(long drawGLFunction)
Records the functor specified with the drawGLFunction function pointer.
|
void |
drawCircle(CanvasProperty<Float> cx,
CanvasProperty<Float> cy,
CanvasProperty<Float> radius,
CanvasProperty<Paint> paint) |
void |
drawGLFunctor2(long drawGLFunctor,
Runnable releasedCallback)
Records the functor specified with the drawGLFunction function pointer.
|
void |
drawRenderNode(RenderNode renderNode)
Draws the specified display list onto this canvas.
|
void |
drawRoundRect(CanvasProperty<Float> left,
CanvasProperty<Float> top,
CanvasProperty<Float> right,
CanvasProperty<Float> bottom,
CanvasProperty<Float> rx,
CanvasProperty<Float> ry,
CanvasProperty<Paint> paint) |
int |
getHeight()
Returns the height of the current drawing layer
|
int |
getMaximumBitmapHeight()
Returns the maximum allowed height for bitmaps drawn with this canvas.
|
int |
getMaximumBitmapWidth()
Returns the maximum allowed width for bitmaps drawn with this canvas.
|
int |
getWidth()
Returns the width of the current drawing layer
|
void |
insertInorderBarrier() |
void |
insertReorderBarrier() |
boolean |
isHardwareAccelerated()
Indicates whether this Canvas uses hardware acceleration.
|
boolean |
isOpaque()
Return true if the device that the current layer draws into is opaque
(i.e. does not support per-pixel alpha).
|
boolean |
isRecordingFor(Object o) |
protected static long |
nFinishRecording(long renderer) |
void |
setBitmap(Bitmap bitmap)
Specify a bitmap for the canvas to draw into.
|
void |
setDensity(int density)
Specifies the density for this Canvas' backing bitmap.
|
protected void |
throwIfCannotDraw(Bitmap bitmap) |
checkRange, clipPath, clipPath, clipRect, clipRect, clipRect, clipRect, clipRect, clipRect, clipRect, clipRegion, clipRegion, concat, drawArc, drawArc, drawARGB, drawBitmap, drawBitmap, drawBitmap, drawBitmap, drawBitmap, drawBitmap, drawBitmapMesh, drawCircle, drawColor, drawColor, drawLine, drawLines, drawLines, drawOval, drawOval, drawPaint, drawPatch, drawPatch, drawPath, drawPicture, drawPicture, drawPicture, drawPoint, drawPoints, drawPoints, drawPosText, drawPosText, drawRect, drawRect, drawRect, drawRGB, drawRoundRect, drawRoundRect, drawText, drawText, drawText, drawText, drawTextOnPath, drawTextOnPath, drawTextRun, drawTextRun, drawVertices, freeCaches, freeTextLayoutCaches, getClipBounds, getClipBounds, getDensity, getDrawFilter, getGL, getMatrix, getMatrix, getNativeCanvasWrapper, getSaveCount, quickReject, quickReject, quickReject, release, restore, restoreToCount, rotate, rotate, save, save, saveLayer, saveLayer, saveLayer, saveLayer, saveLayerAlpha, saveLayerAlpha, saveLayerAlpha, saveLayerAlpha, scale, scale, setDrawFilter, setHighContrastText, setMatrix, setScreenDensity, skew, translate
public boolean isRecordingFor(Object o)
isRecordingFor
in class Canvas
public void setDensity(int density)
Canvas
Specifies the density for this Canvas' backing bitmap. This modifies
the target density of the canvas itself, as well as the density of its
backing bitmap via Bitmap.setDensity(int)
.
setDensity
in class Canvas
density
- The new target density of the canvas, which is used
to determine the scaling factor when drawing a bitmap into it. Use
Bitmap.DENSITY_NONE
to disable bitmap scaling.Canvas.getDensity()
,
Bitmap.setDensity(int)
public boolean isHardwareAccelerated()
Canvas
isHardwareAccelerated
in class Canvas
public void setBitmap(Bitmap bitmap)
Canvas
setBitmap
in class Canvas
bitmap
- Specifies a mutable bitmap for the canvas to draw into.Canvas.setDensity(int)
,
Canvas.getDensity()
public boolean isOpaque()
Canvas
public int getWidth()
Canvas
public int getHeight()
Canvas
public int getMaximumBitmapWidth()
Canvas
getMaximumBitmapWidth
in class Canvas
Canvas.getMaximumBitmapHeight()
public int getMaximumBitmapHeight()
Canvas
getMaximumBitmapHeight
in class Canvas
Canvas.getMaximumBitmapWidth()
public void insertReorderBarrier()
insertReorderBarrier
in class Canvas
public void insertInorderBarrier()
insertInorderBarrier
in class Canvas
public void callDrawGLFunction2(long drawGLFunction)
drawGLFunction
- A native function pointerpublic void drawGLFunctor2(long drawGLFunctor, Runnable releasedCallback)
drawGLFunction
- A native function pointerreleasedCallback
- Called when the display list is destroyed, and thus
the functor is no longer referenced by this canvas's display list.
NOTE: The callback does *not* necessarily mean that there are no longer
any references to the functor, just that the reference from this specific
canvas's display list has been released.protected static long nFinishRecording(long renderer)
public void drawRenderNode(RenderNode renderNode)
RenderNode.isValid()
returns true.renderNode
- The RenderNode to draw.public void drawCircle(CanvasProperty<Float> cx, CanvasProperty<Float> cy, CanvasProperty<Float> radius, CanvasProperty<Paint> paint)
public void drawRoundRect(CanvasProperty<Float> left, CanvasProperty<Float> top, CanvasProperty<Float> right, CanvasProperty<Float> bottom, CanvasProperty<Float> rx, CanvasProperty<Float> ry, CanvasProperty<Paint> paint)
protected void throwIfCannotDraw(Bitmap bitmap)
throwIfCannotDraw
in class Canvas