render_context

Structs

AlphaMaskPaint

Vector paint used to construct a surface-local alpha mask.

Properties

path

Type: Path

transform

Type: Transform2D

fill

Type: Fill

opacity

Type: f32


Color

Linear RGBA color used by the low-level renderer.

Implementations

hlca
pub fn hlca(h: f32, l: f32, c: f32, a: f32) -> Self

Construct a color from HLC/Lab-style components plus alpha.

hsva
pub fn hsva(h: f32, s: f32, v: f32, a: f32) -> Self

Construct a color from HSV plus alpha, with hue normalized to 0.0-1.0.

rgba
pub fn rgba(r: f32, g: f32, b: f32, a: f32) -> Self

Construct a color from linear RGBA channels in the range 0.0-1.0.


DrawRange

Normalized visible range for a stroked vector path.

Properties

start

Type: f32

end

Type: f32

enabled

Type: bool


GradientStop

One color stop in a GPU gradient fill.

Properties

color

Type: Color

stop

Type: f32


Material

Light-reactive material coefficients for a tessellated vector path.

Properties

coefficients

Type: [f32; 4]

emissive

Type: [f32; 4]

unlit

Type: bool


ResourceChurnStats

Resource churn counters for renderer profiling.

Properties

flushes

Type: u64

retained_scene_resets

Type: u64

vector_batch_flushes

Type: u64

vector_buffer_rebuilds

Type: u64

vector_geometry_rebuilds

Type: u64

vector_geometry_cache_hits

Type: u64

vector_geometry_cache_misses

Type: u64

vector_geometry_cache_evictions

Type: u64

vector_geometry_cache_bytes

Type: u64

tessellated_vertices

Type: u64

tessellated_indices

Type: u64

cached_vertices_reused

Type: u64

cached_indices_reused

Type: u64

vector_resource_creates

Type: u64

vector_resource_updates

Type: u64

vector_resource_recreates

Type: u64

vector_resource_create_bytes

Type: u64

vector_resource_update_bytes

Type: u64

vector_resource_cache_hits

Type: u64

vector_resource_cache_misses

Type: u64

vector_resource_cache_evictions

Type: u64

vector_resource_cache_bytes

Type: u64

texture_creates

Type: u64

texture_upload_bytes

Type: u64

retained_nodes_considered

Type: u64

retained_nodes_visible

Type: u64

retained_draw_batches

Type: u64

retained_draws

Type: u64

retained_vector_draws

Type: u64

retained_image_draws

Type: u64


SceneLight

A resolved scene light for the low-level renderer.

Properties

shape

Type: LightShape

position

Type: [f32; 3]

direction

Type: [f32; 3]

color

Type: Color

intensity

Type: f32

radius

Type: f32


SceneLighting

Resolved lighting state for one retained vector scene.

Properties

active

Type: bool

ambient_is_authored

Type: bool

ambient_color

Type: Color

ambient_intensity

Type: f32

lights

Type: Vec<SceneLight>


Stroke

Stroke style for a tessellated vector path.

Properties

fill

Type: Fill

weight

Type: f32

cap

Type: StrokeCap

join

Type: StrokeJoin


WgpuRenderer

Retained scene renderer that records Pax vector/image commands and flushes them through wgpu.

Implementations

clip_alpha
pub fn clip_alpha(&mut self, paints: Vec<AlphaMaskPaint>, feather: f32)

Installs a painted alpha mask in the current save/restore scope.

current_transform
pub fn current_transform(&self) -> Transform2D

Current transform at the top of the render-state stack.

fill_path
pub fn fill_path(&mut self, path: Path, fill: Fill)

Queue a filled vector path into the current retained node.

fill_path_with_material_and_opacity
pub fn fill_path_with_material_and_opacity(&mut self, path: Path, fill: Fill, material: Material, opacity: f32)

Queue a filled vector path with material response and an extra opacity multiplier.

fill_path_with_material_and_opacity_and_smoothing
pub fn fill_path_with_material_and_opacity_and_smoothing(&mut self, path: Path, fill: Fill, material: Material, opacity: f32, smoothing: PathSmoothing)

Queue a filled vector path with material response, opacity, and optional smoothing.

fill_path_with_opacity
pub fn fill_path_with_opacity(&mut self, path: Path, fill: Fill, opacity: f32)

Queue a filled vector path with an extra opacity multiplier.

new
pub fn new(render_backend: RenderBackend<'w>) -> Self

Create a retained renderer around a low-level RenderBackend.

reset_retained_scene
pub fn reset_retained_scene(&mut self)

Drop retained scene state for a surface that has been rebound to a new tile origin.

set_surface_transform
pub fn set_surface_transform(&mut self, transform: Transform2D)

Set the base transform for the physical surface tile being rendered.

share_vector_caches_from
pub fn share_vector_caches_from(&mut self, other: &Self)

Share vector resource caches with another renderer for the same logical layer.

stroke_path
pub fn stroke_path(&mut self, path: Path, stroke: Stroke)

Queue a stroked vector path into the current retained node.

stroke_path_with_draw_range_and_material_and_opacity
pub fn stroke_path_with_draw_range_and_material_and_opacity(&mut self, path: Path, stroke: Stroke, material: Material, opacity: f32, draw_range: DrawRange)

Queue a draw-ranged stroked vector path with material response and an extra opacity multiplier.

stroke_path_with_draw_range_and_material_and_opacity_and_smoothing
pub fn stroke_path_with_draw_range_and_material_and_opacity_and_smoothing(&mut self, path: Path, stroke: Stroke, material: Material, opacity: f32, draw_range: DrawRange, smoothing: PathSmoothing)

Queue a draw-ranged stroked vector path with material response, opacity, and optional smoothing.

stroke_path_with_material_and_opacity
pub fn stroke_path_with_material_and_opacity(&mut self, path: Path, stroke: Stroke, material: Material, opacity: f32)

Queue a stroked vector path with material response and an extra opacity multiplier.

stroke_path_with_material_and_opacity_and_smoothing
pub fn stroke_path_with_material_and_opacity_and_smoothing(&mut self, path: Path, stroke: Stroke, material: Material, opacity: f32, smoothing: PathSmoothing)

Queue a stroked vector path with material response, opacity, and optional smoothing.

stroke_path_with_opacity
pub fn stroke_path_with_opacity(&mut self, path: Path, stroke: Stroke, opacity: f32)

Queue a stroked vector path with an extra opacity multiplier.

take_resource_churn_stats
pub fn take_resource_churn_stats(&mut self) -> ResourceChurnStats

Return and reset accumulated resource churn counters.

Enums

Fill

Fill style for a tessellated vector path.

Variants

Solid(Color)
Gradient { gradient_type: GradientType, pos: Point2D, main_axis: Vector2D, off_axis: Vector2D, stops: Vec<GradientStop> }

GradientType

Shape of a GPU gradient fill.

Variants

Linear
Radial

LightShape

Shape of a scene light.

Variants

Point
Directional

StrokeCap

Stroke end-cap style.

Variants

Butt
Round
Square

StrokeJoin

Stroke join style.

Variants

Miter
Round
Bevel