Flutter Engine
The Flutter Engine
|
#include <SkRuntimeEffect.h>
Public Member Functions | |
SkRuntimeShaderBuilder (sk_sp< SkRuntimeEffect >) | |
SkRuntimeShaderBuilder (const SkRuntimeShaderBuilder &)=default | |
~SkRuntimeShaderBuilder () | |
sk_sp< SkShader > | makeShader (const SkMatrix *localMatrix=nullptr) const |
Public Member Functions inherited from SkRuntimeEffectBuilder | |
const SkRuntimeEffect * | effect () const |
BuilderUniform | uniform (std::string_view name) |
BuilderChild | child (std::string_view name) |
sk_sp< const SkData > | uniforms () const |
SkSpan< const SkRuntimeEffect::ChildPtr > | children () const |
Friends | |
class | SkRuntimeImageFilter |
Additional Inherited Members | |
Protected Member Functions inherited from SkRuntimeEffectBuilder | |
SkRuntimeEffectBuilder ()=delete | |
SkRuntimeEffectBuilder (sk_sp< SkRuntimeEffect > effect) | |
SkRuntimeEffectBuilder (sk_sp< SkRuntimeEffect > effect, sk_sp< SkData > uniforms) | |
SkRuntimeEffectBuilder (SkRuntimeEffectBuilder &&)=default | |
SkRuntimeEffectBuilder (const SkRuntimeEffectBuilder &)=default | |
SkRuntimeEffectBuilder & | operator= (SkRuntimeEffectBuilder &&)=delete |
SkRuntimeEffectBuilder & | operator= (const SkRuntimeEffectBuilder &)=delete |
SkRuntimeShaderBuilder is a utility to simplify creating SkShader objects from SkRuntimeEffects.
NOTE: Like SkRuntimeEffect, this API is experimental and subject to change!
Given an SkRuntimeEffect, the SkRuntimeShaderBuilder manages creating an input data block and provides named access to the 'uniform' variables in that block, as well as named access to a list of child shader slots. Usage:
sk_sp<SkRuntimeEffect> effect = ...; SkRuntimeShaderBuilder builder(effect); builder.uniform("some_uniform_float") = 3.14f; builder.uniform("some_uniform_matrix") = SkM44::Rotate(...); builder.child("some_child_effect") = mySkImage->makeShader(...); ... sk_sp<SkShader> shader = builder.makeShader(nullptr, false);
Note that SkRuntimeShaderBuilder is built entirely on the public API of SkRuntimeEffect, so can be used as-is or serve as inspiration for other interfaces or binding techniques.
Definition at line 472 of file SkRuntimeEffect.h.
|
explicit |
Definition at line 962 of file SkRuntimeEffect.cpp.
|
default |
|
default |
sk_sp< SkShader > SkRuntimeShaderBuilder::makeShader | ( | const SkMatrix * | localMatrix = nullptr | ) | const |
Definition at line 967 of file SkRuntimeEffect.cpp.
|
friend |
Definition at line 486 of file SkRuntimeEffect.h.