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

composition

Type: Option<(u32, 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. Effect counters are available with the opt-in shaders Cargo feature.

Properties

effect_source_renders

Type: u64

effect_source_cache_hits

Type: u64

effect_pipeline_compilations

Type: u64

effect_texture_allocations

Type: u64

effect_texture_bytes

Type: u64

effect_cache_hits

Type: u64

effect_passes

Type: u64

effect_pixels

Type: u64

mesh_texture_allocations

Type: u64

mesh_texture_bytes

Type: u64

Bytes allocated for mesh textures during this sample (not current residency).

mesh_coefficient_upload_bytes

Type: u64

mesh_raster_passes

Type: u64

mesh_cache_hits

Type: u64

mesh_topology_allocations

Type: u64

flushes

Type: u64

opacity_group_renders

Type: u64

opacity_group_cache_hits

Type: u64

alpha_source_renders

Type: u64

alpha_source_cache_hits

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

image_draw_creates

Type: u64

texture_upload_bytes

Type: u64

texture_cache_hits

Type: u64

Tile-local bindings created using an already resident sibling image texture.

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.

Transform and clip identities remain stable until their owning node releases them. GPU uniform pages grow with scene demand; the 480-entry page size is not a scene limit. Moving or fading retained geometry updates transform pages without retessellating or uploading vertex/index buffers.

Implementations

begin_shader_effect
pub fn begin_shader_effect(&mut self, id: u32, z: i32, effect: &ShaderEffect, transform: Transform2D, size: (f64, f64), scopes: &[OpacityScope], children: &[u32]) -> bool

Start a GPU-only filter boundary. A true return requests an initial source replay. Available with the opt-in shaders Cargo feature.

end_shader_effect
pub fn end_shader_effect(&mut self)

Finish the GPU-only filter boundary. Requires the shaders Cargo feature.

begin_alpha_source
pub fn begin_alpha_source(&mut self, mapping: Transform2D, feather: f32)

Records a detached source in the current mask owner's surface coordinates. Source clips and opacity are independent of the consuming content; its enclosing mask is applied afterward.

end_alpha_source
pub fn end_alpha_source(&mut self)

Restores the consumer and installs a reference to the source's retained alpha texture.

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.

draw_image
pub fn draw_image(&mut self, image_key: &str, image_version: u64, image: &Image, rect: Box2D)

Image identity and version must identify the same pixels across renderers sharing a GPU context. Change the version when replacing image content.

draw_image_with_opacity
pub fn draw_image_with_opacity(&mut self, image_key: &str, image_version: u64, image: &Image, rect: Box2D, opacity: f32)

Multiplies source pixel alpha by opacity without reuploading the texture. Sibling tiles share resident image pixels, but keep their own draw bindings. Identity/version follows the same contract as [Self::draw_image].

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_node_opacity_scopes
pub fn set_node_opacity_scopes(&mut self, node_id: u32, scopes: &[OpacityScope])

Updates group presentation without changing a node's paint or image resources.

set_scene_lighting
pub fn set_scene_lighting(&mut self, lighting: SceneLighting) -> bool

Upload changed surface-local lighting, returning whether retained pixels need redraw. Only lights used by this surface's lit vector draws invalidate its contents. Repeating the same value does not upload a uniform or dirty the scene. Each new renderer receives its own initial upload, even for default lighting.

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.

shared_gpu_context
pub fn shared_gpu_context(&self) -> SharedGpuContext

Reuse this logical layer's GPU context when creating another physical tile. The returned handle keeps the device and pipelines alive, not this tile's surface or scene.

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

Mesh { rows: Vec<Vec<([f32; 2], Color)>>, pos: Point2D, main_axis: Vector2D, off_axis: Vector2D }

Row-connected mesh in normalized paint coordinates. The axes map that domain to scene coordinates; row order fixes connectivity independently of each anchor's x/y position.

Blend(Vec<(Fill, f32)>)

Weighted premultiplied paint mixture, sampled before compositing.

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

Unit outer circle centered at pos, mapped by main_axis/off_axis. Stops are normalized (0..1); the focal point is in that unit circle's space.


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