Struct piet_web::WebRenderContext
source · pub struct WebRenderContext<'a> { /* private fields */ }Implementations
sourceimpl WebRenderContext<'_>
impl WebRenderContext<'_>
pub fn new(
ctx: CanvasRenderingContext2d,
window: Window
) -> WebRenderContext<'static>
Trait Implementations
sourceimpl RenderContext for WebRenderContext<'_>
impl RenderContext for WebRenderContext<'_>
type TextLayout = WebTextLayout
type TextLayout = WebTextLayout
The type use to represent text layout objects.
sourcefn solid_brush(&mut self, color: Color) -> Brush
fn solid_brush(&mut self, color: Color) -> Brush
Create a new brush resource. Read more
sourcefn 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.
sourcefn 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. Read more
sourcefn 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.sourcefn 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.sourcefn 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 moresourcefn current_transform(&self) -> Affine
fn current_transform(&self) -> Affine
Returns the transformations currently applied to the context.
sourcefn 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>
sourcefn 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
)
sourcefn 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
)
sourcefn blurred_rect(
&mut self,
rect: Rect,
blur_radius: f64,
brush: &impl IntoBrush<Self>
)
fn blurred_rect(
&mut self,
rect: Rect,
blur_radius: f64,
brush: &impl IntoBrush<Self>
)
Draw a rectangle with Gaussian blur. Read more
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
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> RoundFrom<T> for T
impl<T> RoundFrom<T> for T
sourcefn round_from(x: T) -> T
fn round_from(x: T) -> T
Performs the conversion.
sourceimpl<T, U> RoundInto<U> for Twhere
U: RoundFrom<T>,
impl<T, U> RoundInto<U> for Twhere
U: RoundFrom<T>,
sourcefn round_into(self) -> U
fn round_into(self) -> U
Performs the conversion.