CanvasType


public static class CanvasType


Describes the type of Canvas a Renderer.CanvasRenderer or Renderer.CanvasRenderer2 can request from a SurfaceHolder.

use Watch Face Format instead

Summary

Constants

static final int

This field is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

static final int

This field is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

Public fields

static @NonNull CanvasType

Constants

HARDWARE

Added in 1.2.0
Deprecated in 1.3.0-alpha06
public static final int HARDWARE = 1

A hardware canvas will be requested. This is usually faster than software rendering, however it can sometimes increase battery usage by rendering at a higher frame rate.

NOTE this is only supported on API level 26 and above. On lower API levels we fall back to a software canvas.

NOTE the system takes screenshots for use in the watch face picker UI and these will be taken using software rendering for API level 27 and below. This means on API level 27 and below Bitmaps with Bitmap.Config.HARDWARE must be avoided.

SOFTWARE

Added in 1.2.0
Deprecated in 1.3.0-alpha06
public static final int SOFTWARE = 0

A software canvas will be requested.

Public fields

INSTANCE

Added in 1.2.0
Deprecated in 1.3.0-alpha06
public static @NonNull CanvasType INSTANCE