# CompletedShapeRenderer

Artifact: [androidx.ink:ink-authoring](https://developer.android.com/jetpack/androidx/releases/ink) [View Source](https://cs.android.com/search?q=file:androidx/ink/authoring/CompletedShapeRenderer.kt+class:androidx.ink.authoring.CompletedShapeRenderer) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/ink#1.0.0)

*** ** * ** ***


```
@ExperimentalInkCustomShapeWorkflowApi
interface CompletedShapeRenderer<CompletedShapeT : Any>
```

<br />

*** ** * ** ***

Called to render a `https://developer.android.com/reference/kotlin/androidx/ink/authoring/CompletedShapeRenderer` instance to an `https://developer.android.com/reference/android/graphics/Canvas.html`.

## Summary

| ### Public functions |
|---|---|
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `@https://developer.android.com/reference/kotlin/androidx/annotation/UiThread https://developer.android.com/reference/kotlin/androidx/ink/authoring/CompletedShapeRenderer#changesWithTime(kotlin.Any)(shape: CompletedShapeT)` Whether calls to `https://developer.android.com/reference/kotlin/androidx/ink/authoring/CompletedShapeRenderer#draw(android.graphics.Canvas,kotlin.Any,android.graphics.Matrix,kotlin.Long)` with a new timestamp value results in different visual output. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `@https://developer.android.com/reference/kotlin/androidx/annotation/UiThread https://developer.android.com/reference/kotlin/androidx/ink/authoring/CompletedShapeRenderer#draw(android.graphics.Canvas,kotlin.Any,android.graphics.Matrix,kotlin.Long)( canvas: https://developer.android.com/reference/android/graphics/Canvas.html, shape: CompletedShapeT, strokeToScreenTransform: https://developer.android.com/reference/android/graphics/Matrix.html, animatorClockStateMillis: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html )` Draw an instance of `https://developer.android.com/reference/kotlin/androidx/ink/authoring/CompletedShapeRenderer` to a `https://developer.android.com/reference/android/graphics/Canvas.html`. |

## Public functions

### changesWithTime

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/ink#1.0.0)

```
@UiThread
open fun changesWithTime(shape: CompletedShapeT): Boolean
```

Whether calls to `https://developer.android.com/reference/kotlin/androidx/ink/authoring/CompletedShapeRenderer#draw(android.graphics.Canvas,kotlin.Any,android.graphics.Matrix,kotlin.Long)` with a new timestamp value results in different visual output. In other words, return `true` if and only if `https://developer.android.com/reference/kotlin/androidx/ink/authoring/CompletedShapeRenderer#changesWithTime(kotlin.Any)` is animated.

### draw

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/ink#1.0.0)

```
@UiThread
fun draw(
    canvas: Canvas,
    shape: CompletedShapeT,
    strokeToScreenTransform: Matrix,
    animatorClockStateMillis: Long
): Unit
```

Draw an instance of `https://developer.android.com/reference/kotlin/androidx/ink/authoring/CompletedShapeRenderer` to a `https://developer.android.com/reference/android/graphics/Canvas.html`.

| Parameters |
|---|---|
| `canvas: https://developer.android.com/reference/android/graphics/Canvas.html` | The output `https://developer.android.com/reference/android/graphics/Canvas.html` to draw to. |
| `shape: CompletedShapeT` | The object to be drawn. |
| `strokeToScreenTransform: https://developer.android.com/reference/android/graphics/Matrix.html` | The full transform that has already been applied to the `https://developer.android.com/reference/android/graphics/Canvas.html` in order to draw this object. Most implementations do not need to use this data, but it is provided for certain rare circumstances (such as analytical anti-aliasing) that require it. |
| `animatorClockStateMillis: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | The current timestamp to be used for animation calculations. Note that the animation timing may not proceed at the same rate as system elapsed time - it will by default, but may be paused and resumed, or sped up, or slowed down. |