Canvas

Class of android.graphics · Canvas.java · Android's reference

public class Canvas

Draws into a display list (docs/platforms/android-apps/hwui.md): a RenderNode's, a Picture's or a Bitmap's. The matrix and the clip's bounds are kept here too, for the queries; the renderer draws the operations with Vulkan.

Nested types

Extended in the framework by

Page 1 2 3

Members

public static final int ALL_SAVE_FLAG = 0x1f source
public static final int MATRIX_SAVE_FLAG = 0x01 source
public static final int CLIP_SAVE_FLAG = 0x02 source
public Canvas() source
public Canvas(Bitmap bitmap) source
protected Canvas(DisplayList list, int width, int height) source

A canvas recording into a list, width by height.

public void setBitmap(Bitmap bitmap) source
public boolean isHardwareAccelerated() source
public boolean isOpaque() source
public int getWidth() source
public int getHeight() source
public int getDensity() source
public void setDensity(int density) source
public int getMaximumBitmapWidth() source
public int getMaximumBitmapHeight() source
public void enableZ() empty body source
public void disableZ() empty body source
public DrawFilter getDrawFilter() source
public void setDrawFilter(DrawFilter filter) source

State

public int save() source
public int save(int saveFlags) source
public int saveLayer(float left, float top, float right, float bottom, Paint paint) source
public int saveLayer(float l, float t, float r, float b, Paint paint, int saveFlags) source
public int saveLayer(RectF bounds, Paint paint) source
public int saveLayer(RectF bounds, Paint paint, int saveFlags) source
public int saveLayerAlpha(float l, float t, float r, float b, int alpha) source
public int saveLayerAlpha(float l, float t, float r, float b, int alpha, int saveFlags) source
public int saveLayerAlpha(RectF bounds, int alpha) source
public int saveLayerAlpha(RectF bounds, int alpha, int saveFlags) source
public void restore() source
public int getSaveCount() source
public void restoreToCount(int saveCount) source
public void translate(float dx, float dy) source
public void scale(float sx, float sy) source
public final void scale(float sx, float sy, float px, float py) source
public void rotate(float degrees) source
public final void rotate(float degrees, float px, float py) source
public void skew(float sx, float sy) source
public void concat(Matrix m) source
public void setMatrix(Matrix m) source
public void getMatrix(Matrix ctm) deprecated source
public final Matrix getMatrix() deprecated source

Clips

public boolean clipRect(float left, float top, float right, float bottom) source
public boolean clipRect(int left, int top, int right, int bottom) source
public boolean clipRect(Rect r) source
public boolean clipRect(RectF r) source
public boolean clipRect(float l, float t, float r, float b, Region.Op op) source
public boolean clipRect(Rect r, Region.Op op) source
public boolean clipRect(RectF r, Region.Op op) source

Page 1 2 3


Made from ScarletNX's Sail at 166ad3910f80. The framework is ScarletNX's (GPL-3.0-or-later); the parts that follow the Android Open Source Project's sources (Apache-2.0) say so in their files.