[−][src]Struct piet_common::CairoRenderContext
Methods
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> RenderContext for CairoRenderContext<'a>
[src]
type Point = Vec2
Cairo mostly uses raw f64, so this is as convenient as anything.
type Coord = f64
The type of 1D measurements, for example stroke width. Read more
type Brush = Brush
The type of a "brush". Read more
type Text = CairoText
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, rgb: u32)
[src]
fn solid_brush(&mut self, rgba: u32) -> Result<Brush, Error>
[src]
fn gradient(&mut self, gradient: Gradient) -> Result<Brush, Error>
[src]
fn fill<impl Shape>(
&mut self,
shape: impl Shape,
brush: &<CairoRenderContext<'a> as RenderContext>::Brush,
fill_rule: FillRule
) where
impl Shape: Shape,
[src]
&mut self,
shape: impl Shape,
brush: &<CairoRenderContext<'a> as RenderContext>::Brush,
fill_rule: FillRule
) where
impl Shape: Shape,
fn clip<impl Shape>(&mut self, shape: impl Shape, fill_rule: FillRule) where
impl Shape: Shape,
[src]
impl Shape: Shape,
fn stroke<impl Shape, impl RoundInto>(
&mut self,
shape: impl Shape,
brush: &<CairoRenderContext<'a> as RenderContext>::Brush,
width: impl RoundInto,
style: Option<&StrokeStyle>
) where
impl RoundInto: RoundInto<<CairoRenderContext<'a> as RenderContext>::Coord>,
impl Shape: Shape,
[src]
&mut self,
shape: impl Shape,
brush: &<CairoRenderContext<'a> as RenderContext>::Brush,
width: impl RoundInto
style: Option<&StrokeStyle>
) where
impl RoundInto
impl Shape: Shape,
fn text(&mut self) -> &mut <CairoRenderContext<'a> as RenderContext>::Text
[src]
fn draw_text<impl RoundInto>(
&mut self,
layout: &<CairoRenderContext<'a> as RenderContext>::TextLayout,
pos: impl RoundInto,
brush: &<CairoRenderContext<'a> as RenderContext>::Brush
) where
impl RoundInto: RoundInto<<CairoRenderContext<'a> as RenderContext>::Point>,
[src]
&mut self,
layout: &<CairoRenderContext<'a> as RenderContext>::TextLayout,
pos: impl RoundInto
brush: &<CairoRenderContext<'a> as RenderContext>::Brush
) where
impl RoundInto
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<<CairoRenderContext<'a> as RenderContext>::Image, Error>
[src]
&mut self,
width: usize,
height: usize,
buf: &[u8],
format: ImageFormat
) -> Result<<CairoRenderContext<'a> as RenderContext>::Image, Error>
fn draw_image<impl Into>(
&mut self,
image: &<CairoRenderContext<'a> as RenderContext>::Image,
rect: impl Into,
interp: InterpolationMode
) where
impl Into: Into<Rect>,
[src]
&mut self,
image: &<CairoRenderContext<'a> as RenderContext>::Image,
rect: impl Into
interp: InterpolationMode
) where
impl Into
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
Auto Trait Implementations
impl<'a> !Send for CairoRenderContext<'a>
impl<'a> !Sync for CairoRenderContext<'a>
Blanket Implementations
impl<T> From for T
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
🔬 This is a nightly-only experimental API. (
try_from
)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> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
🔬 This is a nightly-only experimental API. (
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> RoundFrom for T
[src]
fn round_from(x: T) -> T
[src]
impl<T, U> RoundInto for T where
U: RoundFrom<T>,
[src]
U: RoundFrom<T>,