# ListenableGlesRenderer

Artifact: [androidx.wear.watchface:watchface-guava](https://developer.android.com/jetpack/androidx/releases/wear-watchface) [View Source](https://cs.android.com/search?q=file:androidx/wear/watchface/ListenableGlesRenderer.kt+class:androidx.wear.watchface.ListenableGlesRenderer) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.0.0) Deprecated in [1.1.0](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.1.0)

*** ** * ** ***

<br />

```
abstract class ListenableGlesRenderer : Renderer.GlesRenderer
```

<br />

|---|---|---|---|
| [kotlin.Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html) ||||
| ↳ | [androidx.wear.watchface.Renderer](https://developer.android.com/reference/kotlin/androidx/wear/watchface/Renderer) |||
|   | ↳ | [androidx.wear.watchface.Renderer.GlesRenderer](https://developer.android.com/reference/kotlin/androidx/wear/watchface/Renderer.GlesRenderer) ||
|   |   | ↳ | [androidx.wear.watchface.ListenableGlesRenderer](https://developer.android.com/reference/kotlin/androidx/wear/watchface/ListenableGlesRenderer) |

*** ** * ** ***

> [!CAUTION]
> **This class is deprecated.**   
> Use ListenableGlesRenderer2 instead

`https://guava.dev/releases/snapshot-android/api/docs/com/google/common/util/concurrent/ListenableFuture.html`-based compatibility wrapper around `https://developer.android.com/reference/kotlin/androidx/wear/watchface/Renderer.GlesRenderer`'s suspending methods.

## Summary

| ### Public constructors |
|---|
| `[ListenableGlesRenderer](https://developer.android.com/reference/kotlin/androidx/wear/watchface/ListenableGlesRenderer#ListenableGlesRenderer(android.view.SurfaceHolder,androidx.wear.watchface.style.CurrentUserStyleRepository,androidx.wear.watchface.WatchState,kotlin.Long,kotlin.IntArray,kotlin.IntArray))( surfaceHolder: https://developer.android.com/reference/android/view/SurfaceHolder.html, currentUserStyleRepository: https://developer.android.com/reference/kotlin/androidx/wear/watchface/style/CurrentUserStyleRepository, watchState: https://developer.android.com/reference/kotlin/androidx/wear/watchface/WatchState, interactiveDrawModeUpdateDelayMillis: @https://developer.android.com/reference/kotlin/androidx/annotation/IntRange(from = 0, to = 60000) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html, eglConfigAttribList: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int-array/index.html, eglSurfaceAttribList: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int-array/index.html )` **This function is deprecated.** Use ListenableGlesRenderer2 instead |

| ### Public functions |
|---|---|
| `open suspend https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `[onBackgroundThreadGlContextCreated](https://developer.android.com/reference/kotlin/androidx/wear/watchface/ListenableGlesRenderer#onBackgroundThreadGlContextCreated())()` **This function is deprecated.** Use ListenableGlesRenderer2 instead |
| `open suspend https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `[onUiThreadGlSurfaceCreated](https://developer.android.com/reference/kotlin/androidx/wear/watchface/ListenableGlesRenderer#onUiThreadGlSurfaceCreated(kotlin.Int,kotlin.Int))(width: @https://developer.android.com/reference/kotlin/androidx/annotation/Px https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, height: @https://developer.android.com/reference/kotlin/androidx/annotation/Px https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` **This function is deprecated.** Use ListenableGlesRenderer2 instead |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `@https://developer.android.com/reference/kotlin/androidx/annotation/WorkerThread [runBackgroundThreadGlCommands](https://developer.android.com/reference/kotlin/androidx/wear/watchface/ListenableGlesRenderer#runBackgroundThreadGlCommands(java.lang.Runnable))(runnable: https://developer.android.com/reference/java/lang/Runnable.html)` **This function is deprecated.** Use ListenableGlesRenderer2 instead |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `@https://developer.android.com/reference/kotlin/androidx/annotation/UiThread [runUiThreadGlCommands](https://developer.android.com/reference/kotlin/androidx/wear/watchface/ListenableGlesRenderer#runUiThreadGlCommands(java.lang.Runnable))(runnable: https://developer.android.com/reference/java/lang/Runnable.html)` **This function is deprecated.** Use ListenableGlesRenderer2 instead |

| ### Protected functions |
|---|---|
| `open https://guava.dev/releases/snapshot-android/api/docs/com/google/common/util/concurrent/ListenableFuture.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html>` | `[onBackgroundThreadGlContextCreatedFuture](https://developer.android.com/reference/kotlin/androidx/wear/watchface/ListenableGlesRenderer#onBackgroundThreadGlContextCreatedFuture())()` **This function is deprecated.** Use ListenableGlesRenderer2 instead |
| `open https://guava.dev/releases/snapshot-android/api/docs/com/google/common/util/concurrent/ListenableFuture.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html>` | `@https://developer.android.com/reference/kotlin/androidx/annotation/UiThread [onUiThreadGlSurfaceCreatedFuture](https://developer.android.com/reference/kotlin/androidx/wear/watchface/ListenableGlesRenderer#onUiThreadGlSurfaceCreatedFuture(kotlin.Int,kotlin.Int))(width: @https://developer.android.com/reference/kotlin/androidx/annotation/Px https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, height: @https://developer.android.com/reference/kotlin/androidx/annotation/Px https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` **This function is deprecated.** Use ListenableGlesRenderer2 instead |

### Inherited functions

From [androidx.wear.watchface.Renderer](https://developer.android.com/reference/kotlin/androidx/wear/watchface/Renderer) `open https://developer.android.com/reference/android/graphics/Rect.html` `@https://developer.android.com/reference/kotlin/androidx/annotation/UiThread
[getMainClockElementBounds](https://developer.android.com/reference/kotlin/androidx/wear/watchface/Renderer#getMainClockElementBounds())()`

**This function is deprecated.** Use ListenableGlesRenderer2 instead
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `@https://developer.android.com/reference/kotlin/androidx/annotation/UiThread
[invalidate](https://developer.android.com/reference/kotlin/androidx/wear/watchface/Renderer#invalidate())()`

**This function is deprecated.** Use ListenableGlesRenderer2 instead
`open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `@https://developer.android.com/reference/kotlin/androidx/annotation/UiThread
[onRenderParametersChanged](https://developer.android.com/reference/kotlin/androidx/wear/watchface/Renderer#onRenderParametersChanged(androidx.wear.watchface.RenderParameters))(renderParameters: https://developer.android.com/reference/kotlin/androidx/wear/watchface/RenderParameters)`

**This function is deprecated.** Use ListenableGlesRenderer2 instead
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `[postInvalidate](https://developer.android.com/reference/kotlin/androidx/wear/watchface/Renderer#postInvalidate())()`

**This function is deprecated.** Use ListenableGlesRenderer2 instead
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `[sendPreviewImageNeedsUpdateRequest](https://developer.android.com/reference/kotlin/androidx/wear/watchface/Renderer#sendPreviewImageNeedsUpdateRequest())()`

**This function is deprecated.** Use ListenableGlesRenderer2 instead
`open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `@https://developer.android.com/reference/kotlin/androidx/annotation/UiThread
[shouldAnimate](https://developer.android.com/reference/kotlin/androidx/wear/watchface/Renderer#shouldAnimate())()`

**This function is deprecated.** Use ListenableGlesRenderer2 instead
From [androidx.wear.watchface.Renderer.GlesRenderer](https://developer.android.com/reference/kotlin/androidx/wear/watchface/Renderer.GlesRenderer) `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `@https://developer.android.com/reference/kotlin/androidx/annotation/CallSuper
[onDestroy](https://developer.android.com/reference/kotlin/androidx/wear/watchface/Renderer.GlesRenderer#onDestroy())()`

**This function is deprecated.** Use ListenableGlesRenderer2 instead
`open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `[onDump](https://developer.android.com/reference/kotlin/androidx/wear/watchface/Renderer.GlesRenderer#onDump(java.io.PrintWriter))(writer: https://developer.android.com/reference/java/io/PrintWriter.html)`

**This function is deprecated.** Use ListenableGlesRenderer2 instead
`abstract https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `@https://developer.android.com/reference/kotlin/androidx/annotation/UiThread
[render](https://developer.android.com/reference/kotlin/androidx/wear/watchface/Renderer.GlesRenderer#render(java.time.ZonedDateTime))(zonedDateTime: https://developer.android.com/reference/java/time/ZonedDateTime.html)`

**This function is deprecated.** Use ListenableGlesRenderer2 instead
`abstract https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `@https://developer.android.com/reference/kotlin/androidx/annotation/UiThread
[renderHighlightLayer](https://developer.android.com/reference/kotlin/androidx/wear/watchface/Renderer.GlesRenderer#renderHighlightLayer(java.time.ZonedDateTime))(zonedDateTime: https://developer.android.com/reference/java/time/ZonedDateTime.html)`

**This function is deprecated.** Use ListenableGlesRenderer2 instead
`suspend https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `@https://developer.android.com/reference/kotlin/androidx/annotation/WorkerThread
[runBackgroundThreadGlCommands](https://developer.android.com/reference/kotlin/androidx/wear/watchface/Renderer.GlesRenderer#runBackgroundThreadGlCommands(kotlin.coroutines.SuspendFunction0))(commands: suspend () -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)`

**This function is deprecated.** Use ListenableGlesRenderer2 instead
`suspend https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `[runUiThreadGlCommands](https://developer.android.com/reference/kotlin/androidx/wear/watchface/Renderer.GlesRenderer#runUiThreadGlCommands(kotlin.coroutines.SuspendFunction0))(commands: suspend () -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)`

**This function is deprecated.** Use ListenableGlesRenderer2 instead

### Inherited properties

From [androidx.wear.watchface.Renderer](https://developer.android.com/reference/kotlin/androidx/wear/watchface/Renderer) `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-collection/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-pair/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, https://developer.android.com/reference/kotlin/androidx/wear/watchface/ContentDescriptionLabel>>` `https://developer.android.com/reference/kotlin/androidx/wear/watchface/Renderer#additionalContentDescriptionLabels()`

**This property is deprecated.** Use ListenableGlesRenderer2 instead
`@https://developer.android.com/reference/kotlin/androidx/annotation/Px https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` `https://developer.android.com/reference/kotlin/androidx/wear/watchface/Renderer#centerX()`

**This property is deprecated.** Use ListenableGlesRenderer2 instead
`@https://developer.android.com/reference/kotlin/androidx/annotation/Px https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` `https://developer.android.com/reference/kotlin/androidx/wear/watchface/Renderer#centerY()`

**This property is deprecated.** Use ListenableGlesRenderer2 instead
`@https://developer.android.com/reference/kotlin/androidx/annotation/IntRange(from = 0, to = 60000) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` `https://developer.android.com/reference/kotlin/androidx/wear/watchface/Renderer#interactiveDrawModeUpdateDelayMillis()`

**This property is deprecated.** Use ListenableGlesRenderer2 instead
`https://developer.android.com/reference/kotlin/androidx/wear/watchface/RenderParameters` `https://developer.android.com/reference/kotlin/androidx/wear/watchface/Renderer#renderParameters()`

**This property is deprecated.** Use ListenableGlesRenderer2 instead
`https://developer.android.com/reference/android/graphics/Rect.html` `https://developer.android.com/reference/kotlin/androidx/wear/watchface/Renderer#screenBounds()`

**This property is deprecated.** Use ListenableGlesRenderer2 instead
`https://developer.android.com/reference/android/view/SurfaceHolder.html` `https://developer.android.com/reference/kotlin/androidx/wear/watchface/Renderer#surfaceHolder()`

**This property is deprecated.** Use ListenableGlesRenderer2 instead
`https://developer.android.com/reference/kotlin/androidx/wear/watchface/WatchFaceColors?` `@https://developer.android.com/reference/kotlin/androidx/wear/watchface/WatchFaceExperimental
https://developer.android.com/reference/kotlin/androidx/wear/watchface/Renderer#watchfaceColors()`

**This property is deprecated.** Use ListenableGlesRenderer2 instead
From [androidx.wear.watchface.Renderer.GlesRenderer](https://developer.android.com/reference/kotlin/androidx/wear/watchface/Renderer.GlesRenderer) `https://developer.android.com/reference/android/opengl/EGLContext.html` `https://developer.android.com/reference/kotlin/androidx/wear/watchface/Renderer.GlesRenderer#eglBackgroundThreadContext()`

**This property is deprecated.** Use ListenableGlesRenderer2 instead
`https://developer.android.com/reference/android/opengl/EGLConfig.html` `https://developer.android.com/reference/kotlin/androidx/wear/watchface/Renderer.GlesRenderer#eglConfig()`

**This property is deprecated.** Use ListenableGlesRenderer2 instead
`https://developer.android.com/reference/android/opengl/EGLDisplay.html` `https://developer.android.com/reference/kotlin/androidx/wear/watchface/Renderer.GlesRenderer#eglDisplay()`

**This property is deprecated.** Use ListenableGlesRenderer2 instead
`https://developer.android.com/reference/android/opengl/EGLContext.html` `https://developer.android.com/reference/kotlin/androidx/wear/watchface/Renderer.GlesRenderer#eglUiThreadContext()`

**This property is deprecated.** Use ListenableGlesRenderer2 instead

## Public constructors

### ListenableGlesRenderer

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

```
[ListenableGlesRenderer](https://developer.android.com/reference/kotlin/androidx/wear/watchface/ListenableGlesRenderer#ListenableGlesRenderer(android.view.SurfaceHolder,androidx.wear.watchface.style.CurrentUserStyleRepository,androidx.wear.watchface.WatchState,kotlin.Long,kotlin.IntArray,kotlin.IntArray))(
    surfaceHolder: SurfaceHolder,
    currentUserStyleRepository: CurrentUserStyleRepository,
    watchState: WatchState,
    interactiveDrawModeUpdateDelayMillis: @IntRange(from = 0, to = 60000) Long,
    eglConfigAttribList: IntArray = EGL_CONFIG_ATTRIB_LIST,
    eglSurfaceAttribList: IntArray = EGL_SURFACE_ATTRIB_LIST
)
```

> [!CAUTION]
> **This function is deprecated.**   
> Use ListenableGlesRenderer2 instead

## Public functions

### onBackgroundThreadGlContextCreated

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

```
open suspend fun [onBackgroundThreadGlContextCreated](https://developer.android.com/reference/kotlin/androidx/wear/watchface/ListenableGlesRenderer#onBackgroundThreadGlContextCreated())(): Unit
```

> [!CAUTION]
> **This function is deprecated.**   
> Use ListenableGlesRenderer2 instead

Called once a background thread when a new GL context is created on the background thread, before any subsequent calls to `https://developer.android.com/reference/kotlin/androidx/wear/watchface/Renderer.GlesRenderer#render(java.time.ZonedDateTime)`. Note this function is called inside a lambda passed to `https://developer.android.com/reference/kotlin/androidx/wear/watchface/Renderer.GlesRenderer#runBackgroundThreadGlCommands(kotlin.coroutines.SuspendFunction0)` which has synchronized access to the GL context.

If you need to override this method in java, consider using `https://developer.android.com/reference/kotlin/androidx/wear/watchface/ListenableGlesRenderer` instead.

### onUiThreadGlSurfaceCreated

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

```
open suspend fun [onUiThreadGlSurfaceCreated](https://developer.android.com/reference/kotlin/androidx/wear/watchface/ListenableGlesRenderer#onUiThreadGlSurfaceCreated(kotlin.Int,kotlin.Int))(width: @Px Int, height: @Px Int): Unit
```

> [!CAUTION]
> **This function is deprecated.**   
> Use ListenableGlesRenderer2 instead

Called when a new GL surface is created on the UiThread, before any subsequent calls to `https://developer.android.com/reference/kotlin/androidx/wear/watchface/Renderer.GlesRenderer#render(java.time.ZonedDateTime)` or in response to `https://developer.android.com/reference/android/view/SurfaceHolder.Callback.html#surfaceChanged(android.view.SurfaceHolder, int, int, int)`. Note this function is called inside a lambda passed to `https://developer.android.com/reference/kotlin/androidx/wear/watchface/Renderer.GlesRenderer#runUiThreadGlCommands(kotlin.coroutines.SuspendFunction0)` which has synchronized access to the GL context.

If you need to override this method in java, consider using `https://developer.android.com/reference/kotlin/androidx/wear/watchface/ListenableGlesRenderer` instead.

| Parameters |
|---|---|
| `width: @https://developer.android.com/reference/kotlin/androidx/annotation/Px https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | width of surface in pixels |
| `height: @https://developer.android.com/reference/kotlin/androidx/annotation/Px https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | height of surface in pixels |

### runBackgroundThreadGlCommands

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

```
@WorkerThread
fun [runBackgroundThreadGlCommands](https://developer.android.com/reference/kotlin/androidx/wear/watchface/ListenableGlesRenderer#runBackgroundThreadGlCommands(java.lang.Runnable))(runnable: Runnable): Unit
```

> [!CAUTION]
> **This function is deprecated.**   
> Use ListenableGlesRenderer2 instead

Inside of a `https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.sync/-mutex/index.html` this function sets the GL context associated with the `https://developer.android.com/reference/kotlin/androidx/wear/watchface/WatchFaceService#getBackgroundThreadHandler()`'s looper thread as the current one, executes `https://developer.android.com/reference/kotlin/androidx/wear/watchface/ListenableGlesRenderer#runBackgroundThreadGlCommands(java.lang.Runnable)` and finally unsets the GL context.

Access to the GL context this way is necessary because GL contexts are not shared between renderers and there can be multiple watch face instances existing concurrently (e.g. headless and interactive, potentially from different watch faces if an APK contains more than one `https://developer.android.com/reference/kotlin/androidx/wear/watchface/WatchFaceService`).

NB this function is called by the library before running `https://developer.android.com/reference/kotlin/androidx/wear/watchface/ListenableGlesRenderer#runBackgroundThreadGlCommands(java.lang.Runnable)` so there's no need to use this directly in client code unless you need to make GL calls outside of those methods.

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-state-exception/index.html` | if the calls to `https://developer.android.com/reference/android/opengl/EGL14.html#eglMakeCurrent(android.opengl.EGLDisplay, android.opengl.EGLSurface, android.opengl.EGLSurface, android.opengl.EGLContext)` fails |

### runUiThreadGlCommands

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

```
@UiThread
fun [runUiThreadGlCommands](https://developer.android.com/reference/kotlin/androidx/wear/watchface/ListenableGlesRenderer#runUiThreadGlCommands(java.lang.Runnable))(runnable: Runnable): Unit
```

> [!CAUTION]
> **This function is deprecated.**   
> Use ListenableGlesRenderer2 instead

Inside of a `https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.sync/-mutex/index.html` this function sets the UiThread GL context as the current one, executes `https://developer.android.com/reference/kotlin/androidx/wear/watchface/ListenableGlesRenderer#runUiThreadGlCommands(java.lang.Runnable)` and finally unsets the GL context.

Access to the GL context this way is necessary because GL contexts are not shared between renderers and there can be multiple watch face instances existing concurrently (e.g. headless and interactive, potentially from different watch faces if an APK contains more than one `https://developer.android.com/reference/kotlin/androidx/wear/watchface/WatchFaceService`).

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-state-exception/index.html` | if the calls to `https://developer.android.com/reference/android/opengl/EGL14.html#eglMakeCurrent(android.opengl.EGLDisplay, android.opengl.EGLSurface, android.opengl.EGLSurface, android.opengl.EGLContext)` fails |

## Protected functions

### onBackgroundThreadGlContextCreatedFuture

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

```
protected open fun [onBackgroundThreadGlContextCreatedFuture](https://developer.android.com/reference/kotlin/androidx/wear/watchface/ListenableGlesRenderer#onBackgroundThreadGlContextCreatedFuture())(): ListenableFuture<Unit>
```

> [!CAUTION]
> **This function is deprecated.**   
> Use ListenableGlesRenderer2 instead

Called once a background thread when a new GL context is created on the background thread, before any subsequent calls to `https://developer.android.com/reference/kotlin/androidx/wear/watchface/Renderer.GlesRenderer#render(java.time.ZonedDateTime)`. Note this function is called inside a lambda passed to `https://developer.android.com/reference/kotlin/androidx/wear/watchface/ListenableGlesRenderer#runBackgroundThreadGlCommands(java.lang.Runnable)` which has synchronized access to the GL context. Note cancellation of the returned future is not supported.

| Returns |
|---|---|
| `https://guava.dev/releases/snapshot-android/api/docs/com/google/common/util/concurrent/ListenableFuture.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html>` | A ListenableFuture which is resolved when background thread work has completed. Rendering will be blocked until this has resolved. |

### onUiThreadGlSurfaceCreatedFuture

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

```
@UiThread
protected open fun [onUiThreadGlSurfaceCreatedFuture](https://developer.android.com/reference/kotlin/androidx/wear/watchface/ListenableGlesRenderer#onUiThreadGlSurfaceCreatedFuture(kotlin.Int,kotlin.Int))(width: @Px Int, height: @Px Int): ListenableFuture<Unit>
```

> [!CAUTION]
> **This function is deprecated.**   
> Use ListenableGlesRenderer2 instead

Called when a new GL surface is created on the UiThread, before any subsequent calls to `https://developer.android.com/reference/kotlin/androidx/wear/watchface/Renderer.GlesRenderer#render(java.time.ZonedDateTime)` and in response to `https://developer.android.com/reference/android/view/SurfaceHolder.Callback.html#surfaceChanged(android.view.SurfaceHolder, int, int, int)`. Note this function is called inside a lambda passed to `https://developer.android.com/reference/kotlin/androidx/wear/watchface/Renderer.GlesRenderer#runUiThreadGlCommands(kotlin.coroutines.SuspendFunction0)` which has synchronized access to the GL context. Note cancellation of the returned future is not supported.

| Parameters |
|---|---|
| `width: @https://developer.android.com/reference/kotlin/androidx/annotation/Px https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | width of surface in pixels |
| `height: @https://developer.android.com/reference/kotlin/androidx/annotation/Px https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | height of surface in pixels |

| Returns |
|---|---|
| `https://guava.dev/releases/snapshot-android/api/docs/com/google/common/util/concurrent/ListenableFuture.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html>` | A ListenableFuture which is resolved when UI thread work has completed. Rendering will be blocked until this has resolved. |