# CanvasType

Artifact: [androidx.wear.watchface:watchface](https://developer.android.com/jetpack/androidx/releases/wear-watchface) [View Source](https://cs.android.com/search?q=file:androidx/wear/watchface/Renderer.kt+class:androidx.wear.watchface.CanvasType) Added in [1.2.0](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.2.0) Deprecated in [1.3.0-alpha07](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.3.0-alpha07)

*** ** * ** ***


```
public static class CanvasType
```

<br />

*** ** * ** ***

> [!CAUTION]
> **This class is deprecated.**   
> AndroidX watchface libraries are deprecated, use Watch Face Format instead. For more info see: https://developer.android.com/training/wearables/wff

Describes the type of `https://developer.android.com/reference/android/graphics/Canvas.html` a `https://developer.android.com/reference/androidx/wear/watchface/Renderer.CanvasRenderer` or `https://developer.android.com/reference/androidx/wear/watchface/Renderer.CanvasRenderer2` can request from a `https://developer.android.com/reference/android/view/SurfaceHolder.html`.

use Watch Face Format instead

## Summary

| ### Constants |
|---|---|
| `static final int` | `https://developer.android.com/reference/androidx/wear/watchface/CanvasType#HARDWARE() = 1` **This field is deprecated.** AndroidX watchface libraries are deprecated, use Watch Face Format instead. |
| `static final int` | `https://developer.android.com/reference/androidx/wear/watchface/CanvasType#SOFTWARE() = 0` **This field is deprecated.** AndroidX watchface libraries are deprecated, use Watch Face Format instead. |

| ### Public fields |
|---|---|
| `static @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/wear/watchface/CanvasType` | `https://developer.android.com/reference/androidx/wear/watchface/CanvasType#INSTANCE()` |

## Constants

### HARDWARE

Added in [1.2.0](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.2.0) Deprecated in [1.3.0-alpha07](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.3.0-alpha07)

```
public static final int HARDWARE = 1
```

> [!CAUTION]
> **This field is deprecated.**   
> AndroidX watchface libraries are deprecated, use Watch Face Format instead. For more info see: https://developer.android.com/training/wearables/wff

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 `https://developer.android.com/reference/android/graphics/Bitmap.html`s with `https://developer.android.com/reference/android/graphics/Bitmap.Config.html#HARDWARE` must be avoided.

### SOFTWARE

Added in [1.2.0](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.2.0) Deprecated in [1.3.0-alpha07](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.3.0-alpha07)

```
public static final int SOFTWARE = 0
```

> [!CAUTION]
> **This field is deprecated.**   
> AndroidX watchface libraries are deprecated, use Watch Face Format instead. For more info see: https://developer.android.com/training/wearables/wff

A software canvas will be requested.

## Public fields

### INSTANCE

Added in [1.2.0](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.2.0) Deprecated in [1.3.0-alpha07](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.3.0-alpha07)

```
public static @NonNull CanvasType INSTANCE
```