Skip to content
Permalink
Browse files

Add a layer to store Pattern related information

Some information of `canvas_data::Pattern` was lost by
converting it to `raqote::Source` due to the fact that Raqote
did not store this information (e.g. linear gradient's start/end
points). We introduce another layer to keep this information for later
use (like in `is_zero_size_gradient()`).
  • Loading branch information
pylbrecht committed Dec 13, 2019
1 parent 1aecf40 commit a50aef6f00d3ba1cb45a0eb5d0c7fafbbe7bb1fb
Showing with 247 additions and 173 deletions.
  1. +1 −9 components/canvas/canvas_data.rs
  2. +246 −164 components/canvas/raqote_backend.rs
@@ -358,15 +358,7 @@ pub enum Pattern<'a> {
#[cfg(feature = "canvas2d-azure")]
Azure(azure::azure_hl::Pattern, PhantomData<&'a ()>),
#[cfg(feature = "canvas2d-raqote")]
Raqote(raqote::Source<'a>, Option<Repetition>),
}

#[derive(Clone)]
pub enum Repetition {
Repeat,
RepeatX,
RepeatY,
NoRepeat,
Raqote(crate::raqote_backend::Pattern<'a>),
}

pub enum DrawSurfaceOptions {

0 comments on commit a50aef6

Please sign in to comment.
You can’t perform that action at this time.