---
title: "DrawCacheModifier"
description: "[DrawModifier] implementation that supports building a cache of objects to be referenced across
draw calls"
type: "interface"
---

<div class='type'>Interface</div>


<a id='references'></a>

<div class='sourceset sourceset-common'>Common</div>



```kotlin
@JvmDefaultWithCompatibility
interface DrawCacheModifier : DrawModifier
```


`DrawModifier` implementation that supports building a cache of objects to be referenced across
draw calls


## Functions

```kotlin
fun onBuildCache(params: BuildDrawCacheParams)
```


Callback invoked to re-build objects to be re-used across draw calls. This is useful to
conditionally recreate objects only if the size of the drawing environment changes, or if
state parameters that are inputs to objects change. This method is guaranteed to be called
before `DrawModifier.draw`.

#### Parameters

| | |
| --- | --- |
| params | The params to be used to build the cache. |




