# SkiaOptions

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-skia/struct-skiaoptions/

**struct** · [`ferroui-skia`](/docs/0.5.0/api/ferroui-skia/) · v0.5.0

```rust
struct SkiaOptions
```

Options for the Skia rendering subsystem.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Skia/FerroUI.Skia/skia_options.rs#L30)

## Members

- [`max_gpu_resource_size_bytes`](#struct_field-max_gpu_resource_size_bytes)
- [`use_opacity_save_layer`](#struct_field-use_opacity_save_layer)
- [`use_stencil_buffers`](#struct_field-use_stencil_buffers)
- [`prewarm_effect_pipelines`](#struct_field-prewarm_effect_pipelines)
- [`frame_pipelining_bands`](#struct_field-frame_pipelining_bands)
- [`new`](#function-new)
- [`effective_frame_pipelining_bands`](#function-effective_frame_pipelining_bands)
- [`should_avoid_stencil_buffers`](#function-should_avoid_stencil_buffers)

<a id="struct_field-max_gpu_resource_size_bytes"></a>

### max_gpu_resource_size_bytes

```rust
max_gpu_resource_size_bytes: Option<i64>
```

The maximum number of bytes for video memory to store textures and
resources.

128 MiB by default, the budget of the image textures of Vello
(upstream's 28 MiB evicted the textures of images that scrolled out
of view, which were uploaded again when they came back:
docs/porting/gpu-rendering.md, "The image textures of Ganesh").
`None` means the Skia default.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Skia/FerroUI.Skia/skia_options.rs#L39)

<a id="struct_field-use_opacity_save_layer"></a>

### use_opacity_save_layer

```rust
use_opacity_save_layer: bool
```

Use a save layer to apply opacity, so that every visual is rendered to
its own layer when opacity is applied.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Skia/FerroUI.Skia/skia_options.rs#L43)

<a id="struct_field-use_stencil_buffers"></a>

### use_stencil_buffers

```rust
use_stencil_buffers: Option<bool>
```

Whether Skia may use stencil buffers. Only an explicit `Some(true)`
enables them; see `should_avoid_stencil_buffers`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Skia/FerroUI.Skia/skia_options.rs#L47)

<a id="struct_field-prewarm_effect_pipelines"></a>

### prewarm_effect_pipelines

```rust
prewarm_effect_pipelines: bool
```

Whether a GPU render target makes the GPU pipelines of the effects
the themes register (`effects::register_effect_prewarm`, the acrylic
of the WinUI theme) after the first frame of a window, by drawing them
once offscreen, rather than when a frame first draws them (#437). On
Graphite the pipelines are compiled on a thread of their own, from a
recorder of their own; on Ganesh by the render thread, between two
frames. `true` by default (docs/porting/gpu-rendering.md, "Pipelines
made ahead of their first draw").

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Skia/FerroUI.Skia/skia_options.rs#L57)

<a id="struct_field-frame_pipelining_bands"></a>

### frame_pipelining_bands

```rust
frame_pipelining_bands: usize
```

How many horizontal bands a pipelined frame is divided into
(`frame_pipelining`), each drawn by a
thread of its own with a Graphite recorder of its own.

`DEFAULT_FRAME_PIPELINING_BANDS` (two) by default; a value outside
`1..=``MAX_FRAME_PIPELINING_BANDS` is brought into that range. One
band draws the whole frame on one thread beside the render thread.
More bands spread the recording of a frame over more cores; each
band has a glyph atlas of its own and draws what crosses its
boundaries once more, and a band is at least 64 pixels high, so a
low layer has fewer. The threads are made by the first layer of a
GPU context that pipelines a frame, as many as that layer has bands
(docs/porting/desktop-performance.md, section 9.33).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Skia/FerroUI.Skia/skia_options.rs#L90)

<a id="function-new"></a>

### new

```rust
fn new() -> Self
```

Creates the default options.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Skia/FerroUI.Skia/skia_options.rs#L108)

<a id="function-effective_frame_pipelining_bands"></a>

### effective_frame_pipelining_bands

```rust
fn effective_frame_pipelining_bands(self: &Self) -> usize
```

The number of bands of a pipelined frame the options ask for:
`frame_pipelining_bands` within
`1..=``MAX_FRAME_PIPELINING_BANDS`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Skia/FerroUI.Skia/skia_options.rs#L126)

<a id="function-should_avoid_stencil_buffers"></a>

### should_avoid_stencil_buffers

```rust
fn should_avoid_stencil_buffers(use_stencil_buffers: Option<bool>) -> bool
```

Stencil buffers let Skia choose multisample-based path rendering,
which quantizes edge coverage and visibly degrades vector geometry
anti-aliasing on GPU backends. They are a performance opt-in, so
anything other than an explicit `true` avoids them.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Skia/FerroUI.Skia/skia_options.rs#L134)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- `Borrow<T>`
- `BorrowMut<T>`
- `CloneToUninit`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- `Any`
- `ToOwned`
- [`PropertyValue`](/docs/0.5.0/api/ferroui-base/trait-propertyvalue/)
- [`AnyValue`](/docs/0.5.0/api/ferroui-base/trait-anyvalue/)
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- `ErasedDestructor`
- `IntoEither`
- `Clone`
- `Copy`
- `Debug`
- `StructuralPartialEq`
- `PartialEq`
- `Eq`
- `Default`

## Availability

Extracted for `aarch64-apple-darwin`. Cargo features are listed in the [crate index](/docs/0.5.0/api/).
