18namespace skgpu {
class KeyBuilder; }
22 const SkMatrix&
matrix, std::unique_ptr<GrFragmentProcessor> child) {
27 if (me->fMatrix.hasPerspective() || !
matrix.hasPerspective()) {
35std::unique_ptr<GrFragmentProcessor::ProgramImpl> GrMatrixEffect::onMakeProgramImpl()
const {
38 void emitCode(EmitArgs&
args)
override {
39 fMatrixVar =
args.fUniformHandler->addUniform(&
args.fFp,
43 args.fFragBuilder->codeAppendf(
"return %s;\n",
44 this->invokeChildWithMatrix(0,
args).c_str());
53 m.preConcat(mtx.fMatrix);
60 UniformHandle fMatrixVar;
63 return std::make_unique<Impl>();
70 if (fMatrix != that.fMatrix)
return false;
79 return std::unique_ptr<GrFragmentProcessor>(
new GrMatrixEffect(*
this));
#define INHERITED(method,...)
GrTextureEffect * asTextureEffect()
GrFragmentProcessor * childProcessor(int index)
void setSkMatrix(UniformHandle, const SkMatrix &) const
std::unique_ptr< GrFragmentProcessor > clone() const override
static std::unique_ptr< GrFragmentProcessor > Make(const SkMatrix &matrix, std::unique_ptr< GrFragmentProcessor > child)
@ kGrMatrixEffect_ClassID
SkMatrix & preConcat(const SkMatrix &other)
static const char * MatrixUniformName()
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args
unsigned useCenter Optional< SkMatrix > matrix