# GPUSurfaceConfiguration

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

*** ** * ** ***


```
public final class GPUSurfaceConfiguration
```

<br />

*** ** * ** ***

Describes the configuration for a surface.

## Summary

| ### Nested types |
|---|
| `public final class https://developer.android.com/reference/androidx/webgpu/GPUSurfaceConfiguration.Builder` Builder for `https://developer.android.com/reference/androidx/webgpu/GPUSurfaceConfiguration`. |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/webgpu/GPUSurfaceConfiguration#GPUSurfaceConfiguration(androidx.webgpu.GPUDevice,kotlin.Int,kotlin.Int,kotlin.Int,kotlin.Int,kotlin.IntArray,kotlin.Int,kotlin.Int)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/webgpu/GPUDevice device, int width, int height, int format, int usage, @https://developer.android.com/reference/androidx/annotation/NonNull int[] viewFormats, int alphaMode, int presentMode )` |

| ### Public methods |
|---|---|
| `final int` | `https://developer.android.com/reference/androidx/webgpu/GPUSurfaceConfiguration#getAlphaMode()()` |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/webgpu/GPUDevice` | `https://developer.android.com/reference/androidx/webgpu/GPUSurfaceConfiguration#getDevice()()` The device to use for rendering to the surface. |
| `final int` | `https://developer.android.com/reference/androidx/webgpu/GPUSurfaceConfiguration#getFormat()()` The texture format for the surface. |
| `final int` | `https://developer.android.com/reference/androidx/webgpu/GPUSurfaceConfiguration#getHeight()()` The height of the surface's textures. |
| `final int` | `https://developer.android.com/reference/androidx/webgpu/GPUSurfaceConfiguration#getPresentMode()()` |
| `final int` | `https://developer.android.com/reference/androidx/webgpu/GPUSurfaceConfiguration#getUsage()()` The allowed usages for the surface's textures. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull int[]` | `https://developer.android.com/reference/androidx/webgpu/GPUSurfaceConfiguration#getViewFormats()()` |
| `final int` | `https://developer.android.com/reference/androidx/webgpu/GPUSurfaceConfiguration#getWidth()()` The width of the surface's textures. |
| `final void` | `https://developer.android.com/reference/androidx/webgpu/GPUSurfaceConfiguration#setAlphaMode(kotlin.Int)(int value)` |
| `final void` | `https://developer.android.com/reference/androidx/webgpu/GPUSurfaceConfiguration#setDevice(androidx.webgpu.GPUDevice)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/webgpu/GPUDevice value)` The device to use for rendering to the surface. |
| `final void` | `https://developer.android.com/reference/androidx/webgpu/GPUSurfaceConfiguration#setFormat(kotlin.Int)(int value)` The texture format for the surface. |
| `final void` | `https://developer.android.com/reference/androidx/webgpu/GPUSurfaceConfiguration#setHeight(kotlin.Int)(int value)` The height of the surface's textures. |
| `final void` | `https://developer.android.com/reference/androidx/webgpu/GPUSurfaceConfiguration#setPresentMode(kotlin.Int)(int value)` |
| `final void` | `https://developer.android.com/reference/androidx/webgpu/GPUSurfaceConfiguration#setUsage(kotlin.Int)(int value)` The allowed usages for the surface's textures. |
| `final void` | `https://developer.android.com/reference/androidx/webgpu/GPUSurfaceConfiguration#setViewFormats(kotlin.IntArray)(@https://developer.android.com/reference/androidx/annotation/NonNull int[] value)` |
| `final void` | `https://developer.android.com/reference/androidx/webgpu/GPUSurfaceConfiguration#setWidth(kotlin.Int)(int value)` The width of the surface's textures. |

## Public constructors

### GPUSurfaceConfiguration

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

```
public GPUSurfaceConfiguration(
    @NonNull GPUDevice device,
    int width,
    int height,
    int format,
    int usage,
    @NonNull int[] viewFormats,
    int alphaMode,
    int presentMode
)
```

## Public methods

### getAlphaMode

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

```
public final int getAlphaMode()
```

### getDevice

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

```
public final @NonNull GPUDevice getDevice()
```

The device to use for rendering to the surface.

### getFormat

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

```
public final int getFormat()
```

The texture format for the surface.

### getHeight

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

```
public final int getHeight()
```

The height of the surface's textures.

### getPresentMode

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

```
public final int getPresentMode()
```

### getUsage

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

```
public final int getUsage()
```

The allowed usages for the surface's textures.

### getViewFormats

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

```
public final @NonNull int[] getViewFormats()
```

### getWidth

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

```
public final int getWidth()
```

The width of the surface's textures.

### setAlphaMode

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

```
public final void setAlphaMode(int value)
```

### setDevice

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

```
public final void setDevice(@NonNull GPUDevice value)
```

The device to use for rendering to the surface.

### setFormat

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

```
public final void setFormat(int value)
```

The texture format for the surface.

### setHeight

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

```
public final void setHeight(int value)
```

The height of the surface's textures.

### setPresentMode

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

```
public final void setPresentMode(int value)
```

### setUsage

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

```
public final void setUsage(int value)
```

The allowed usages for the surface's textures.

### setViewFormats

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

```
public final void setViewFormats(@NonNull int[] value)
```

### setWidth

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

```
public final void setWidth(int value)
```

The width of the surface's textures.