SkiaOptions
struct · ferroui-skia · v0.5.0
struct SkiaOptions
Options for the Skia rendering subsystem.
Members
max_gpu_resource_size_bytesuse_opacity_save_layeruse_stencil_buffersprewarm_effect_pipelinesframe_pipelining_bandsneweffective_frame_pipelining_bandsshould_avoid_stencil_buffers
max_gpu_resource_size_bytes
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.
use_opacity_save_layer
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.
use_stencil_buffers
use_stencil_buffers: Option<bool>
Whether Skia may use stencil buffers. Only an explicit Some(true)
enables them; see should_avoid_stencil_buffers.
prewarm_effect_pipelines
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").
frame_pipelining_bands
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).
new
fn new() -> Self
Creates the default options.
effective_frame_pipelining_bands
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.
should_avoid_stencil_buffers
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.
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeBorrow<T>BorrowMut<T>CloneToUninitInto<U>From<T>TryInto<U>TryFrom<U>AnyToOwnedPropertyValueAnyValueClassDefaultsErasedDestructorIntoEitherCloneCopyDebugStructuralPartialEqPartialEqEqDefault
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.