# SurfaceControlCompat.Builder

Artifact: [androidx.graphics:graphics-core](https://developer.android.com/jetpack/androidx/releases/graphics) [View Source](https://cs.android.com/search?q=file:androidx/graphics/surface/SurfaceControlCompat.kt+class:androidx.graphics.surface.SurfaceControlCompat.Builder) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/graphics#1.0.0)

*** ** * ** ***


```
class SurfaceControlCompat.Builder
```

<br />

*** ** * ** ***

Builder class for `https://developer.android.com/reference/kotlin/androidx/graphics/surface/SurfaceControlCompat` objects. By default the `https://developer.android.com/reference/android/view/Surface.html` will be hidden, and have "unset" bounds, meaning it can be as large as the bounds of its parent if a buffer or child so requires. It is necessary to set at least a name via `https://developer.android.com/reference/kotlin/androidx/graphics/surface/SurfaceControlCompat.Builder#setName(kotlin.String)`

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/graphics/surface/SurfaceControlCompat.Builder#Builder()()` |

| ### Public functions |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/graphics/surface/SurfaceControlCompat` | `https://developer.android.com/reference/kotlin/androidx/graphics/surface/SurfaceControlCompat.Builder#build()()` Construct a new `https://developer.android.com/reference/kotlin/androidx/graphics/surface/SurfaceControlCompat` with the set parameters. |
| `https://developer.android.com/reference/kotlin/androidx/graphics/surface/SurfaceControlCompat.Builder` | `https://developer.android.com/reference/kotlin/androidx/graphics/surface/SurfaceControlCompat.Builder#setName(kotlin.String)(name: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)` Set a debugging-name for the `https://developer.android.com/reference/kotlin/androidx/graphics/surface/SurfaceControlCompat`. |
| `https://developer.android.com/reference/kotlin/androidx/graphics/surface/SurfaceControlCompat.Builder` | `https://developer.android.com/reference/kotlin/androidx/graphics/surface/SurfaceControlCompat.Builder#setParent(androidx.graphics.surface.SurfaceControlCompat)(surfaceControl: https://developer.android.com/reference/kotlin/androidx/graphics/surface/SurfaceControlCompat)` Set a parent `https://developer.android.com/reference/kotlin/androidx/graphics/surface/SurfaceControlCompat` for the new `https://developer.android.com/reference/kotlin/androidx/graphics/surface/SurfaceControlCompat` instance. |
| `https://developer.android.com/reference/kotlin/androidx/graphics/surface/SurfaceControlCompat.Builder` | `https://developer.android.com/reference/kotlin/androidx/graphics/surface/SurfaceControlCompat.Builder#setParent(android.view.SurfaceView)(surfaceView: https://developer.android.com/reference/android/view/SurfaceView.html)` Set a parent `https://developer.android.com/reference/android/view/Surface.html` from the provided `https://developer.android.com/reference/android/view/SurfaceView.html` for our new `https://developer.android.com/reference/kotlin/androidx/graphics/surface/SurfaceControlCompat`. |

## Public constructors

### Builder

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

```
Builder()
```

## Public functions

### build

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

```
fun build(): SurfaceControlCompat
```

Construct a new `https://developer.android.com/reference/kotlin/androidx/graphics/surface/SurfaceControlCompat` with the set parameters. The builder remains valid after the `https://developer.android.com/reference/kotlin/androidx/graphics/surface/SurfaceControlCompat` instance is created.

### setName

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

```
fun setName(name: String): SurfaceControlCompat.Builder
```

Set a debugging-name for the `https://developer.android.com/reference/kotlin/androidx/graphics/surface/SurfaceControlCompat`.

| Parameters |
|---|---|
| `name: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | Debugging name configured on the `https://developer.android.com/reference/kotlin/androidx/graphics/surface/SurfaceControlCompat` instance. |

### setParent

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

```
fun setParent(surfaceControl: SurfaceControlCompat): SurfaceControlCompat.Builder
```

Set a parent `https://developer.android.com/reference/kotlin/androidx/graphics/surface/SurfaceControlCompat` for the new `https://developer.android.com/reference/kotlin/androidx/graphics/surface/SurfaceControlCompat` instance. Furthermore they stack relatively in Z order, and inherit the transformation of the parent.

| Parameters |
|---|---|
| `surfaceControl: https://developer.android.com/reference/kotlin/androidx/graphics/surface/SurfaceControlCompat` | Target `https://developer.android.com/reference/kotlin/androidx/graphics/surface/SurfaceControlCompat` used as the parent for the newly created `https://developer.android.com/reference/kotlin/androidx/graphics/surface/SurfaceControlCompat` instance |

### setParent

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

```
fun setParent(surfaceView: SurfaceView): SurfaceControlCompat.Builder
```

Set a parent `https://developer.android.com/reference/android/view/Surface.html` from the provided `https://developer.android.com/reference/android/view/SurfaceView.html` for our new `https://developer.android.com/reference/kotlin/androidx/graphics/surface/SurfaceControlCompat`. Child surfaces are constrained to the onscreen region of their parent. Furthermore they stack relatively in Z order, and inherit the transformation of the parent.

| Parameters |
|---|---|
| `surfaceView: https://developer.android.com/reference/android/view/SurfaceView.html` | Target `https://developer.android.com/reference/android/view/SurfaceView.html` used to provide the `https://developer.android.com/reference/android/view/Surface.html` this `https://developer.android.com/reference/kotlin/androidx/graphics/surface/SurfaceControlCompat` is associated with. |