fn update_shader_transform(&mut self) {
        unsafe {
            use self::ShaderType::*;

            let shader = match &self.active_shader {
                Some(Simple { erase_texture: None, clip_texture: None })                            => Some(&mut self.simple_shader.basic),
                Some(Simple { erase_texture: Some(_), clip_texture: None })                         => Some(&mut self.simple_shader.erase),
                Some(Simple { erase_texture: None, clip_texture: Some(_) })                         => Some(&mut self.simple_shader.clip),
                Some(Simple { erase_texture: Some(_), clip_texture: Some(_) })                      => Some(&mut self.simple_shader.clip_erase),

                Some(DashedLine { dash_texture: _, erase_texture: None, clip_texture: None })       => Some(&mut self.dashed_line_shader.basic),
                Some(DashedLine { dash_texture: _, erase_texture: Some(_), clip_texture: None })    => Some(&mut self.dashed_line_shader.erase),
                Some(DashedLine { dash_texture: _, erase_texture: None, clip_texture: Some(_) })    => Some(&mut self.dashed_line_shader.clip),
                Some(DashedLine { dash_texture: _, erase_texture: Some(_), clip_texture: Some(_) }) => Some(&mut self.dashed_line_shader.clip_erase),

                Some(Texture { erase_texture: None, clip_texture: None, .. })                       => Some(&mut self.texture_shader.basic),
                Some(Texture { erase_texture: Some(_), clip_texture: None, .. })                    => Some(&mut self.texture_shader.erase),
                Some(Texture { erase_texture: None, clip_texture: Some(_), .. })                    => Some(&mut self.texture_shader.clip),
                Some(Texture { erase_texture: Some(_), clip_texture: Some(_), .. })                 => Some(&mut self.texture_shader.clip_erase),

                Some(LinearGradient { erase_texture: None, clip_texture: None, .. })                => Some(&mut self.gradient_shader.basic),
                Some(LinearGradient { erase_texture: Some(_), clip_texture: None, .. })             => Some(&mut self.gradient_shader.erase),
                Some(LinearGradient { erase_texture: None, clip_texture: Some(_), .. })             => Some(&mut self.gradient_shader.clip),
                Some(LinearGradient { erase_texture: Some(_), clip_texture: Some(_), .. })          => Some(&mut self.gradient_shader.clip_erase),

                None                                                                                => None
            };

            self.transform_matrix.as_ref().and_then(|transform_matrix|
                shader.map(|shader| (shader, transform_matrix))
            ).map(|(shader, matrix)| {
                shader.uniform_location(ShaderUniform::Transform, "transform").map(|transform_uniform| {
                    gl::UniformMatrix4fv(transform_uniform, 1, gl::FALSE, matrix.as_ptr());
                });
            });
        }
    }
///
/// Set the transform in the active shader
///
Set the transform in the active shader
Set the transform in the active shader
fn update_shader_transform(&mut self) {
        unsafe {
            use self::ShaderType::*;
            let shader = match &self.active_shader {
                Some(Simple { erase_texture: None, clip_texture: None })                            => Some(&mut self.simple_shader.basic),
                Some(Simple { erase_texture: Some(_), clip_texture: None })                         => Some(&mut self.simple_shader.erase),
                Some(Simple { erase_texture: None, clip_texture: Some(_) })                         => Some(&mut self.simple_shader.clip),
                Some(Simple { erase_texture: Some(_), clip_texture: Some(_) })                      => Some(&mut self.simple_shader.clip_erase),
                Some(DashedLine { dash_texture: _, erase_texture: None, clip_texture: None })       => Some(&mut self.dashed_line_shader.basic),
                Some(DashedLine { dash_texture: _, erase_texture: Some(_), clip_texture: None })    => Some(&mut self.dashed_line_shader.erase),
                Some(DashedLine { dash_texture: _, erase_texture: None, clip_texture: Some(_) })    => Some(&mut self.dashed_line_shader.clip),
                Some(DashedLine { dash_texture: _, erase_texture: Some(_), clip_texture: Some(_) }) => Some(&mut self.dashed_line_shader.clip_erase),
                Some(Texture { erase_texture: None, clip_texture: None, .. })                       => Some(&mut self.texture_shader.basic),
                Some(Texture { erase_texture: Some(_), clip_texture: None, .. })                    => Some(&mut self.texture_shader.erase),
                Some(Texture { erase_texture: None, clip_texture: Some(_), .. })                    => Some(&mut self.texture_shader.clip),
                Some(Texture { erase_texture: Some(_), clip_texture: Some(_), .. })                 => Some(&mut self.texture_shader.clip_erase),
                Some(LinearGradient { erase_texture: None, clip_texture: None, .. })                => Some(&mut self.gradient_shader.basic),
                Some(LinearGradient { erase_texture: Some(_), clip_texture: None, .. })             => Some(&mut self.gradient_shader.erase),
                Some(LinearGradient { erase_texture: None, clip_texture: Some(_), .. })             => Some(&mut self.gradient_shader.clip),
                Some(LinearGradient { erase_texture: Some(_), clip_texture: Some(_), .. })          => Some(&mut self.gradient_shader.clip_erase),
                None                                                                                => None
            };
            self.transform_matrix.as_ref().and_then(|transform_matrix|
                shader.map(|shader| (shader, transform_matrix))
            ).map(|(shader, matrix)| {
                shader.uniform_location(ShaderUniform::Transform, "transform").map(|transform_uniform| {
                    gl::UniformMatrix4fv(transform_uniform, 1, gl::FALSE, matrix.as_ptr());
                });
            });
        }
    }
