Struct piet_web::WebRenderContext
source · pub struct WebRenderContext<'a> { /* private fields */ }
Implementations§
source§impl WebRenderContext<'_>
impl WebRenderContext<'_>
pub fn new(
ctx: CanvasRenderingContext2d,
window: Window
) -> WebRenderContext<'static>
Trait Implementations§
source§impl RenderContext for WebRenderContext<'_>
impl RenderContext for WebRenderContext<'_>
§type TextLayout = WebTextLayout
type TextLayout = WebTextLayout
The type use to represent text layout objects.
source§fn gradient(
&mut self,
gradient: impl Into<FixedGradient>
) -> Result<Brush, Error>
fn gradient(
&mut self,
gradient: impl Into<FixedGradient>
) -> Result<Brush, Error>
Create a new gradient brush.
source§fn fill(&mut self, shape: impl Shape, brush: &impl IntoBrush<Self>)
fn fill(&mut self, shape: impl Shape, brush: &impl IntoBrush<Self>)
Fill a [
Shape
], using the non-zero fill rule.source§fn fill_even_odd(&mut self, shape: impl Shape, brush: &impl IntoBrush<Self>)
fn fill_even_odd(&mut self, shape: impl Shape, brush: &impl IntoBrush<Self>)
Fill a shape, using the even-odd fill rule.
source§fn stroke(&mut self, shape: impl Shape, brush: &impl IntoBrush<Self>, width: f64)
fn stroke(&mut self, shape: impl Shape, brush: &impl IntoBrush<Self>, width: f64)
Stroke a [
Shape
], using the default StrokeStyle
.source§fn stroke_styled(
&mut self,
shape: impl Shape,
brush: &impl IntoBrush<Self>,
width: f64,
style: &StrokeStyle
)
fn stroke_styled(
&mut self,
shape: impl Shape,
brush: &impl IntoBrush<Self>,
width: f64,
style: &StrokeStyle
)
Stroke a [
Shape
], providing a custom StrokeStyle
.source§fn draw_text(&mut self, layout: &Self::TextLayout, pos: impl Into<Point>)
fn draw_text(&mut self, layout: &Self::TextLayout, pos: impl Into<Point>)
Draw a
TextLayout
. Read moresource§fn current_transform(&self) -> Affine
fn current_transform(&self) -> Affine
Returns the transformations currently applied to the context.
source§fn make_image(
&mut self,
width: usize,
height: usize,
buf: &[u8],
format: ImageFormat
) -> Result<Self::Image, Error>
fn make_image(
&mut self,
width: usize,
height: usize,
buf: &[u8],
format: ImageFormat
) -> Result<Self::Image, Error>
source§fn draw_image(
&mut self,
image: &Self::Image,
dst_rect: impl Into<Rect>,
interp: InterpolationMode
)
fn draw_image(
&mut self,
image: &Self::Image,
dst_rect: impl Into<Rect>,
interp: InterpolationMode
)
source§fn draw_image_area(
&mut self,
image: &Self::Image,
src_rect: impl Into<Rect>,
dst_rect: impl Into<Rect>,
interp: InterpolationMode
)
fn draw_image_area(
&mut self,
image: &Self::Image,
src_rect: impl Into<Rect>,
dst_rect: impl Into<Rect>,
interp: InterpolationMode
)
impl IntoBrush<WebRenderContext<'_>> for Brush
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for WebRenderContext<'a>
impl<'a> !Send for WebRenderContext<'a>
impl<'a> !Sync for WebRenderContext<'a>
impl<'a> Unpin for WebRenderContext<'a>
impl<'a> !UnwindSafe for WebRenderContext<'a>
Blanket Implementations§
source§impl<T, U> RoundInto<U> for Twhere
U: RoundFrom<T>,
impl<T, U> RoundInto<U> for Twhere
U: RoundFrom<T>,
source§fn round_into(self) -> U
fn round_into(self) -> U
Performs the conversion.