pub struct WgpuRenderer<'w> { /* private fields */ }Expand description
Retained scene renderer that records Pax vector/image commands and flushes them through wgpu.
Implementations§
Source§impl<'w> WgpuRenderer<'w>
impl<'w> WgpuRenderer<'w>
Sourcepub fn new(render_backend: RenderBackend<'w>) -> Self
pub fn new(render_backend: RenderBackend<'w>) -> Self
Create a retained renderer around a low-level RenderBackend.
Share vector resource caches with another renderer for the same logical layer.
pub fn set_vector_resource_cache_max_bytes(&mut self, max_bytes: usize)
Sourcepub fn take_resource_churn_stats(&mut self) -> ResourceChurnStats
pub fn take_resource_churn_stats(&mut self) -> ResourceChurnStats
Return and reset accumulated resource churn counters.
Sourcepub fn current_transform(&self) -> Transform2D
pub fn current_transform(&self) -> Transform2D
Current transform at the top of the render-state stack.
Sourcepub fn set_surface_transform(&mut self, transform: Transform2D)
pub fn set_surface_transform(&mut self, transform: Transform2D)
Set the base transform for the physical surface tile being rendered.
Sourcepub fn reset_retained_scene(&mut self)
pub fn reset_retained_scene(&mut self)
Drop retained scene state for a surface that has been rebound to a new tile origin.
Sourcepub fn stroke_path(&mut self, path: Path, stroke: Stroke)
pub fn stroke_path(&mut self, path: Path, stroke: Stroke)
Queue a stroked vector path into the current retained node.
Sourcepub fn stroke_path_with_opacity(
&mut self,
path: Path,
stroke: Stroke,
opacity: f32,
)
pub fn stroke_path_with_opacity( &mut self, path: Path, stroke: Stroke, opacity: f32, )
Queue a stroked vector path with an extra opacity multiplier.
Sourcepub fn stroke_path_with_material_and_opacity(
&mut self,
path: Path,
stroke: Stroke,
material: Material,
opacity: f32,
)
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.
Sourcepub fn stroke_path_with_material_and_opacity_and_smoothing(
&mut self,
path: Path,
stroke: Stroke,
material: Material,
opacity: f32,
smoothing: PathSmoothing,
)
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.
Sourcepub fn stroke_path_with_draw_range_and_material_and_opacity(
&mut self,
path: Path,
stroke: Stroke,
material: Material,
opacity: f32,
draw_range: DrawRange,
)
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.
Sourcepub 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,
)
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.
Sourcepub fn fill_path(&mut self, path: Path, fill: Fill)
pub fn fill_path(&mut self, path: Path, fill: Fill)
Queue a filled vector path into the current retained node.
Sourcepub fn fill_path_with_opacity(&mut self, path: Path, fill: Fill, opacity: f32)
pub fn fill_path_with_opacity(&mut self, path: Path, fill: Fill, opacity: f32)
Queue a filled vector path with an extra opacity multiplier.
Sourcepub fn fill_path_with_material_and_opacity(
&mut self,
path: Path,
fill: Fill,
material: Material,
opacity: f32,
)
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.
Sourcepub fn fill_path_with_material_and_opacity_and_smoothing(
&mut self,
path: Path,
fill: Fill,
material: Material,
opacity: f32,
smoothing: PathSmoothing,
)
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.
pub fn set_scene_lighting(&mut self, lighting: SceneLighting)
pub fn clear(&mut self)
pub fn draw_image( &mut self, image_key: &str, image_version: u64, image: &Image, rect: Box2D, )
pub fn flush(&mut self)
pub fn flush_deferred(&mut self)
pub fn save(&mut self)
pub fn restore(&mut self)
pub fn transform(&mut self, transform: Transform2D)
pub fn clip(&mut self, path: Path)
Sourcepub fn clip_alpha(&mut self, paints: Vec<AlphaMaskPaint>, feather: f32)
pub fn clip_alpha(&mut self, paints: Vec<AlphaMaskPaint>, feather: f32)
Installs a painted alpha mask in the current save/restore scope.