diff options
Diffstat (limited to 'graphics/src/shader.rs')
-rw-r--r-- | graphics/src/shader.rs | 25 |
1 files changed, 3 insertions, 22 deletions
diff --git a/graphics/src/shader.rs b/graphics/src/shader.rs index b9071c74..69679e9b 100644 --- a/graphics/src/shader.rs +++ b/graphics/src/shader.rs @@ -1,8 +1,7 @@ //! Supported shaders; -use crate::{Color, widget}; +use crate::Color; use crate::gradient::Gradient; -use crate::widget::canvas::{FillStyle, StrokeStyle}; #[derive(Debug, Clone)] /// Supported shaders for primitives. @@ -13,28 +12,10 @@ pub enum Shader { Gradient(Gradient) } -impl <'a> Into<Shader> for StrokeStyle<'a> { +impl <'a> Into<Shader> for Gradient { fn into(self) -> Shader { match self { - StrokeStyle::Solid(color) => Shader::Solid(color), - StrokeStyle::Gradient(gradient) => gradient.clone().into() - } - } -} - -impl <'a> Into<Shader> for FillStyle<'a> { - fn into(self) -> Shader { - match self { - FillStyle::Solid(color) => Shader::Solid(color), - FillStyle::Gradient(gradient) => gradient.clone().into() - } - } -} - -impl <'a> Into<Shader> for widget::canvas::Gradient { - fn into(self) -> Shader { - match self { - widget::canvas::Gradient::Linear(linear) => { + Gradient::Linear(linear) => { Shader::Gradient(Gradient::Linear(linear)) } } |