vizia::vg::runtime_effect

Type Alias RuntimeShaderBuilder

pub type RuntimeShaderBuilder = Handle<SkRuntimeEffectBuilder>;

Aliased Type§

struct RuntimeShaderBuilder(/* private fields */);

Implementations

§

impl Handle<SkRuntimeEffectBuilder>

pub fn new(effect: RCHandle<SkRuntimeEffect>) -> Handle<SkRuntimeEffectBuilder>

pub fn make_shader(&self, local_matrix: &Matrix) -> Option<RCHandle<SkShader>>

pub fn set_uniform_float( &mut self, name: impl AsRef<str>, data: &[f32], ) -> Result<(), ShaderBuilderError>

Set float uniform values by name.

Supported types are float, float2, float3, float4, float2x2, float3x3, float4x4.

The data array must have the correct length for the corresponding uniform type:

  • float: [f32; 1]
  • float2: [f32; 2]
  • float3: [f32; 3]
  • float4: [f32; 4]
  • float2x2: [f32; 4]
  • float3x3: [f32; 9]
  • float4x4: [f32; 16]

pub fn set_uniform_int( &mut self, name: impl AsRef<str>, data: &[i32], ) -> Result<(), ShaderBuilderError>

Set int uniform values by name.

Supported types are int, int2, int3, int4.

The data array must have the correct length for the corresponding uniform type:

  • int: [i32; 1]
  • int2: [i32; 2]
  • int3: [i32; 3]
  • int4: [i32; 4]

Trait Implementations

§

impl<N> AsRef<Handle<N>> for Handle<N>
where N: NativeDrop,

§

fn as_ref(&self) -> &Handle<N>

Converts this type into a shared reference of the (usually inferred) input type.
§

impl<N> Clone for Handle<N>
where N: NativeDrop + NativeClone,

§

fn clone(&self) -> Handle<N>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl<N> Drop for Handle<N>
where N: NativeDrop,

§

fn drop(&mut self)

Executes the destructor for this type. Read more
§

impl<N> Hash for Handle<N>
where N: NativeDrop + NativeHash,

§

fn hash<H>(&self, state: &mut H)
where H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
§

impl<N> PartialEq for Handle<N>
where N: NativeDrop + NativePartialEq,

§

fn eq(&self, rhs: &Handle<N>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl<N> RefWrapper<N> for Handle<N>
where N: NativeDrop,

§

fn wrap_ref(native: &N) -> &Handle<N>

§

fn wrap_mut(native: &mut N) -> &mut Handle<N>

§

fn inner(&self) -> &N

§

fn inner_mut(&mut self) -> &mut N

§

impl<N> ValueWrapper<N> for Handle<N>
where N: NativeDrop,

§

fn wrap(native: N) -> Handle<N>
where N: NativeDrop,

§

fn unwrap(self) -> N

§

fn inner(&self) -> &N

§

fn inner_mut(&mut self) -> &mut N

§

impl Send for Handle<SkRuntimeEffectBuilder>

§

impl Sync for Handle<SkRuntimeEffectBuilder>