fn update_shader_transform ( & mut self ) { unsafe { use self :: ShaderType :: * ; let shader = match & self . active_shader { Some ( Simple { erase_texture : None , clip_texture : None } ) => Some ( & mut self . simple_shader . basic ) , Some ( Simple { erase_texture : Some ( _ ) , clip_texture : None } ) => Some ( & mut self . simple_shader . erase ) , Some ( Simple { erase_texture : None , clip_texture : Some ( _ ) } ) => Some ( & mut self . simple_shader . clip ) , Some ( Simple { erase_texture : Some ( _ ) , clip_texture : Some ( _ ) } ) => Some ( & mut self . simple_shader . clip_erase ) , Some ( DashedLine { dash_texture : _ , erase_texture : None , clip_texture : None } ) => Some ( & mut self . dashed_line_shader . basic ) , Some ( DashedLine { dash_texture : _ , erase_texture : Some ( _ ) , clip_texture : None } ) => Some ( & mut self . dashed_line_shader . erase ) , Some ( DashedLine { dash_texture : _ , erase_texture : None , clip_texture : Some ( _ ) } ) => Some ( & mut self . dashed_line_shader . clip ) , Some ( DashedLine { dash_texture : _ , erase_texture : Some ( _ ) , clip_texture : Some ( _ ) } ) => Some ( & mut self . dashed_line_shader . clip_erase ) , Some ( Texture { erase_texture : None , clip_texture : None , .. } ) => Some ( & mut self . texture_shader . basic ) , Some ( Texture { erase_texture : Some ( _ ) , clip_texture : None , .. } ) => Some ( & mut self . texture_shader . erase ) , Some ( Texture { erase_texture : None , clip_texture : Some ( _ ) , .. } ) => Some ( & mut self . texture_shader . clip ) , Some ( Texture { erase_texture : Some ( _ ) , clip_texture : Some ( _ ) , .. } ) => Some ( & mut self . texture_shader . clip_erase ) , Some ( LinearGradient { erase_texture : None , clip_texture : None , .. } ) => Some ( & mut self . gradient_shader . basic ) , Some ( LinearGradient { erase_texture : Some ( _ ) , clip_texture : None , .. } ) => Some ( & mut self . gradient_shader . erase ) , Some ( LinearGradient { erase_texture : None , clip_texture : Some ( _ ) , .. } ) => Some ( & mut self . gradient_shader . clip ) , Some ( LinearGradient { erase_texture : Some ( _ ) , clip_texture : Some ( _ ) , .. } ) => Some ( & mut self . gradient_shader . clip_erase ) , None => None } ; self . transform_matrix . as_ref ( ) . and_then ( | transform_matrix | shader . map ( | shader | ( shader , transform_matrix ) ) ) . map ( | ( shader , matrix ) | { shader . uniform_location ( ShaderUniform :: Transform , " " ) . map ( | transform_uniform | { gl :: UniformMatrix4fv ( transform_uniform , 1 , gl :: FALSE , matrix . as_ptr ( ) ) ; } ) ; } ) ; } }
Set the transform in the active shader
Set the transform in the active shader
&mut self