[−][src]Struct piet_cairo::CairoRenderContext
Implementations
impl<'a> CairoRenderContext<'a>
[src]
pub fn new(ctx: &mut Context) -> CairoRenderContext
[src]
Create a new Cairo back-end.
At the moment, it uses the "toy text API" for text layout, but when we change to a more sophisticated text layout approach, we'll probably need a factory for that as an additional argument.
Trait Implementations
impl<'a> IntoBrush<CairoRenderContext<'a>> for Brush
[src]
fn make_brush<'b>(
&'b self,
_piet: &mut CairoRenderContext,
_bbox: impl FnOnce() -> Rect
) -> Cow<'b, Brush>
[src]
&'b self,
_piet: &mut CairoRenderContext,
_bbox: impl FnOnce() -> Rect
) -> Cow<'b, Brush>
impl<'a> RenderContext for CairoRenderContext<'a>
[src]
type Brush = Brush
The type of a "brush". Read more
type Text = CairoText<'a>
An associated factory for creating text layouts and related resources.
type TextLayout = CairoTextLayout
type Image = ImageSurface
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: impl Into<FixedGradient>
) -> Result<Brush, Error>
[src]
&mut self,
gradient: impl Into<FixedGradient>
) -> Result<Brush, Error>
fn fill(&mut self, shape: impl Shape, brush: &impl IntoBrush<Self>)
[src]
fn fill_even_odd(&mut self, shape: impl Shape, brush: &impl IntoBrush<Self>)
[src]
fn clip(&mut self, shape: impl Shape)
[src]
fn stroke(
&mut self,
shape: impl Shape,
brush: &impl IntoBrush<Self>,
width: f64
)
[src]
&mut self,
shape: impl Shape,
brush: &impl IntoBrush<Self>,
width: f64
)
fn stroke_styled(
&mut self,
shape: impl Shape,
brush: &impl IntoBrush<Self>,
width: f64,
style: &StrokeStyle
)
[src]
&mut self,
shape: impl Shape,
brush: &impl IntoBrush<Self>,
width: f64,
style: &StrokeStyle
)
fn text(&mut self) -> &mut Self::Text
[src]
fn draw_text(
&mut self,
layout: &Self::TextLayout,
pos: impl Into<Point>,
brush: &impl IntoBrush<Self>
)
[src]
&mut self,
layout: &Self::TextLayout,
pos: impl Into<Point>,
brush: &impl IntoBrush<Self>
)
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 current_transform(&self) -> 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,
dst_rect: impl Into<Rect>,
interp: InterpolationMode
)
[src]
&mut self,
image: &Self::Image,
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
)
[src]
&mut self,
image: &Self::Image,
src_rect: impl Into<Rect>,
dst_rect: impl Into<Rect>,
interp: InterpolationMode
)
fn blurred_rect(
&mut self,
rect: Rect,
blur_radius: f64,
brush: &impl IntoBrush<Self>
)
[src]
&mut self,
rect: Rect,
blur_radius: f64,
brush: &impl IntoBrush<Self>
)
fn with_save(
&mut self,
f: impl FnOnce(&mut Self) -> Result<(), Error>
) -> Result<(), Error>
[src]
&mut self,
f: impl FnOnce(&mut Self) -> Result<(), Error>
) -> Result<(), Error>
Auto Trait Implementations
impl<'a> RefUnwindSafe for CairoRenderContext<'a>
impl<'a> !Send for CairoRenderContext<'a>
impl<'a> !Sync for CairoRenderContext<'a>
impl<'a> Unpin for CairoRenderContext<'a>
impl<'a> !UnwindSafe for CairoRenderContext<'a>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
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> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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>,
fn round_into(self) -> U
[src]
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>,