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()`).
This commit is contained in:
pylbrecht 2019-12-13 22:15:19 +01:00
parent 1aecf40922
commit a50aef6f00
2 changed files with 249 additions and 175 deletions

View file

@ -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 {