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<'_>
Source§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_with_stride(
&mut self,
width: usize,
height: usize,
stride: usize,
buf: &[u8],
format: ImageFormat,
) -> Result<Self::Image, Error>
fn make_image_with_stride( &mut self, width: usize, height: usize, stride: 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, )
Source§fn 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> Freeze for WebRenderContext<'a>
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
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.