pub enum ShaderType {
Simple {
erase_texture: Option<TextureId>,
clip_texture: Option<TextureId>,
},
DashedLine {
dash_texture: TextureId,
erase_texture: Option<TextureId>,
clip_texture: Option<TextureId>,
},
Texture {
texture: TextureId,
texture_transform: Matrix,
repeat: bool,
alpha: f32,
erase_texture: Option<TextureId>,
clip_texture: Option<TextureId>,
},
LinearGradient {
texture: TextureId,
texture_transform: Matrix,
repeat: bool,
alpha: f32,
erase_texture: Option<TextureId>,
clip_texture: Option<TextureId>,
},
}Expand description
The shaders that can be chosen for the renderer
Variants§
Simple
Flat colour shader The erase texture (which should be a MSAA texture) is subtracted from anything drawn, if present
DashedLine
Flat colour with ‘dashed line’ texturing using a 1D texture
Texture
Colour derived from a texture with a transform mapping from canvas coordinates to texture coordinates
Fields
LinearGradient
Colour dervide from a 1D texture using a transform mapping (used for rendering linear gradients)
Implementations§
Source§impl ShaderType
impl ShaderType
Sourcepub fn with_erase_mask(
self,
new_erase_mask_texture: Option<TextureId>,
) -> ShaderType
pub fn with_erase_mask( self, new_erase_mask_texture: Option<TextureId>, ) -> ShaderType
Adds an erase mask texture to the existing shader
Sourcepub fn with_clip_mask(
self,
new_clip_mask_texture: Option<TextureId>,
) -> ShaderType
pub fn with_clip_mask( self, new_clip_mask_texture: Option<TextureId>, ) -> ShaderType
Adds a clip mask texture to the existing shader
Trait Implementations§
Source§impl Clone for ShaderType
impl Clone for ShaderType
Source§fn clone(&self) -> ShaderType
fn clone(&self) -> ShaderType
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ShaderType
impl Debug for ShaderType
Source§impl PartialEq for ShaderType
impl PartialEq for ShaderType
impl Copy for ShaderType
impl StructuralPartialEq for ShaderType
Auto Trait Implementations§
impl Freeze for ShaderType
impl RefUnwindSafe for ShaderType
impl Send for ShaderType
impl Sync for ShaderType
impl Unpin for ShaderType
impl UnwindSafe for ShaderType
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more