# 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 />

```
public abstract class ListenableGlesRenderer extends Renderer.GlesRenderer
```

<br />

|---|---|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object.html) ||||
| ↳ | [androidx.wear.watchface.Renderer](https://developer.android.com/reference/androidx/wear/watchface/Renderer) |||
|   | ↳ | [androidx.wear.watchface.Renderer.GlesRenderer](https://developer.android.com/reference/androidx/wear/watchface/Renderer.GlesRenderer) ||
|   |   | ↳ | [androidx.wear.watchface.ListenableGlesRenderer](https://developer.android.com/reference/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/androidx/wear/watchface/Renderer.GlesRenderer`'s suspending methods.

## Summary

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

| ### Public methods |
|---|---|
| `void` | `[onBackgroundThreadGlContextCreated](https://developer.android.com/reference/androidx/wear/watchface/ListenableGlesRenderer#onBackgroundThreadGlContextCreated())()` **This method is deprecated.** Use ListenableGlesRenderer2 instead |
| `void` | `[onUiThreadGlSurfaceCreated](https://developer.android.com/reference/androidx/wear/watchface/ListenableGlesRenderer#onUiThreadGlSurfaceCreated(kotlin.Int,kotlin.Int))(@https://developer.android.com/reference/androidx/annotation/Px int width, @https://developer.android.com/reference/androidx/annotation/Px int height)` **This method is deprecated.** Use ListenableGlesRenderer2 instead |
| `final void` | `@https://developer.android.com/reference/androidx/annotation/WorkerThread [runBackgroundThreadGlCommands](https://developer.android.com/reference/androidx/wear/watchface/ListenableGlesRenderer#runBackgroundThreadGlCommands(java.lang.Runnable))(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Runnable.html runnable)` **This method is deprecated.** Use ListenableGlesRenderer2 instead |
| `final void` | `@https://developer.android.com/reference/androidx/annotation/UiThread [runUiThreadGlCommands](https://developer.android.com/reference/androidx/wear/watchface/ListenableGlesRenderer#runUiThreadGlCommands(java.lang.Runnable))(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Runnable.html runnable)` **This method is deprecated.** Use ListenableGlesRenderer2 instead |

| ### Protected methods |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull 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/androidx/wear/watchface/ListenableGlesRenderer#onBackgroundThreadGlContextCreatedFuture())()` **This method is deprecated.** Use ListenableGlesRenderer2 instead |
| `@https://developer.android.com/reference/androidx/annotation/NonNull 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/androidx/annotation/UiThread [onUiThreadGlSurfaceCreatedFuture](https://developer.android.com/reference/androidx/wear/watchface/ListenableGlesRenderer#onUiThreadGlSurfaceCreatedFuture(kotlin.Int,kotlin.Int))(@https://developer.android.com/reference/androidx/annotation/Px int width, @https://developer.android.com/reference/androidx/annotation/Px int height)` **This method is deprecated.** Use ListenableGlesRenderer2 instead |

### Inherited methods

From [androidx.wear.watchface.Renderer](https://developer.android.com/reference/androidx/wear/watchface/Renderer) `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Collection.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-pair/index.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Integer.html, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/wear/watchface/ContentDescriptionLabel>>` `[getAdditionalContentDescriptionLabels](https://developer.android.com/reference/androidx/wear/watchface/Renderer#getAdditionalContentDescriptionLabels())()`

**This method is deprecated.** Use ListenableGlesRenderer2 instead
`final float` `[getCenterX](https://developer.android.com/reference/androidx/wear/watchface/Renderer#getCenterX())()`

**This method is deprecated.** Use ListenableGlesRenderer2 instead
`final float` `[getCenterY](https://developer.android.com/reference/androidx/wear/watchface/Renderer#getCenterY())()`

**This method is deprecated.** Use ListenableGlesRenderer2 instead
`final long` `[getInteractiveDrawModeUpdateDelayMillis](https://developer.android.com/reference/androidx/wear/watchface/Renderer#getInteractiveDrawModeUpdateDelayMillis())()`

**This method is deprecated.** Use ListenableGlesRenderer2 instead
`@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/Rect.html` `@https://developer.android.com/reference/androidx/annotation/UiThread
[getMainClockElementBounds](https://developer.android.com/reference/androidx/wear/watchface/Renderer#getMainClockElementBounds())()`

**This method is deprecated.** Use ListenableGlesRenderer2 instead
`final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/wear/watchface/RenderParameters` `[getRenderParameters](https://developer.android.com/reference/androidx/wear/watchface/Renderer#getRenderParameters())()`

**This method is deprecated.** Use ListenableGlesRenderer2 instead
`final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/Rect.html` `[getScreenBounds](https://developer.android.com/reference/androidx/wear/watchface/Renderer#getScreenBounds())()`

**This method is deprecated.** Use ListenableGlesRenderer2 instead
`final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/view/SurfaceHolder.html` `[getSurfaceHolder](https://developer.android.com/reference/androidx/wear/watchface/Renderer#getSurfaceHolder())()`

**This method is deprecated.** Use ListenableGlesRenderer2 instead
`final https://developer.android.com/reference/androidx/wear/watchface/WatchFaceColors` `@https://developer.android.com/reference/androidx/wear/watchface/WatchFaceExperimental
[getWatchfaceColors](https://developer.android.com/reference/androidx/wear/watchface/Renderer#getWatchfaceColors())()`

**This method is deprecated.** Use ListenableGlesRenderer2 instead
`final void` `@https://developer.android.com/reference/androidx/annotation/UiThread
[invalidate](https://developer.android.com/reference/androidx/wear/watchface/Renderer#invalidate())()`

**This method is deprecated.** Use ListenableGlesRenderer2 instead
`void` `@https://developer.android.com/reference/androidx/annotation/UiThread
[onRenderParametersChanged](https://developer.android.com/reference/androidx/wear/watchface/Renderer#onRenderParametersChanged(androidx.wear.watchface.RenderParameters))(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/wear/watchface/RenderParameters renderParameters)`

**This method is deprecated.** Use ListenableGlesRenderer2 instead
`final void` `[postInvalidate](https://developer.android.com/reference/androidx/wear/watchface/Renderer#postInvalidate())()`

**This method is deprecated.** Use ListenableGlesRenderer2 instead
`final void` `[sendPreviewImageNeedsUpdateRequest](https://developer.android.com/reference/androidx/wear/watchface/Renderer#sendPreviewImageNeedsUpdateRequest())()`

**This method is deprecated.** Use ListenableGlesRenderer2 instead
`final void` `[setAdditionalContentDescriptionLabels](https://developer.android.com/reference/androidx/wear/watchface/Renderer#setAdditionalContentDescriptionLabels(kotlin.collections.Collection))(

@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Collection.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-pair/index.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Integer.html, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/wear/watchface/ContentDescriptionLabel>> value

)`

**This method is deprecated.** Use ListenableGlesRenderer2 instead
`final void` `[setInteractiveDrawModeUpdateDelayMillis](https://developer.android.com/reference/androidx/wear/watchface/Renderer#setInteractiveDrawModeUpdateDelayMillis(kotlin.Long))(long value)`

**This method is deprecated.** Use ListenableGlesRenderer2 instead
`final void` `[setSurfaceHolder](https://developer.android.com/reference/androidx/wear/watchface/Renderer#setSurfaceHolder(android.view.SurfaceHolder))(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/view/SurfaceHolder.html value)`

**This method is deprecated.** Use ListenableGlesRenderer2 instead
`final void` `@https://developer.android.com/reference/androidx/wear/watchface/WatchFaceExperimental
[setWatchfaceColors](https://developer.android.com/reference/androidx/wear/watchface/Renderer#setWatchfaceColors(androidx.wear.watchface.WatchFaceColors))(https://developer.android.com/reference/androidx/wear/watchface/WatchFaceColors value)`

**This method is deprecated.** Use ListenableGlesRenderer2 instead
`boolean` `@https://developer.android.com/reference/androidx/annotation/UiThread
[shouldAnimate](https://developer.android.com/reference/androidx/wear/watchface/Renderer#shouldAnimate())()`

**This method is deprecated.** Use ListenableGlesRenderer2 instead
From [androidx.wear.watchface.Renderer.GlesRenderer](https://developer.android.com/reference/androidx/wear/watchface/Renderer.GlesRenderer) `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/opengl/EGLContext.html` `[getEglBackgroundThreadContext](https://developer.android.com/reference/androidx/wear/watchface/Renderer.GlesRenderer#getEglBackgroundThreadContext())()`

**This method is deprecated.** Use ListenableGlesRenderer2 instead
`final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/opengl/EGLConfig.html` `[getEglConfig](https://developer.android.com/reference/androidx/wear/watchface/Renderer.GlesRenderer#getEglConfig())()`

**This method is deprecated.** Use ListenableGlesRenderer2 instead
`final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/opengl/EGLDisplay.html` `[getEglDisplay](https://developer.android.com/reference/androidx/wear/watchface/Renderer.GlesRenderer#getEglDisplay())()`

**This method is deprecated.** Use ListenableGlesRenderer2 instead
`final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/opengl/EGLContext.html` `[getEglUiThreadContext](https://developer.android.com/reference/androidx/wear/watchface/Renderer.GlesRenderer#getEglUiThreadContext())()`

**This method is deprecated.** Use ListenableGlesRenderer2 instead
`void` `@https://developer.android.com/reference/androidx/annotation/CallSuper
[onDestroy](https://developer.android.com/reference/androidx/wear/watchface/Renderer.GlesRenderer#onDestroy())()`

**This method is deprecated.** Use ListenableGlesRenderer2 instead
`void` `[onDump](https://developer.android.com/reference/androidx/wear/watchface/Renderer.GlesRenderer#onDump(java.io.PrintWriter))(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/io/PrintWriter.html writer)`

**This method is deprecated.** Use ListenableGlesRenderer2 instead
`abstract void` `@https://developer.android.com/reference/androidx/annotation/UiThread
[render](https://developer.android.com/reference/androidx/wear/watchface/Renderer.GlesRenderer#render(java.time.ZonedDateTime))(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/time/ZonedDateTime.html zonedDateTime)`

**This method is deprecated.** Use ListenableGlesRenderer2 instead
`abstract void` `@https://developer.android.com/reference/androidx/annotation/UiThread
[renderHighlightLayer](https://developer.android.com/reference/androidx/wear/watchface/Renderer.GlesRenderer#renderHighlightLayer(java.time.ZonedDateTime))(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/time/ZonedDateTime.html zonedDateTime)`

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

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

**This method is deprecated.** Use ListenableGlesRenderer2 instead
`final void` `[setEglConfig](https://developer.android.com/reference/androidx/wear/watchface/Renderer.GlesRenderer#setEglConfig(android.opengl.EGLConfig))(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/opengl/EGLConfig.html eglConfig)`

**This method is deprecated.** It's not intended for eglConfig to be set
`final void` `[setEglDisplay](https://developer.android.com/reference/androidx/wear/watchface/Renderer.GlesRenderer#setEglDisplay(android.opengl.EGLDisplay))(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/opengl/EGLDisplay.html eglDisplay)`

**This method is deprecated.** It's not intended for eglDisplay to be set

## 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)

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

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

## Public methods

### 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)

```
public void [onBackgroundThreadGlContextCreated](https://developer.android.com/reference/androidx/wear/watchface/ListenableGlesRenderer#onBackgroundThreadGlContextCreated())()
```

> [!CAUTION]
> **This method 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/androidx/wear/watchface/Renderer.GlesRenderer#render(java.time.ZonedDateTime)`. Note this function is called inside a lambda passed to `https://developer.android.com/reference/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/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)

```
public void [onUiThreadGlSurfaceCreated](https://developer.android.com/reference/androidx/wear/watchface/ListenableGlesRenderer#onUiThreadGlSurfaceCreated(kotlin.Int,kotlin.Int))(@Px int width, @Px int height)
```

> [!CAUTION]
> **This method 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/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/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/androidx/wear/watchface/ListenableGlesRenderer` instead.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/Px int width` | width of surface in pixels |
| `@https://developer.android.com/reference/androidx/annotation/Px int height` | 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
public final void [runBackgroundThreadGlCommands](https://developer.android.com/reference/androidx/wear/watchface/ListenableGlesRenderer#runBackgroundThreadGlCommands(java.lang.Runnable))(@NonNull Runnable runnable)
```

> [!CAUTION]
> **This method 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/androidx/wear/watchface/WatchFaceService#getBackgroundThreadHandler()`'s looper thread as the current one, executes `https://developer.android.com/reference/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/androidx/wear/watchface/WatchFaceService`).

NB this function is called by the library before running `https://developer.android.com/reference/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
public final void [runUiThreadGlCommands](https://developer.android.com/reference/androidx/wear/watchface/ListenableGlesRenderer#runUiThreadGlCommands(java.lang.Runnable))(@NonNull Runnable runnable)
```

> [!CAUTION]
> **This method 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/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/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 methods

### 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 @NonNull ListenableFuture<Unit> [onBackgroundThreadGlContextCreatedFuture](https://developer.android.com/reference/androidx/wear/watchface/ListenableGlesRenderer#onBackgroundThreadGlContextCreatedFuture())()
```

> [!CAUTION]
> **This method 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/androidx/wear/watchface/Renderer.GlesRenderer#render(java.time.ZonedDateTime)`. Note this function is called inside a lambda passed to `https://developer.android.com/reference/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://developer.android.com/reference/androidx/annotation/NonNull 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 @NonNull ListenableFuture<Unit> [onUiThreadGlSurfaceCreatedFuture](https://developer.android.com/reference/androidx/wear/watchface/ListenableGlesRenderer#onUiThreadGlSurfaceCreatedFuture(kotlin.Int,kotlin.Int))(@Px int width, @Px int height)
```

> [!CAUTION]
> **This method 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/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/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 |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/Px int width` | width of surface in pixels |
| `@https://developer.android.com/reference/androidx/annotation/Px int height` | height of surface in pixels |

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull 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. |