CanvasType

annotation class CanvasType
androidx.wear.watchface.CanvasType

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

Summary

Constants
const Int

A hardware canvas will be requested.

const Int

A software canvas will be requested.

Public constructors

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

Constants

HARDWARE

const val HARDWARE: Int

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. This means Bitmaps with Bitmap.Config.HARDWARE must be avoided.

Value: 1

SOFTWARE

const val SOFTWARE: Int

A software canvas will be requested.

Value: 0

Public constructors

CanvasType

CanvasType()

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