18namespace skgpu {
class KeyBuilder; }
22 const SkMatrix& matrix, std::unique_ptr<GrFragmentProcessor> child) {
27 if (me->fMatrix.hasPerspective() || !matrix.hasPerspective()) {
32 return std::unique_ptr<GrFragmentProcessor>(
new GrMatrixEffect(matrix, std::move(child)));
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());
52 SkMatrix m = te->coordAdjustmentMatrix();
53 m.preConcat(mtx.fMatrix);
60 UniformHandle fMatrixVar;
63 return std::make_unique<Impl>();
70 if (fMatrix != that.fMatrix)
return false;
76 , fMatrix(src.fMatrix) {}
79 return std::unique_ptr<GrFragmentProcessor>(
new GrMatrixEffect(*
this));
#define INHERITED(method,...)
GrTextureEffect * asTextureEffect()
GrFragmentProcessor * childProcessor(int index)
void setSkMatrix(UniformHandle, const SkMatrix &) const
void onAddToKey(const GrShaderCaps &, skgpu::KeyBuilder *) const override
std::unique_ptr< GrFragmentProcessor > clone() const override
std::unique_ptr< ProgramImpl > onMakeProgramImpl() const override
bool onIsEqual(const GrFragmentProcessor &) 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