[−][src]Struct piet_web::WebRenderContext
Methods
impl<'a> WebRenderContext<'a>
[src]
pub fn new(
ctx: &'a mut CanvasRenderingContext2d,
window: &'a Window
) -> WebRenderContext<'a>
[src]
ctx: &'a mut CanvasRenderingContext2d,
window: &'a Window
) -> WebRenderContext<'a>
Trait Implementations
impl<'a> RenderContext for WebRenderContext<'a>
[src]
type Brush = Brush
wasm-bindgen doesn't have a native Point type, so use kurbo's.
type Text = Self
An associated factory for creating text layouts and related resources.
type TextLayout = WebTextLayout
type Image = WebImage
The associated type of an image.
fn status(&mut self) -> Result<(), Error>
[src]
fn clear(&mut self, _color: Color)
[src]
fn solid_brush(&mut self, color: Color) -> Brush
[src]
fn gradient(&mut self, gradient: Gradient) -> Result<Brush, Error>
[src]
fn fill(&mut self, shape: impl Shape, brush: &Self::Brush, fill_rule: FillRule)
[src]
fn clip(&mut self, shape: impl Shape, fill_rule: FillRule)
[src]
fn stroke(
&mut self,
shape: impl Shape,
brush: &Self::Brush,
width: f64,
style: Option<&StrokeStyle>
)
[src]
&mut self,
shape: impl Shape,
brush: &Self::Brush,
width: f64,
style: Option<&StrokeStyle>
)
fn text(&mut self) -> &mut Self::Text
[src]
fn draw_text(
&mut self,
layout: &Self::TextLayout,
pos: impl Into<Point>,
brush: &Self::Brush
)
[src]
&mut self,
layout: &Self::TextLayout,
pos: impl Into<Point>,
brush: &Self::Brush
)
fn save(&mut self) -> Result<(), Error>
[src]
fn restore(&mut self) -> Result<(), Error>
[src]
fn finish(&mut self) -> Result<(), Error>
[src]
fn transform(&mut self, transform: Affine)
[src]
fn make_image(
&mut self,
width: usize,
height: usize,
buf: &[u8],
format: ImageFormat
) -> Result<Self::Image, Error>
[src]
&mut self,
width: usize,
height: usize,
buf: &[u8],
format: ImageFormat
) -> Result<Self::Image, Error>
fn draw_image(
&mut self,
image: &Self::Image,
rect: impl Into<Rect>,
_interp: InterpolationMode
)
[src]
&mut self,
image: &Self::Image,
rect: impl Into<Rect>,
_interp: InterpolationMode
)
fn with_save<impl FnOnce(&mut Self) -> Result<(), Error>>(
&mut self,
f: impl FnOnce(&mut Self) -> Result<(), Error>
) -> Result<(), Error> where
impl FnOnce(&mut Self) -> Result<(), Error>: FnOnce(&mut Self) -> Result<(), Error>,
[src]
&mut self,
f: impl FnOnce(&mut Self) -> Result<(), Error>
) -> Result<(), Error> where
impl FnOnce(&mut Self) -> Result<(), Error>: FnOnce(&mut Self) -> Result<(), Error>,
Do graphics operations with the context state saved and then restored. Read more
impl<'a> Text for WebRenderContext<'a>
[src]
type Font = WebFont
type FontBuilder = WebFontBuilder
type TextLayout = WebTextLayout
type TextLayoutBuilder = WebTextLayoutBuilder
fn new_font_by_name(
&mut self,
name: &str,
size: f64
) -> Result<Self::FontBuilder, Error>
[src]
&mut self,
name: &str,
size: f64
) -> Result<Self::FontBuilder, Error>
fn new_text_layout(
&mut self,
font: &Self::Font,
text: &str
) -> Result<Self::TextLayoutBuilder, Error>
[src]
&mut self,
font: &Self::Font,
text: &str
) -> Result<Self::TextLayoutBuilder, Error>
Auto Trait Implementations
impl<'a> Unpin for WebRenderContext<'a>
impl<'a> !Sync for WebRenderContext<'a>
impl<'a> !Send for WebRenderContext<'a>
impl<'a> !RefUnwindSafe for WebRenderContext<'a>
impl<'a> !UnwindSafe for WebRenderContext<'a>
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> RoundFrom<T> for T
[src]
fn round_from(x: T) -> T
[src]
impl<T, U> RoundInto<U> for T where
U: RoundFrom<T>,
[src]
U: RoundFrom<T>,