Insert newlines in generated FP constructors
Cleans up registerChild calls, which were all on one long line. Change-Id: I2b665b033edb88cf1de5e4da433833c0be26c92b Reviewed-on: https://skia-review.googlesource.com/c/skia/+/397147 Commit-Queue: Brian Osman <brianosman@google.com> Commit-Queue: John Stiles <johnstiles@google.com> Auto-Submit: Brian Osman <brianosman@google.com> Reviewed-by: John Stiles <johnstiles@google.com>
This commit is contained in:
parent
665920e9b9
commit
6860db769b
@ -290,13 +290,13 @@ void HCodeGenerator::writeConstructor() {
|
||||
}
|
||||
std::string usageArg = usage.constructor(std::move(perspExpression));
|
||||
|
||||
this->writef(" this->registerChild(std::move(%s), %s);",
|
||||
this->writef(" this->registerChild(std::move(%s), %s);\n",
|
||||
String(param->name()).c_str(),
|
||||
usageArg.c_str());
|
||||
}
|
||||
}
|
||||
if (samplerCount) {
|
||||
this->writef(" this->setTextureSamplerCnt(%d);", samplerCount);
|
||||
this->writef(" this->setTextureSamplerCnt(%d);\n", samplerCount);
|
||||
}
|
||||
this->writef(" }\n");
|
||||
}
|
||||
|
@ -23,7 +23,8 @@ public:
|
||||
private:
|
||||
GrChildProcessorAndGlobal(std::unique_ptr<GrFragmentProcessor> child)
|
||||
: INHERITED(kGrChildProcessorAndGlobal_ClassID, kNone_OptimizationFlags) {
|
||||
this->registerChild(std::move(child), SkSL::SampleUsage::PassThrough()); }
|
||||
this->registerChild(std::move(child), SkSL::SampleUsage::PassThrough());
|
||||
}
|
||||
std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override;
|
||||
void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
|
||||
bool onIsEqual(const GrFragmentProcessor&) const override;
|
||||
|
@ -24,7 +24,8 @@ private:
|
||||
GrChildProcessorSampleCoords(std::unique_ptr<GrFragmentProcessor> child)
|
||||
: INHERITED(kGrChildProcessorSampleCoords_ClassID, kNone_OptimizationFlags) {
|
||||
this->setUsesSampleCoordsDirectly();
|
||||
this->registerChild(std::move(child), SkSL::SampleUsage(SkSL::SampleUsage::Kind::kNone, "", false, true, true)); }
|
||||
this->registerChild(std::move(child), SkSL::SampleUsage(SkSL::SampleUsage::Kind::kNone, "", false, true, true));
|
||||
}
|
||||
std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override;
|
||||
void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
|
||||
bool onIsEqual(const GrFragmentProcessor&) const override;
|
||||
|
@ -24,7 +24,8 @@ private:
|
||||
GrChildProcessorSampleMatrixAndCoords(std::unique_ptr<GrFragmentProcessor> child)
|
||||
: INHERITED(kGrChildProcessorSampleMatrixAndCoords_ClassID, kNone_OptimizationFlags) {
|
||||
this->setUsesSampleCoordsDirectly();
|
||||
this->registerChild(std::move(child), SkSL::SampleUsage(SkSL::SampleUsage::Kind::kVariable, "", true, true, false)); }
|
||||
this->registerChild(std::move(child), SkSL::SampleUsage(SkSL::SampleUsage::Kind::kVariable, "", true, true, false));
|
||||
}
|
||||
std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override;
|
||||
void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
|
||||
bool onIsEqual(const GrFragmentProcessor&) const override;
|
||||
|
@ -23,7 +23,8 @@ public:
|
||||
private:
|
||||
GrChildProcessorSampleMatrixConstant(std::unique_ptr<GrFragmentProcessor> child)
|
||||
: INHERITED(kGrChildProcessorSampleMatrixConstant_ClassID, kNone_OptimizationFlags) {
|
||||
this->registerChild(std::move(child), SkSL::SampleUsage::UniformMatrix("float3x3(2.0)", true)); }
|
||||
this->registerChild(std::move(child), SkSL::SampleUsage::UniformMatrix("float3x3(2.0)", true));
|
||||
}
|
||||
std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override;
|
||||
void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
|
||||
bool onIsEqual(const GrFragmentProcessor&) const override;
|
||||
|
@ -24,7 +24,8 @@ private:
|
||||
GrChildProcessorSampleMatrixConstantAndCoords(std::unique_ptr<GrFragmentProcessor> child)
|
||||
: INHERITED(kGrChildProcessorSampleMatrixConstantAndCoords_ClassID, kNone_OptimizationFlags) {
|
||||
this->setUsesSampleCoordsDirectly();
|
||||
this->registerChild(std::move(child), SkSL::SampleUsage(SkSL::SampleUsage::Kind::kUniform, "float3x3(0.5)", true, true, false)); }
|
||||
this->registerChild(std::move(child), SkSL::SampleUsage(SkSL::SampleUsage::Kind::kUniform, "float3x3(0.5)", true, true, false));
|
||||
}
|
||||
std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override;
|
||||
void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
|
||||
bool onIsEqual(const GrFragmentProcessor&) const override;
|
||||
|
@ -27,7 +27,8 @@ private:
|
||||
: INHERITED(kGrChildProcessorSampleMatrixMultipleUniforms_ClassID, kNone_OptimizationFlags)
|
||||
, matrixA(matrixA)
|
||||
, matrixB(matrixB) {
|
||||
this->registerChild(std::move(child), SkSL::SampleUsage::VariableMatrix(true)); }
|
||||
this->registerChild(std::move(child), SkSL::SampleUsage::VariableMatrix(true));
|
||||
}
|
||||
std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override;
|
||||
void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
|
||||
bool onIsEqual(const GrFragmentProcessor&) const override;
|
||||
|
@ -25,7 +25,8 @@ private:
|
||||
GrChildProcessorSampleMatrixSingleInUniform(std::unique_ptr<GrFragmentProcessor> child, SkMatrix matrix)
|
||||
: INHERITED(kGrChildProcessorSampleMatrixSingleInUniform_ClassID, kNone_OptimizationFlags)
|
||||
, matrix(matrix) {
|
||||
this->registerChild(std::move(child), SkSL::SampleUsage::UniformMatrix("matrix", matrix.hasPerspective())); }
|
||||
this->registerChild(std::move(child), SkSL::SampleUsage::UniformMatrix("matrix", matrix.hasPerspective()));
|
||||
}
|
||||
std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override;
|
||||
void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
|
||||
bool onIsEqual(const GrFragmentProcessor&) const override;
|
||||
|
@ -23,7 +23,8 @@ public:
|
||||
private:
|
||||
GrChildProcessorSampleMatrixSingleUniform(std::unique_ptr<GrFragmentProcessor> child)
|
||||
: INHERITED(kGrChildProcessorSampleMatrixSingleUniform_ClassID, kNone_OptimizationFlags) {
|
||||
this->registerChild(std::move(child), SkSL::SampleUsage::UniformMatrix("matrix", true)); }
|
||||
this->registerChild(std::move(child), SkSL::SampleUsage::UniformMatrix("matrix", true));
|
||||
}
|
||||
std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override;
|
||||
void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
|
||||
bool onIsEqual(const GrFragmentProcessor&) const override;
|
||||
|
@ -23,7 +23,8 @@ public:
|
||||
private:
|
||||
GrChildProcessorSampleMatrixSingleUniformExpr(std::unique_ptr<GrFragmentProcessor> child)
|
||||
: INHERITED(kGrChildProcessorSampleMatrixSingleUniformExpr_ClassID, kNone_OptimizationFlags) {
|
||||
this->registerChild(std::move(child), SkSL::SampleUsage::VariableMatrix(true)); }
|
||||
this->registerChild(std::move(child), SkSL::SampleUsage::VariableMatrix(true));
|
||||
}
|
||||
std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override;
|
||||
void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
|
||||
bool onIsEqual(const GrFragmentProcessor&) const override;
|
||||
|
@ -23,7 +23,8 @@ public:
|
||||
private:
|
||||
GrChildProcessorWithInputExpression(std::unique_ptr<GrFragmentProcessor> child)
|
||||
: INHERITED(kGrChildProcessorWithInputExpression_ClassID, kNone_OptimizationFlags) {
|
||||
this->registerChild(std::move(child), SkSL::SampleUsage::PassThrough()); }
|
||||
this->registerChild(std::move(child), SkSL::SampleUsage::PassThrough());
|
||||
}
|
||||
std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override;
|
||||
void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
|
||||
bool onIsEqual(const GrFragmentProcessor&) const override;
|
||||
|
@ -23,7 +23,9 @@ public:
|
||||
private:
|
||||
GrChildProcessors(std::unique_ptr<GrFragmentProcessor> child1, std::unique_ptr<GrFragmentProcessor> child2)
|
||||
: INHERITED(kGrChildProcessors_ClassID, kNone_OptimizationFlags) {
|
||||
this->registerChild(std::move(child1), SkSL::SampleUsage::PassThrough()); this->registerChild(std::move(child2), SkSL::SampleUsage::PassThrough()); }
|
||||
this->registerChild(std::move(child1), SkSL::SampleUsage::PassThrough());
|
||||
this->registerChild(std::move(child2), SkSL::SampleUsage::PassThrough());
|
||||
}
|
||||
std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override;
|
||||
void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
|
||||
bool onIsEqual(const GrFragmentProcessor&) const override;
|
||||
|
@ -23,7 +23,9 @@ public:
|
||||
private:
|
||||
GrChildProcessorsWithInput(std::unique_ptr<GrFragmentProcessor> child1, std::unique_ptr<GrFragmentProcessor> child2)
|
||||
: INHERITED(kGrChildProcessorsWithInput_ClassID, kNone_OptimizationFlags) {
|
||||
this->registerChild(std::move(child1), SkSL::SampleUsage::PassThrough()); this->registerChild(std::move(child2), SkSL::SampleUsage::PassThrough()); }
|
||||
this->registerChild(std::move(child1), SkSL::SampleUsage::PassThrough());
|
||||
this->registerChild(std::move(child2), SkSL::SampleUsage::PassThrough());
|
||||
}
|
||||
std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override;
|
||||
void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
|
||||
bool onIsEqual(const GrFragmentProcessor&) const override;
|
||||
|
@ -23,7 +23,8 @@ public:
|
||||
private:
|
||||
GrNestedCall(std::unique_ptr<GrFragmentProcessor> fp)
|
||||
: INHERITED(kGrNestedCall_ClassID, kNone_OptimizationFlags) {
|
||||
this->registerChild(std::move(fp), SkSL::SampleUsage::PassThrough()); }
|
||||
this->registerChild(std::move(fp), SkSL::SampleUsage::PassThrough());
|
||||
}
|
||||
std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override;
|
||||
void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
|
||||
bool onIsEqual(const GrFragmentProcessor&) const override;
|
||||
|
@ -23,7 +23,9 @@ public:
|
||||
private:
|
||||
GrNestedChildProcessors(std::unique_ptr<GrFragmentProcessor> child1, std::unique_ptr<GrFragmentProcessor> child2)
|
||||
: INHERITED(kGrNestedChildProcessors_ClassID, kNone_OptimizationFlags) {
|
||||
this->registerChild(std::move(child1), SkSL::SampleUsage::PassThrough()); this->registerChild(std::move(child2), SkSL::SampleUsage::PassThrough()); }
|
||||
this->registerChild(std::move(child1), SkSL::SampleUsage::PassThrough());
|
||||
this->registerChild(std::move(child2), SkSL::SampleUsage::PassThrough());
|
||||
}
|
||||
std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override;
|
||||
void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
|
||||
bool onIsEqual(const GrFragmentProcessor&) const override;
|
||||
|
Loading…
Reference in New Issue
Block a user