Make GrGLSLFragmentProcessors be created as std::unique_ptr.
Rename factory function from createGLSLInstance() to makeProgramImpl()
Bug: b/180759848
Bug: skia:11358
Change-Id: I095bdf1f26db5a8192fa8ab59000db4a1d561d96
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/373738
Reviewed-by: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
diff --git a/gm/dsl_processor_test.cpp b/gm/dsl_processor_test.cpp
index dbe9f3f..fca992e 100644
--- a/gm/dsl_processor_test.cpp
+++ b/gm/dsl_processor_test.cpp
@@ -27,7 +27,7 @@
bool onIsEqual(const GrFragmentProcessor& that) const override { return this == &that; }
std::unique_ptr<GrFragmentProcessor> clone() const override { return nullptr; }
- GrGLSLFragmentProcessor* onCreateGLSLInstance() const override {
+ std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override {
class Impl : public GrGLSLFragmentProcessor {
void emitCode(EmitArgs& args) override {
using namespace SkSL::dsl;
@@ -47,7 +47,7 @@
GrGLSLProgramDataManager::UniformHandle fBlueAlphaUniform;
};
- return new Impl;
+ return std::make_unique<Impl>();
}
};
diff --git a/gm/fp_sample_chaining.cpp b/gm/fp_sample_chaining.cpp
index 689aec9..b16e9a9 100644
--- a/gm/fp_sample_chaining.cpp
+++ b/gm/fp_sample_chaining.cpp
@@ -34,14 +34,14 @@
bool onIsEqual(const GrFragmentProcessor& that) const override { return this == &that; }
std::unique_ptr<GrFragmentProcessor> clone() const override { return nullptr; }
- GrGLSLFragmentProcessor* onCreateGLSLInstance() const override {
+ std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override {
class Impl : public GrGLSLFragmentProcessor {
void emitCode(EmitArgs& args) override {
SkString sample = this->invokeChildWithMatrix(0, args);
args.fFragBuilder->codeAppendf("return %s;\n", sample.c_str());
}
};
- return new Impl;
+ return std::make_unique<Impl>();
}
};
@@ -61,7 +61,7 @@
bool onIsEqual(const GrFragmentProcessor& that) const override { return this == &that; }
std::unique_ptr<GrFragmentProcessor> clone() const override { return nullptr; }
- GrGLSLFragmentProcessor* onCreateGLSLInstance() const override {
+ std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override {
class Impl : public GrGLSLFragmentProcessor {
void emitCode(EmitArgs& args) override {
fMatrixVar = args.fUniformHandler->addUniform(&args.fFp, kFragment_GrShaderFlag,
@@ -75,7 +75,7 @@
}
UniformHandle fMatrixVar;
};
- return new Impl;
+ return std::make_unique<Impl>();
}
};
@@ -97,7 +97,7 @@
bool onIsEqual(const GrFragmentProcessor& that) const override { return this == &that; }
std::unique_ptr<GrFragmentProcessor> clone() const override { return nullptr; }
- GrGLSLFragmentProcessor* onCreateGLSLInstance() const override {
+ std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override {
class Impl : public GrGLSLFragmentProcessor {
void emitCode(EmitArgs& args) override {
SkString sample = this->invokeChildWithMatrix(
@@ -105,7 +105,7 @@
args.fFragBuilder->codeAppendf("return %s;\n", sample.c_str());
}
};
- return new Impl;
+ return std::make_unique<Impl>();
}
};
@@ -126,7 +126,7 @@
bool onIsEqual(const GrFragmentProcessor& that) const override { return this == &that; }
std::unique_ptr<GrFragmentProcessor> clone() const override { return nullptr; }
- GrGLSLFragmentProcessor* onCreateGLSLInstance() const override {
+ std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override {
class Impl : public GrGLSLFragmentProcessor {
void emitCode(EmitArgs& args) override {
args.fFragBuilder->codeAppendf("float2 coord = %s + float2(0, 8);",
@@ -135,7 +135,7 @@
args.fFragBuilder->codeAppendf("return %s;\n", sample.c_str());
}
};
- return new Impl;
+ return std::make_unique<Impl>();
}
};
@@ -153,7 +153,7 @@
bool onIsEqual(const GrFragmentProcessor& that) const override { return this == &that; }
std::unique_ptr<GrFragmentProcessor> clone() const override { return nullptr; }
- GrGLSLFragmentProcessor* onCreateGLSLInstance() const override {
+ std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override {
class Impl : public GrGLSLFragmentProcessor {
void emitCode(EmitArgs& args) override {
auto fb = args.fFragBuilder;
@@ -162,7 +162,7 @@
fb->codeAppendf("return half2(coord).rg01;\n");
}
};
- return new Impl;
+ return std::make_unique<Impl>();
}
};
diff --git a/gm/fpcoordinateoverride.cpp b/gm/fpcoordinateoverride.cpp
index ac7ab20..e86d2e7 100644
--- a/gm/fpcoordinateoverride.cpp
+++ b/gm/fpcoordinateoverride.cpp
@@ -54,7 +54,7 @@
}
private:
- GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
+ std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override;
using INHERITED = GrFragmentProcessor;
};
@@ -67,8 +67,8 @@
}
};
-GrGLSLFragmentProcessor* SampleCoordEffect::onCreateGLSLInstance() const {
- return new GLSLSampleCoordEffect();
+std::unique_ptr<GrGLSLFragmentProcessor> SampleCoordEffect::onMakeProgramImpl() const {
+ return std::make_unique<GLSLSampleCoordEffect>();
}
DEF_SIMPLE_GPU_GM_BG(fpcoordinateoverride, ctx, rtCtx, canvas, 512, 512,
diff --git a/gm/sample_matrix_constant.cpp b/gm/sample_matrix_constant.cpp
index ae8d1fb..d0ed839 100644
--- a/gm/sample_matrix_constant.cpp
+++ b/gm/sample_matrix_constant.cpp
@@ -38,7 +38,7 @@
bool onIsEqual(const GrFragmentProcessor& that) const override { return this == &that; }
private:
- GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
+ std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override;
using INHERITED = GrFragmentProcessor;
};
@@ -50,8 +50,8 @@
}
};
-GrGLSLFragmentProcessor* SampleMatrixConstantEffect::onCreateGLSLInstance() const {
- return new GLSLSampleMatrixConstantEffect();
+std::unique_ptr<GrGLSLFragmentProcessor> SampleMatrixConstantEffect::onMakeProgramImpl() const {
+ return std::make_unique<GLSLSampleMatrixConstantEffect>();
}
DEF_SIMPLE_GPU_GM(sample_matrix_constant, ctx, rtCtx, canvas, 1024, 256) {
diff --git a/gm/sample_matrix_variable.cpp b/gm/sample_matrix_variable.cpp
index 9f3af57..7397c83 100644
--- a/gm/sample_matrix_variable.cpp
+++ b/gm/sample_matrix_variable.cpp
@@ -38,7 +38,7 @@
bool onIsEqual(const GrFragmentProcessor& that) const override { return this == &that; }
private:
- GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
+ std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override;
float fXOffset;
float fYOffset;
@@ -61,8 +61,8 @@
}
};
-GrGLSLFragmentProcessor* SampleMatrixVariableEffect::onCreateGLSLInstance() const {
- return new GLSLSampleMatrixVariableEffect();
+std::unique_ptr<GrGLSLFragmentProcessor> SampleMatrixVariableEffect::onMakeProgramImpl() const {
+ return std::make_unique<GLSLSampleMatrixVariableEffect>();
}
DEF_SIMPLE_GPU_GM(sample_matrix_variable, ctx, rtCtx, canvas, 512, 256) {
diff --git a/samplecode/SampleCCPRGeometry.cpp b/samplecode/SampleCCPRGeometry.cpp
index 59c6581..c5cc09d 100644
--- a/samplecode/SampleCCPRGeometry.cpp
+++ b/samplecode/SampleCCPRGeometry.cpp
@@ -148,7 +148,9 @@
}
};
- GrGLSLFragmentProcessor* onCreateGLSLInstance() const override { return new Impl; }
+ std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override {
+ return std::make_unique<Impl>();
+ }
};
void CCPRGeometryView::onDrawContent(SkCanvas* canvas) {
diff --git a/src/effects/SkTableColorFilter.cpp b/src/effects/SkTableColorFilter.cpp
index db30147..b2428ba 100644
--- a/src/effects/SkTableColorFilter.cpp
+++ b/src/effects/SkTableColorFilter.cpp
@@ -273,7 +273,7 @@
static constexpr int kInputFPIndex = 1;
private:
- GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
+ std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override;
void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override {}
@@ -302,7 +302,7 @@
this->cloneAndRegisterAllChildProcessors(that);
}
-GrGLSLFragmentProcessor* ColorTableEffect::onCreateGLSLInstance() const {
+std::unique_ptr<GrGLSLFragmentProcessor> ColorTableEffect::onMakeProgramImpl() const {
class Impl : public GrGLSLFragmentProcessor {
public:
void emitCode(EmitArgs& args) override {
@@ -319,7 +319,7 @@
inputColor.c_str(), r.c_str(), g.c_str(), b.c_str(), a.c_str());
}
};
- return new Impl;
+ return std::make_unique<Impl>();
}
std::unique_ptr<GrFragmentProcessor> ColorTableEffect::Make(
diff --git a/src/effects/imagefilters/SkDisplacementMapImageFilter.cpp b/src/effects/imagefilters/SkDisplacementMapImageFilter.cpp
index 4531f17..2d2765e 100644
--- a/src/effects/imagefilters/SkDisplacementMapImageFilter.cpp
+++ b/src/effects/imagefilters/SkDisplacementMapImageFilter.cpp
@@ -176,7 +176,7 @@
explicit GrDisplacementMapEffect(const GrDisplacementMapEffect&);
- GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
+ std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override;
void onGetGLSLProcessorKey(const GrShaderCaps& caps, GrProcessorKeyBuilder* b) const override;
@@ -452,8 +452,8 @@
std::move(colorEffect)));
}
-GrGLSLFragmentProcessor* GrDisplacementMapEffect::onCreateGLSLInstance() const {
- return new Impl();
+std::unique_ptr<GrGLSLFragmentProcessor> GrDisplacementMapEffect::onMakeProgramImpl() const {
+ return std::make_unique<Impl>();
}
void GrDisplacementMapEffect::onGetGLSLProcessorKey(const GrShaderCaps& caps,
diff --git a/src/effects/imagefilters/SkLightingImageFilter.cpp b/src/effects/imagefilters/SkLightingImageFilter.cpp
index e768e7f..3487dab 100644
--- a/src/effects/imagefilters/SkLightingImageFilter.cpp
+++ b/src/effects/imagefilters/SkLightingImageFilter.cpp
@@ -664,7 +664,7 @@
SkScalar kd() const { return fKD; }
private:
- GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
+ std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override;
void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
@@ -709,7 +709,7 @@
return std::unique_ptr<GrFragmentProcessor>(new GrSpecularLightingEffect(*this));
}
- GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
+ std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override;
SkScalar ks() const { return fKS; }
SkScalar shininess() const { return fShininess; }
@@ -1681,8 +1681,8 @@
GrGLDiffuseLightingEffect::GenKey(*this, caps, b);
}
-GrGLSLFragmentProcessor* GrDiffuseLightingEffect::onCreateGLSLInstance() const {
- return new GrGLDiffuseLightingEffect;
+std::unique_ptr<GrGLSLFragmentProcessor> GrDiffuseLightingEffect::onMakeProgramImpl() const {
+ return std::make_unique<GrGLDiffuseLightingEffect>();
}
GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrDiffuseLightingEffect);
@@ -1906,8 +1906,8 @@
GrGLSpecularLightingEffect::GenKey(*this, caps, b);
}
-GrGLSLFragmentProcessor* GrSpecularLightingEffect::onCreateGLSLInstance() const {
- return new GrGLSpecularLightingEffect;
+std::unique_ptr<GrGLSLFragmentProcessor> GrSpecularLightingEffect::onMakeProgramImpl() const {
+ return std::make_unique<GrGLSpecularLightingEffect>();
}
GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrSpecularLightingEffect);
diff --git a/src/effects/imagefilters/SkMorphologyImageFilter.cpp b/src/effects/imagefilters/SkMorphologyImageFilter.cpp
index 466b5b0..c769ed6 100644
--- a/src/effects/imagefilters/SkMorphologyImageFilter.cpp
+++ b/src/effects/imagefilters/SkMorphologyImageFilter.cpp
@@ -210,7 +210,7 @@
bool fUseRange;
float fRange[2];
- GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
+ std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override;
void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
@@ -225,7 +225,7 @@
using INHERITED = GrFragmentProcessor;
};
-GrGLSLFragmentProcessor* GrMorphologyEffect::onCreateGLSLInstance() const {
+std::unique_ptr<GrGLSLFragmentProcessor> GrMorphologyEffect::onMakeProgramImpl() const {
class Impl : public GrGLSLFragmentProcessor {
public:
void emitCode(EmitArgs& args) override {
@@ -288,7 +288,7 @@
private:
GrGLSLProgramDataManager::UniformHandle fRangeUni;
};
- return new Impl;
+ return std::make_unique<Impl>();
}
void GrMorphologyEffect::onGetGLSLProcessorKey(const GrShaderCaps& caps,
diff --git a/src/gpu/GrColorSpaceXform.cpp b/src/gpu/GrColorSpaceXform.cpp
index 8ab4363..a7ebc05 100644
--- a/src/gpu/GrColorSpaceXform.cpp
+++ b/src/gpu/GrColorSpaceXform.cpp
@@ -120,8 +120,8 @@
b->add32(GrColorSpaceXform::XformKey(fColorXform.get()));
}
-GrGLSLFragmentProcessor* GrColorSpaceXformEffect::onCreateGLSLInstance() const {
- return new GrGLColorSpaceXformEffect();
+std::unique_ptr<GrGLSLFragmentProcessor> GrColorSpaceXformEffect::onMakeProgramImpl() const {
+ return std::make_unique<GrGLColorSpaceXformEffect>();
}
GrFragmentProcessor::OptimizationFlags GrColorSpaceXformEffect::OptFlags(
diff --git a/src/gpu/GrColorSpaceXform.h b/src/gpu/GrColorSpaceXform.h
index 35ae91c..0dbc51e 100644
--- a/src/gpu/GrColorSpaceXform.h
+++ b/src/gpu/GrColorSpaceXform.h
@@ -95,7 +95,7 @@
static OptimizationFlags OptFlags(const GrFragmentProcessor* child);
SkPMColor4f constantOutputForConstantInput(const SkPMColor4f& input) const override;
- GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
+ std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override;
void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
bool onIsEqual(const GrFragmentProcessor&) const override;
diff --git a/src/gpu/GrFragmentProcessor.cpp b/src/gpu/GrFragmentProcessor.cpp
index 8443e61..b2b24e1 100644
--- a/src/gpu/GrFragmentProcessor.cpp
+++ b/src/gpu/GrFragmentProcessor.cpp
@@ -99,12 +99,13 @@
}
#endif
-GrGLSLFragmentProcessor* GrFragmentProcessor::createGLSLInstance() const {
- GrGLSLFragmentProcessor* glFragProc = this->onCreateGLSLInstance();
+std::unique_ptr<GrGLSLFragmentProcessor> GrFragmentProcessor::makeProgramImpl() const {
+ std::unique_ptr<GrGLSLFragmentProcessor> glFragProc = this->onMakeProgramImpl();
glFragProc->fChildProcessors.push_back_n(fChildProcessors.count());
for (int i = 0; i < fChildProcessors.count(); ++i) {
- glFragProc->fChildProcessors[i] =
- fChildProcessors[i] ? fChildProcessors[i]->createGLSLInstance() : nullptr;
+ glFragProc->fChildProcessors[i] = fChildProcessors[i]
+ ? fChildProcessors[i]->makeProgramImpl()
+ : nullptr;
}
return glFragProc;
}
@@ -279,7 +280,7 @@
this->registerChild(std::move(fp));
}
- GrGLSLFragmentProcessor* onCreateGLSLInstance() const override {
+ std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override {
class GLFP : public GrGLSLFragmentProcessor {
public:
void emitCode(EmitArgs& args) override {
@@ -293,7 +294,7 @@
childColor.c_str(), swizzle.asString().c_str());
}
};
- return new GLFP;
+ return std::make_unique<GLFP>();
}
void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder* b) const override {
@@ -345,7 +346,7 @@
this->registerChild(std::move(processor));
}
- GrGLSLFragmentProcessor* onCreateGLSLInstance() const override {
+ std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override {
class GLFP : public GrGLSLFragmentProcessor {
public:
void emitCode(EmitArgs& args) override {
@@ -356,7 +357,7 @@
fragBuilder->codeAppendf("return color * %s.a;", args.fInputColor);
}
};
- return new GLFP;
+ return std::make_unique<GLFP>();
}
void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override {}
@@ -418,7 +419,7 @@
}
private:
- GrGLSLFragmentProcessor* onCreateGLSLInstance() const override {
+ std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override {
class GLFP : public GrGLSLFragmentProcessor {
public:
void emitCode(EmitArgs& args) override {
@@ -427,7 +428,7 @@
args.fFragBuilder->codeAppendf("return %s;", result.c_str());
}
};
- return new GLFP;
+ return std::make_unique<GLFP>();
}
ComposeProcessor(std::unique_ptr<GrFragmentProcessor> f,
diff --git a/src/gpu/GrFragmentProcessor.h b/src/gpu/GrFragmentProcessor.h
index 57ba38d..9079ca8 100644
--- a/src/gpu/GrFragmentProcessor.h
+++ b/src/gpu/GrFragmentProcessor.h
@@ -116,7 +116,7 @@
// The FP this was registered with as a child function. This will be null if this is a root.
const GrFragmentProcessor* parent() const { return fParent; }
- GrGLSLFragmentProcessor* createGLSLInstance() const;
+ std::unique_ptr<GrGLSLFragmentProcessor> makeProgramImpl() const;
void getGLSLProcessorKey(const GrShaderCaps& caps, GrProcessorKeyBuilder* b) const {
this->onGetGLSLProcessorKey(caps, b);
@@ -391,7 +391,7 @@
/** Returns a new instance of the appropriate *GL* implementation class
for the given GrFragmentProcessor; caller is responsible for deleting
the object. */
- virtual GrGLSLFragmentProcessor* onCreateGLSLInstance() const = 0;
+ virtual std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const = 0;
/** Implemented using GLFragmentProcessor::GenKey as described in this class's comment. */
virtual void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const = 0;
diff --git a/src/gpu/ccpr/GrCCClipProcessor.cpp b/src/gpu/ccpr/GrCCClipProcessor.cpp
index 5dbe89e..80d4211 100644
--- a/src/gpu/ccpr/GrCCClipProcessor.cpp
+++ b/src/gpu/ccpr/GrCCClipProcessor.cpp
@@ -136,6 +136,6 @@
UniformHandle fAtlasTranslateUniform;
};
-GrGLSLFragmentProcessor* GrCCClipProcessor::onCreateGLSLInstance() const {
- return new Impl();
+std::unique_ptr<GrGLSLFragmentProcessor> GrCCClipProcessor::onMakeProgramImpl() const {
+ return std::make_unique<Impl>();
}
diff --git a/src/gpu/ccpr/GrCCClipProcessor.h b/src/gpu/ccpr/GrCCClipProcessor.h
index cb28f34..427abb5 100644
--- a/src/gpu/ccpr/GrCCClipProcessor.h
+++ b/src/gpu/ccpr/GrCCClipProcessor.h
@@ -31,7 +31,7 @@
std::unique_ptr<GrFragmentProcessor> clone() const override;
void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
bool onIsEqual(const GrFragmentProcessor&) const override;
- GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
+ std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override;
private:
explicit GrCCClipProcessor(const GrCCClipProcessor&);
diff --git a/src/gpu/effects/GrBicubicEffect.cpp b/src/gpu/effects/GrBicubicEffect.cpp
index 1edb49d..ef9abd2 100644
--- a/src/gpu/effects/GrBicubicEffect.cpp
+++ b/src/gpu/effects/GrBicubicEffect.cpp
@@ -225,7 +225,9 @@
b->add32(key);
}
-GrGLSLFragmentProcessor* GrBicubicEffect::onCreateGLSLInstance() const { return new Impl(); }
+std::unique_ptr<GrGLSLFragmentProcessor> GrBicubicEffect::onMakeProgramImpl() const {
+ return std::make_unique<Impl>();
+}
bool GrBicubicEffect::onIsEqual(const GrFragmentProcessor& other) const {
const auto& that = other.cast<GrBicubicEffect>();
diff --git a/src/gpu/effects/GrBicubicEffect.h b/src/gpu/effects/GrBicubicEffect.h
index e2704a2..79b6c67 100644
--- a/src/gpu/effects/GrBicubicEffect.h
+++ b/src/gpu/effects/GrBicubicEffect.h
@@ -112,7 +112,7 @@
explicit GrBicubicEffect(const GrBicubicEffect&);
- GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
+ std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override;
void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
diff --git a/src/gpu/effects/GrBlendFragmentProcessor.cpp b/src/gpu/effects/GrBlendFragmentProcessor.cpp
index 714a777..bb57dd1 100644
--- a/src/gpu/effects/GrBlendFragmentProcessor.cpp
+++ b/src/gpu/effects/GrBlendFragmentProcessor.cpp
@@ -211,7 +211,7 @@
}
}
- GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
+ std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override;
SkBlendMode fMode;
BlendBehavior fBlendBehavior;
@@ -260,8 +260,8 @@
return std::unique_ptr<GrFragmentProcessor>(new BlendFragmentProcessor(*this));
}
-GrGLSLFragmentProcessor* BlendFragmentProcessor::onCreateGLSLInstance() const{
- return new GLBlendFragmentProcessor;
+std::unique_ptr<GrGLSLFragmentProcessor> BlendFragmentProcessor::onMakeProgramImpl() const {
+ return std::make_unique<GLBlendFragmentProcessor>();
}
/////////////////////////////////////////////////////////////////////
diff --git a/src/gpu/effects/GrConvexPolyEffect.cpp b/src/gpu/effects/GrConvexPolyEffect.cpp
index a8f5ca0..6c37efc 100644
--- a/src/gpu/effects/GrConvexPolyEffect.cpp
+++ b/src/gpu/effects/GrConvexPolyEffect.cpp
@@ -169,8 +169,8 @@
GrGLConvexPolyEffect::GenKey(*this, caps, b);
}
-GrGLSLFragmentProcessor* GrConvexPolyEffect::onCreateGLSLInstance() const {
- return new GrGLConvexPolyEffect;
+std::unique_ptr<GrGLSLFragmentProcessor> GrConvexPolyEffect::onMakeProgramImpl() const {
+ return std::make_unique<GrGLConvexPolyEffect>();
}
GrConvexPolyEffect::GrConvexPolyEffect(std::unique_ptr<GrFragmentProcessor> inputFP,
diff --git a/src/gpu/effects/GrConvexPolyEffect.h b/src/gpu/effects/GrConvexPolyEffect.h
index e5c24c6..4a938b2 100644
--- a/src/gpu/effects/GrConvexPolyEffect.h
+++ b/src/gpu/effects/GrConvexPolyEffect.h
@@ -74,7 +74,7 @@
int n, const SkScalar edges[]);
GrConvexPolyEffect(const GrConvexPolyEffect&);
- GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
+ std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override;
void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
diff --git a/src/gpu/effects/GrGaussianConvolutionFragmentProcessor.cpp b/src/gpu/effects/GrGaussianConvolutionFragmentProcessor.cpp
index 3e0191c..a9c33f4 100644
--- a/src/gpu/effects/GrGaussianConvolutionFragmentProcessor.cpp
+++ b/src/gpu/effects/GrGaussianConvolutionFragmentProcessor.cpp
@@ -164,8 +164,9 @@
Impl::GenKey(*this, caps, b);
}
-GrGLSLFragmentProcessor* GrGaussianConvolutionFragmentProcessor::onCreateGLSLInstance() const {
- return new Impl;
+std::unique_ptr<GrGLSLFragmentProcessor>
+GrGaussianConvolutionFragmentProcessor::onMakeProgramImpl() const {
+ return std::make_unique<Impl>();
}
bool GrGaussianConvolutionFragmentProcessor::onIsEqual(const GrFragmentProcessor& sBase) const {
diff --git a/src/gpu/effects/GrGaussianConvolutionFragmentProcessor.h b/src/gpu/effects/GrGaussianConvolutionFragmentProcessor.h
index 3556102..dc86fde 100644
--- a/src/gpu/effects/GrGaussianConvolutionFragmentProcessor.h
+++ b/src/gpu/effects/GrGaussianConvolutionFragmentProcessor.h
@@ -66,7 +66,7 @@
}
#endif
- GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
+ std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override;
void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
diff --git a/src/gpu/effects/GrMatrixConvolutionEffect.cpp b/src/gpu/effects/GrMatrixConvolutionEffect.cpp
index d4cc5a4..6063235 100644
--- a/src/gpu/effects/GrMatrixConvolutionEffect.cpp
+++ b/src/gpu/effects/GrMatrixConvolutionEffect.cpp
@@ -322,8 +322,8 @@
GrGLMatrixConvolutionEffect::GenKey(*this, caps, b);
}
-GrGLSLFragmentProcessor* GrMatrixConvolutionEffect::onCreateGLSLInstance() const {
- return new GrGLMatrixConvolutionEffect;
+std::unique_ptr<GrGLSLFragmentProcessor> GrMatrixConvolutionEffect::onMakeProgramImpl() const {
+ return std::make_unique<GrGLMatrixConvolutionEffect>();
}
bool GrMatrixConvolutionEffect::onIsEqual(const GrFragmentProcessor& sBase) const {
diff --git a/src/gpu/effects/GrMatrixConvolutionEffect.h b/src/gpu/effects/GrMatrixConvolutionEffect.h
index 3a1b733..b42225f 100644
--- a/src/gpu/effects/GrMatrixConvolutionEffect.h
+++ b/src/gpu/effects/GrMatrixConvolutionEffect.h
@@ -110,7 +110,7 @@
explicit GrMatrixConvolutionEffect(const GrMatrixConvolutionEffect&);
- GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
+ std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override;
void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
diff --git a/src/gpu/effects/GrMatrixEffect.cpp b/src/gpu/effects/GrMatrixEffect.cpp
index cfd0fd4..2ff4604 100644
--- a/src/gpu/effects/GrMatrixEffect.cpp
+++ b/src/gpu/effects/GrMatrixEffect.cpp
@@ -35,8 +35,8 @@
UniformHandle fMatrixVar;
};
-GrGLSLFragmentProcessor* GrMatrixEffect::onCreateGLSLInstance() const {
- return new GrGLSLMatrixEffect();
+std::unique_ptr<GrGLSLFragmentProcessor> GrMatrixEffect::onMakeProgramImpl() const {
+ return std::make_unique<GrGLSLMatrixEffect>();
}
void GrMatrixEffect::onGetGLSLProcessorKey(const GrShaderCaps& caps,
diff --git a/src/gpu/effects/GrMatrixEffect.h b/src/gpu/effects/GrMatrixEffect.h
index 42e3bb4..5d82750 100644
--- a/src/gpu/effects/GrMatrixEffect.h
+++ b/src/gpu/effects/GrMatrixEffect.h
@@ -38,7 +38,7 @@
SkSL::SampleUsage::UniformMatrix("matrix", matrix.hasPerspective()));
}
- GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
+ std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override;
void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
bool onIsEqual(const GrFragmentProcessor&) const override;
SkPMColor4f constantOutputForConstantInput(const SkPMColor4f& inputColor) const override {
diff --git a/src/gpu/effects/GrRRectEffect.cpp b/src/gpu/effects/GrRRectEffect.cpp
index 90492ac..e3d37bdc 100644
--- a/src/gpu/effects/GrRRectEffect.cpp
+++ b/src/gpu/effects/GrRRectEffect.cpp
@@ -65,7 +65,7 @@
GrClipEdgeType, uint32_t circularCornerFlags, const SkRRect&);
CircularRRectEffect(const CircularRRectEffect& that);
- GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
+ std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override;
void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
@@ -395,8 +395,8 @@
GLCircularRRectEffect::GenKey(*this, caps, b);
}
-GrGLSLFragmentProcessor* CircularRRectEffect::onCreateGLSLInstance() const {
- return new GLCircularRRectEffect;
+std::unique_ptr<GrGLSLFragmentProcessor> CircularRRectEffect::onMakeProgramImpl() const {
+ return std::make_unique<GLCircularRRectEffect>();
}
//////////////////////////////////////////////////////////////////////////////
@@ -419,7 +419,7 @@
EllipticalRRectEffect(std::unique_ptr<GrFragmentProcessor>, GrClipEdgeType, const SkRRect&);
EllipticalRRectEffect(const EllipticalRRectEffect& that);
- GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
+ std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override;
void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
@@ -701,8 +701,8 @@
GLEllipticalRRectEffect::GenKey(*this, caps, b);
}
-GrGLSLFragmentProcessor* EllipticalRRectEffect::onCreateGLSLInstance() const {
- return new GLEllipticalRRectEffect;
+std::unique_ptr<GrGLSLFragmentProcessor> EllipticalRRectEffect::onMakeProgramImpl() const {
+ return std::make_unique<GLEllipticalRRectEffect>();
}
//////////////////////////////////////////////////////////////////////////////
diff --git a/src/gpu/effects/GrSkSLFP.cpp b/src/gpu/effects/GrSkSLFP.cpp
index e5b9e24..9d4e472 100644
--- a/src/gpu/effects/GrSkSLFP.cpp
+++ b/src/gpu/effects/GrSkSLFP.cpp
@@ -208,8 +208,8 @@
this->registerChild(std::move(child), fEffect->fSampleUsages[childIndex]);
}
-GrGLSLFragmentProcessor* GrSkSLFP::onCreateGLSLInstance() const {
- return new GrGLSLSkSLFP();
+std::unique_ptr<GrGLSLFragmentProcessor> GrSkSLFP::onMakeProgramImpl() const {
+ return std::make_unique<GrGLSLSkSLFP>();
}
void GrSkSLFP::onGetGLSLProcessorKey(const GrShaderCaps& caps, GrProcessorKeyBuilder* b) const {
diff --git a/src/gpu/effects/GrSkSLFP.h b/src/gpu/effects/GrSkSLFP.h
index 4fea256..5b4dd54 100644
--- a/src/gpu/effects/GrSkSLFP.h
+++ b/src/gpu/effects/GrSkSLFP.h
@@ -44,7 +44,7 @@
GrSkSLFP(const GrSkSLFP& other);
- GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
+ std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override;
void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
diff --git a/src/gpu/effects/GrTextureEffect.cpp b/src/gpu/effects/GrTextureEffect.cpp
index 9a00d21..8303346 100644
--- a/src/gpu/effects/GrTextureEffect.cpp
+++ b/src/gpu/effects/GrTextureEffect.cpp
@@ -759,7 +759,9 @@
}
}
-GrGLSLFragmentProcessor* GrTextureEffect::onCreateGLSLInstance() const { return new Impl; }
+std::unique_ptr<GrGLSLFragmentProcessor> GrTextureEffect::onMakeProgramImpl() const {
+ return std::make_unique<Impl>();
+}
void GrTextureEffect::onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder* b) const {
auto m0 = static_cast<uint32_t>(fShaderModes[0]);
diff --git a/src/gpu/effects/GrTextureEffect.h b/src/gpu/effects/GrTextureEffect.h
index 1e75093..26d3743 100644
--- a/src/gpu/effects/GrTextureEffect.h
+++ b/src/gpu/effects/GrTextureEffect.h
@@ -153,7 +153,7 @@
explicit GrTextureEffect(const GrTextureEffect& src);
- GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
+ std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override;
void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
diff --git a/src/gpu/effects/GrYUVtoRGBEffect.cpp b/src/gpu/effects/GrYUVtoRGBEffect.cpp
index 45361d4..025d06b 100644
--- a/src/gpu/effects/GrYUVtoRGBEffect.cpp
+++ b/src/gpu/effects/GrYUVtoRGBEffect.cpp
@@ -219,7 +219,7 @@
}
#endif
-GrGLSLFragmentProcessor* GrYUVtoRGBEffect::onCreateGLSLInstance() const {
+std::unique_ptr<GrGLSLFragmentProcessor> GrYUVtoRGBEffect::onMakeProgramImpl() const {
class GrGLSLYUVtoRGBEffect : public GrGLSLFragmentProcessor {
public:
GrGLSLYUVtoRGBEffect() {}
@@ -270,7 +270,6 @@
args.fUniformHandler->getUniformCStr(fColorSpaceMatrixVar),
args.fUniformHandler->getUniformCStr(fColorSpaceTranslateVar));
}
-
if (hasAlpha) {
// premultiply alpha
fragBuilder->codeAppendf("color.rgb *= color.a;");
@@ -308,7 +307,7 @@
UniformHandle fColorSpaceTranslateVar;
};
- return new GrGLSLYUVtoRGBEffect;
+ return std::make_unique<GrGLSLYUVtoRGBEffect>();
}
void GrYUVtoRGBEffect::onGetGLSLProcessorKey(const GrShaderCaps& caps,
GrProcessorKeyBuilder* b) const {
diff --git a/src/gpu/effects/GrYUVtoRGBEffect.h b/src/gpu/effects/GrYUVtoRGBEffect.h
index 92a8bf3..e0acfb0 100644
--- a/src/gpu/effects/GrYUVtoRGBEffect.h
+++ b/src/gpu/effects/GrYUVtoRGBEffect.h
@@ -39,7 +39,7 @@
SkString onDumpInfo() const override;
#endif
- GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
+ std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override;
void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
diff --git a/src/gpu/effects/generated/GrAARectEffect.cpp b/src/gpu/effects/generated/GrAARectEffect.cpp
index 2c2ff04..28dc0f5 100644
--- a/src/gpu/effects/generated/GrAARectEffect.cpp
+++ b/src/gpu/effects/generated/GrAARectEffect.cpp
@@ -88,8 +88,8 @@
SkRect prevRect = float4(0);
UniformHandle rectUniformVar;
};
-GrGLSLFragmentProcessor* GrAARectEffect::onCreateGLSLInstance() const {
- return new GrGLSLAARectEffect();
+std::unique_ptr<GrGLSLFragmentProcessor> GrAARectEffect::onMakeProgramImpl() const {
+ return std::make_unique<GrGLSLAARectEffect>();
}
void GrAARectEffect::onGetGLSLProcessorKey(const GrShaderCaps& caps,
GrProcessorKeyBuilder* b) const {
diff --git a/src/gpu/effects/generated/GrAARectEffect.h b/src/gpu/effects/generated/GrAARectEffect.h
index 52c8f80..333c348 100644
--- a/src/gpu/effects/generated/GrAARectEffect.h
+++ b/src/gpu/effects/generated/GrAARectEffect.h
@@ -42,7 +42,7 @@
, rect(rect) {
this->registerChild(std::move(inputFP), SkSL::SampleUsage::PassThrough());
}
- GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
+ std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override;
void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
bool onIsEqual(const GrFragmentProcessor&) const override;
#if GR_TEST_UTILS
diff --git a/src/gpu/effects/generated/GrAlphaThresholdFragmentProcessor.cpp b/src/gpu/effects/generated/GrAlphaThresholdFragmentProcessor.cpp
index db3c01f..cc12f08 100644
--- a/src/gpu/effects/generated/GrAlphaThresholdFragmentProcessor.cpp
+++ b/src/gpu/effects/generated/GrAlphaThresholdFragmentProcessor.cpp
@@ -74,8 +74,9 @@
UniformHandle innerThresholdVar;
UniformHandle outerThresholdVar;
};
-GrGLSLFragmentProcessor* GrAlphaThresholdFragmentProcessor::onCreateGLSLInstance() const {
- return new GrGLSLAlphaThresholdFragmentProcessor();
+std::unique_ptr<GrGLSLFragmentProcessor> GrAlphaThresholdFragmentProcessor::onMakeProgramImpl()
+ const {
+ return std::make_unique<GrGLSLAlphaThresholdFragmentProcessor>();
}
void GrAlphaThresholdFragmentProcessor::onGetGLSLProcessorKey(const GrShaderCaps& caps,
GrProcessorKeyBuilder* b) const {}
diff --git a/src/gpu/effects/generated/GrAlphaThresholdFragmentProcessor.h b/src/gpu/effects/generated/GrAlphaThresholdFragmentProcessor.h
index 08d9312..c80c55d 100644
--- a/src/gpu/effects/generated/GrAlphaThresholdFragmentProcessor.h
+++ b/src/gpu/effects/generated/GrAlphaThresholdFragmentProcessor.h
@@ -46,7 +46,7 @@
this->registerChild(std::move(inputFP), SkSL::SampleUsage::PassThrough());
this->registerChild(std::move(maskFP), SkSL::SampleUsage::PassThrough());
}
- GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
+ std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override;
void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
bool onIsEqual(const GrFragmentProcessor&) const override;
#if GR_TEST_UTILS
diff --git a/src/gpu/effects/generated/GrArithmeticProcessor.cpp b/src/gpu/effects/generated/GrArithmeticProcessor.cpp
index b0425dc..0b5d73e 100644
--- a/src/gpu/effects/generated/GrArithmeticProcessor.cpp
+++ b/src/gpu/effects/generated/GrArithmeticProcessor.cpp
@@ -58,8 +58,8 @@
}
UniformHandle kVar;
};
-GrGLSLFragmentProcessor* GrArithmeticProcessor::onCreateGLSLInstance() const {
- return new GrGLSLArithmeticProcessor();
+std::unique_ptr<GrGLSLFragmentProcessor> GrArithmeticProcessor::onMakeProgramImpl() const {
+ return std::make_unique<GrGLSLArithmeticProcessor>();
}
void GrArithmeticProcessor::onGetGLSLProcessorKey(const GrShaderCaps& caps,
GrProcessorKeyBuilder* b) const {
diff --git a/src/gpu/effects/generated/GrArithmeticProcessor.h b/src/gpu/effects/generated/GrArithmeticProcessor.h
index 096ed99..2404e60 100644
--- a/src/gpu/effects/generated/GrArithmeticProcessor.h
+++ b/src/gpu/effects/generated/GrArithmeticProcessor.h
@@ -42,7 +42,7 @@
this->registerChild(std::move(srcFP), SkSL::SampleUsage::PassThrough());
this->registerChild(std::move(dstFP), SkSL::SampleUsage::PassThrough());
}
- GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
+ std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override;
void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
bool onIsEqual(const GrFragmentProcessor&) const override;
#if GR_TEST_UTILS
diff --git a/src/gpu/effects/generated/GrBlurredEdgeFragmentProcessor.cpp b/src/gpu/effects/generated/GrBlurredEdgeFragmentProcessor.cpp
index cb3cbad..6cb5b13 100644
--- a/src/gpu/effects/generated/GrBlurredEdgeFragmentProcessor.cpp
+++ b/src/gpu/effects/generated/GrBlurredEdgeFragmentProcessor.cpp
@@ -48,8 +48,8 @@
void onSetData(const GrGLSLProgramDataManager& pdman,
const GrFragmentProcessor& _proc) override {}
};
-GrGLSLFragmentProcessor* GrBlurredEdgeFragmentProcessor::onCreateGLSLInstance() const {
- return new GrGLSLBlurredEdgeFragmentProcessor();
+std::unique_ptr<GrGLSLFragmentProcessor> GrBlurredEdgeFragmentProcessor::onMakeProgramImpl() const {
+ return std::make_unique<GrGLSLBlurredEdgeFragmentProcessor>();
}
void GrBlurredEdgeFragmentProcessor::onGetGLSLProcessorKey(const GrShaderCaps& caps,
GrProcessorKeyBuilder* b) const {
diff --git a/src/gpu/effects/generated/GrBlurredEdgeFragmentProcessor.h b/src/gpu/effects/generated/GrBlurredEdgeFragmentProcessor.h
index e1337ef..b29cb45 100644
--- a/src/gpu/effects/generated/GrBlurredEdgeFragmentProcessor.h
+++ b/src/gpu/effects/generated/GrBlurredEdgeFragmentProcessor.h
@@ -35,7 +35,7 @@
, mode(mode) {
this->registerChild(std::move(inputFP), SkSL::SampleUsage::PassThrough());
}
- GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
+ std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override;
void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
bool onIsEqual(const GrFragmentProcessor&) const override;
#if GR_TEST_UTILS
diff --git a/src/gpu/effects/generated/GrCircleBlurFragmentProcessor.cpp b/src/gpu/effects/generated/GrCircleBlurFragmentProcessor.cpp
index b6246b8..74aee08 100644
--- a/src/gpu/effects/generated/GrCircleBlurFragmentProcessor.cpp
+++ b/src/gpu/effects/generated/GrCircleBlurFragmentProcessor.cpp
@@ -344,8 +344,8 @@
}
UniformHandle circleDataVar;
};
-GrGLSLFragmentProcessor* GrCircleBlurFragmentProcessor::onCreateGLSLInstance() const {
- return new GrGLSLCircleBlurFragmentProcessor();
+std::unique_ptr<GrGLSLFragmentProcessor> GrCircleBlurFragmentProcessor::onMakeProgramImpl() const {
+ return std::make_unique<GrGLSLCircleBlurFragmentProcessor>();
}
void GrCircleBlurFragmentProcessor::onGetGLSLProcessorKey(const GrShaderCaps& caps,
GrProcessorKeyBuilder* b) const {}
diff --git a/src/gpu/effects/generated/GrCircleBlurFragmentProcessor.h b/src/gpu/effects/generated/GrCircleBlurFragmentProcessor.h
index f16f560..01c35cf 100644
--- a/src/gpu/effects/generated/GrCircleBlurFragmentProcessor.h
+++ b/src/gpu/effects/generated/GrCircleBlurFragmentProcessor.h
@@ -47,7 +47,7 @@
this->registerChild(std::move(inputFP), SkSL::SampleUsage::PassThrough());
this->registerChild(std::move(blurProfile), SkSL::SampleUsage::Explicit());
}
- GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
+ std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override;
void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
bool onIsEqual(const GrFragmentProcessor&) const override;
#if GR_TEST_UTILS
diff --git a/src/gpu/effects/generated/GrCircleEffect.cpp b/src/gpu/effects/generated/GrCircleEffect.cpp
index 6d3f653..e6f2af9 100644
--- a/src/gpu/effects/generated/GrCircleEffect.cpp
+++ b/src/gpu/effects/generated/GrCircleEffect.cpp
@@ -95,8 +95,8 @@
float prevRadius = 0;
UniformHandle circleVar;
};
-GrGLSLFragmentProcessor* GrCircleEffect::onCreateGLSLInstance() const {
- return new GrGLSLCircleEffect();
+std::unique_ptr<GrGLSLFragmentProcessor> GrCircleEffect::onMakeProgramImpl() const {
+ return std::make_unique<GrGLSLCircleEffect>();
}
void GrCircleEffect::onGetGLSLProcessorKey(const GrShaderCaps& caps,
GrProcessorKeyBuilder* b) const {
diff --git a/src/gpu/effects/generated/GrCircleEffect.h b/src/gpu/effects/generated/GrCircleEffect.h
index d80371e..ccb6d6f 100644
--- a/src/gpu/effects/generated/GrCircleEffect.h
+++ b/src/gpu/effects/generated/GrCircleEffect.h
@@ -51,7 +51,7 @@
, radius(radius) {
this->registerChild(std::move(inputFP), SkSL::SampleUsage::PassThrough());
}
- GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
+ std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override;
void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
bool onIsEqual(const GrFragmentProcessor&) const override;
#if GR_TEST_UTILS
diff --git a/src/gpu/effects/generated/GrClampFragmentProcessor.cpp b/src/gpu/effects/generated/GrClampFragmentProcessor.cpp
index 816fe4f..2cbe47a 100644
--- a/src/gpu/effects/generated/GrClampFragmentProcessor.cpp
+++ b/src/gpu/effects/generated/GrClampFragmentProcessor.cpp
@@ -45,8 +45,8 @@
void onSetData(const GrGLSLProgramDataManager& pdman,
const GrFragmentProcessor& _proc) override {}
};
-GrGLSLFragmentProcessor* GrClampFragmentProcessor::onCreateGLSLInstance() const {
- return new GrGLSLClampFragmentProcessor();
+std::unique_ptr<GrGLSLFragmentProcessor> GrClampFragmentProcessor::onMakeProgramImpl() const {
+ return std::make_unique<GrGLSLClampFragmentProcessor>();
}
void GrClampFragmentProcessor::onGetGLSLProcessorKey(const GrShaderCaps& caps,
GrProcessorKeyBuilder* b) const {
diff --git a/src/gpu/effects/generated/GrClampFragmentProcessor.h b/src/gpu/effects/generated/GrClampFragmentProcessor.h
index c7ffece..ddbfa11 100644
--- a/src/gpu/effects/generated/GrClampFragmentProcessor.h
+++ b/src/gpu/effects/generated/GrClampFragmentProcessor.h
@@ -45,7 +45,7 @@
, clampToPremul(clampToPremul) {
this->registerChild(std::move(inputFP), SkSL::SampleUsage::PassThrough());
}
- GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
+ std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override;
void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
bool onIsEqual(const GrFragmentProcessor&) const override;
#if GR_TEST_UTILS
diff --git a/src/gpu/effects/generated/GrColorMatrixFragmentProcessor.cpp b/src/gpu/effects/generated/GrColorMatrixFragmentProcessor.cpp
index 74b9a98..327fcec 100644
--- a/src/gpu/effects/generated/GrColorMatrixFragmentProcessor.cpp
+++ b/src/gpu/effects/generated/GrColorMatrixFragmentProcessor.cpp
@@ -87,8 +87,8 @@
UniformHandle mVar;
UniformHandle vVar;
};
-GrGLSLFragmentProcessor* GrColorMatrixFragmentProcessor::onCreateGLSLInstance() const {
- return new GrGLSLColorMatrixFragmentProcessor();
+std::unique_ptr<GrGLSLFragmentProcessor> GrColorMatrixFragmentProcessor::onMakeProgramImpl() const {
+ return std::make_unique<GrGLSLColorMatrixFragmentProcessor>();
}
void GrColorMatrixFragmentProcessor::onGetGLSLProcessorKey(const GrShaderCaps& caps,
GrProcessorKeyBuilder* b) const {
diff --git a/src/gpu/effects/generated/GrColorMatrixFragmentProcessor.h b/src/gpu/effects/generated/GrColorMatrixFragmentProcessor.h
index 56439ce..d62f65a 100644
--- a/src/gpu/effects/generated/GrColorMatrixFragmentProcessor.h
+++ b/src/gpu/effects/generated/GrColorMatrixFragmentProcessor.h
@@ -83,7 +83,7 @@
, premulOutput(premulOutput) {
this->registerChild(std::move(inputFP), SkSL::SampleUsage::PassThrough());
}
- GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
+ std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override;
void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
bool onIsEqual(const GrFragmentProcessor&) const override;
#if GR_TEST_UTILS
diff --git a/src/gpu/effects/generated/GrComposeLerpEffect.cpp b/src/gpu/effects/generated/GrComposeLerpEffect.cpp
index 57e7b9e..229916a 100644
--- a/src/gpu/effects/generated/GrComposeLerpEffect.cpp
+++ b/src/gpu/effects/generated/GrComposeLerpEffect.cpp
@@ -45,8 +45,8 @@
}
UniformHandle weightVar;
};
-GrGLSLFragmentProcessor* GrComposeLerpEffect::onCreateGLSLInstance() const {
- return new GrGLSLComposeLerpEffect();
+std::unique_ptr<GrGLSLFragmentProcessor> GrComposeLerpEffect::onMakeProgramImpl() const {
+ return std::make_unique<GrGLSLComposeLerpEffect>();
}
void GrComposeLerpEffect::onGetGLSLProcessorKey(const GrShaderCaps& caps,
GrProcessorKeyBuilder* b) const {}
diff --git a/src/gpu/effects/generated/GrComposeLerpEffect.h b/src/gpu/effects/generated/GrComposeLerpEffect.h
index ee6b4b4..5e44e1a 100644
--- a/src/gpu/effects/generated/GrComposeLerpEffect.h
+++ b/src/gpu/effects/generated/GrComposeLerpEffect.h
@@ -37,7 +37,7 @@
this->registerChild(std::move(child1), SkSL::SampleUsage::PassThrough());
this->registerChild(std::move(child2), SkSL::SampleUsage::PassThrough());
}
- GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
+ std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override;
void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
bool onIsEqual(const GrFragmentProcessor&) const override;
#if GR_TEST_UTILS
diff --git a/src/gpu/effects/generated/GrConfigConversionEffect.cpp b/src/gpu/effects/generated/GrConfigConversionEffect.cpp
index a2ed323..9278808 100644
--- a/src/gpu/effects/generated/GrConfigConversionEffect.cpp
+++ b/src/gpu/effects/generated/GrConfigConversionEffect.cpp
@@ -48,8 +48,8 @@
void onSetData(const GrGLSLProgramDataManager& pdman,
const GrFragmentProcessor& _proc) override {}
};
-GrGLSLFragmentProcessor* GrConfigConversionEffect::onCreateGLSLInstance() const {
- return new GrGLSLConfigConversionEffect();
+std::unique_ptr<GrGLSLFragmentProcessor> GrConfigConversionEffect::onMakeProgramImpl() const {
+ return std::make_unique<GrGLSLConfigConversionEffect>();
}
void GrConfigConversionEffect::onGetGLSLProcessorKey(const GrShaderCaps& caps,
GrProcessorKeyBuilder* b) const {
diff --git a/src/gpu/effects/generated/GrConfigConversionEffect.h b/src/gpu/effects/generated/GrConfigConversionEffect.h
index a845b20..d8e0c0e 100644
--- a/src/gpu/effects/generated/GrConfigConversionEffect.h
+++ b/src/gpu/effects/generated/GrConfigConversionEffect.h
@@ -46,7 +46,7 @@
, pmConversion(pmConversion) {
this->registerChild(std::move(inputFP), SkSL::SampleUsage::PassThrough());
}
- GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
+ std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override;
void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
bool onIsEqual(const GrFragmentProcessor&) const override;
#if GR_TEST_UTILS
diff --git a/src/gpu/effects/generated/GrConstColorProcessor.cpp b/src/gpu/effects/generated/GrConstColorProcessor.cpp
index 93fbf7a..ca12e2f 100644
--- a/src/gpu/effects/generated/GrConstColorProcessor.cpp
+++ b/src/gpu/effects/generated/GrConstColorProcessor.cpp
@@ -49,8 +49,8 @@
SkPMColor4f colorPrev = {SK_FloatNaN, SK_FloatNaN, SK_FloatNaN, SK_FloatNaN};
UniformHandle colorVar;
};
-GrGLSLFragmentProcessor* GrConstColorProcessor::onCreateGLSLInstance() const {
- return new GrGLSLConstColorProcessor();
+std::unique_ptr<GrGLSLFragmentProcessor> GrConstColorProcessor::onMakeProgramImpl() const {
+ return std::make_unique<GrGLSLConstColorProcessor>();
}
void GrConstColorProcessor::onGetGLSLProcessorKey(const GrShaderCaps& caps,
GrProcessorKeyBuilder* b) const {}
diff --git a/src/gpu/effects/generated/GrConstColorProcessor.h b/src/gpu/effects/generated/GrConstColorProcessor.h
index 66a1ef0..79f5e8e 100644
--- a/src/gpu/effects/generated/GrConstColorProcessor.h
+++ b/src/gpu/effects/generated/GrConstColorProcessor.h
@@ -37,7 +37,7 @@
(color.isOpaque() ? kPreservesOpaqueInput_OptimizationFlag
: kNone_OptimizationFlags)))
, color(color) {}
- GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
+ std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override;
void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
bool onIsEqual(const GrFragmentProcessor&) const override;
#if GR_TEST_UTILS
diff --git a/src/gpu/effects/generated/GrDeviceSpaceEffect.cpp b/src/gpu/effects/generated/GrDeviceSpaceEffect.cpp
index b5fe5db..e3974ed 100644
--- a/src/gpu/effects/generated/GrDeviceSpaceEffect.cpp
+++ b/src/gpu/effects/generated/GrDeviceSpaceEffect.cpp
@@ -36,8 +36,8 @@
void onSetData(const GrGLSLProgramDataManager& pdman,
const GrFragmentProcessor& _proc) override {}
};
-GrGLSLFragmentProcessor* GrDeviceSpaceEffect::onCreateGLSLInstance() const {
- return new GrGLSLDeviceSpaceEffect();
+std::unique_ptr<GrGLSLFragmentProcessor> GrDeviceSpaceEffect::onMakeProgramImpl() const {
+ return std::make_unique<GrGLSLDeviceSpaceEffect>();
}
void GrDeviceSpaceEffect::onGetGLSLProcessorKey(const GrShaderCaps& caps,
GrProcessorKeyBuilder* b) const {}
diff --git a/src/gpu/effects/generated/GrDeviceSpaceEffect.h b/src/gpu/effects/generated/GrDeviceSpaceEffect.h
index 3dab36f..f262493 100644
--- a/src/gpu/effects/generated/GrDeviceSpaceEffect.h
+++ b/src/gpu/effects/generated/GrDeviceSpaceEffect.h
@@ -35,7 +35,7 @@
(OptimizationFlags)ProcessorOptimizationFlags(fp.get())) {
this->registerChild(std::move(fp), SkSL::SampleUsage::Explicit());
}
- GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
+ std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override;
void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
bool onIsEqual(const GrFragmentProcessor&) const override;
#if GR_TEST_UTILS
diff --git a/src/gpu/effects/generated/GrDitherEffect.cpp b/src/gpu/effects/generated/GrDitherEffect.cpp
index 991e6ab..8a83bfb 100644
--- a/src/gpu/effects/generated/GrDitherEffect.cpp
+++ b/src/gpu/effects/generated/GrDitherEffect.cpp
@@ -56,8 +56,8 @@
}
UniformHandle rangeVar;
};
-GrGLSLFragmentProcessor* GrDitherEffect::onCreateGLSLInstance() const {
- return new GrGLSLDitherEffect();
+std::unique_ptr<GrGLSLFragmentProcessor> GrDitherEffect::onMakeProgramImpl() const {
+ return std::make_unique<GrGLSLDitherEffect>();
}
void GrDitherEffect::onGetGLSLProcessorKey(const GrShaderCaps& caps,
GrProcessorKeyBuilder* b) const {}
diff --git a/src/gpu/effects/generated/GrDitherEffect.h b/src/gpu/effects/generated/GrDitherEffect.h
index 63f0566..9ecc837 100644
--- a/src/gpu/effects/generated/GrDitherEffect.h
+++ b/src/gpu/effects/generated/GrDitherEffect.h
@@ -39,7 +39,7 @@
, range(range) {
this->registerChild(std::move(inputFP), SkSL::SampleUsage::PassThrough());
}
- GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
+ std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override;
void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
bool onIsEqual(const GrFragmentProcessor&) const override;
#if GR_TEST_UTILS
diff --git a/src/gpu/effects/generated/GrEllipseEffect.cpp b/src/gpu/effects/generated/GrEllipseEffect.cpp
index facbf66..961da12 100644
--- a/src/gpu/effects/generated/GrEllipseEffect.cpp
+++ b/src/gpu/effects/generated/GrEllipseEffect.cpp
@@ -135,8 +135,8 @@
UniformHandle ellipseVar;
UniformHandle scaleVar;
};
-GrGLSLFragmentProcessor* GrEllipseEffect::onCreateGLSLInstance() const {
- return new GrGLSLEllipseEffect();
+std::unique_ptr<GrGLSLFragmentProcessor> GrEllipseEffect::onMakeProgramImpl() const {
+ return std::make_unique<GrGLSLEllipseEffect>();
}
void GrEllipseEffect::onGetGLSLProcessorKey(const GrShaderCaps& caps,
GrProcessorKeyBuilder* b) const {
diff --git a/src/gpu/effects/generated/GrEllipseEffect.h b/src/gpu/effects/generated/GrEllipseEffect.h
index 91c1746..e9bb641 100644
--- a/src/gpu/effects/generated/GrEllipseEffect.h
+++ b/src/gpu/effects/generated/GrEllipseEffect.h
@@ -61,7 +61,7 @@
, radii(radii) {
this->registerChild(std::move(inputFP), SkSL::SampleUsage::PassThrough());
}
- GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
+ std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override;
void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
bool onIsEqual(const GrFragmentProcessor&) const override;
#if GR_TEST_UTILS
diff --git a/src/gpu/effects/generated/GrHSLToRGBFilterEffect.cpp b/src/gpu/effects/generated/GrHSLToRGBFilterEffect.cpp
index 1ea753d..6316223 100644
--- a/src/gpu/effects/generated/GrHSLToRGBFilterEffect.cpp
+++ b/src/gpu/effects/generated/GrHSLToRGBFilterEffect.cpp
@@ -43,8 +43,8 @@
void onSetData(const GrGLSLProgramDataManager& pdman,
const GrFragmentProcessor& _proc) override {}
};
-GrGLSLFragmentProcessor* GrHSLToRGBFilterEffect::onCreateGLSLInstance() const {
- return new GrGLSLHSLToRGBFilterEffect();
+std::unique_ptr<GrGLSLFragmentProcessor> GrHSLToRGBFilterEffect::onMakeProgramImpl() const {
+ return std::make_unique<GrGLSLHSLToRGBFilterEffect>();
}
void GrHSLToRGBFilterEffect::onGetGLSLProcessorKey(const GrShaderCaps& caps,
GrProcessorKeyBuilder* b) const {}
diff --git a/src/gpu/effects/generated/GrHSLToRGBFilterEffect.h b/src/gpu/effects/generated/GrHSLToRGBFilterEffect.h
index b8362c8..68ed2a1 100644
--- a/src/gpu/effects/generated/GrHSLToRGBFilterEffect.h
+++ b/src/gpu/effects/generated/GrHSLToRGBFilterEffect.h
@@ -48,7 +48,7 @@
kPreservesOpaqueInput_OptimizationFlag)) {
this->registerChild(std::move(inputFP), SkSL::SampleUsage::PassThrough());
}
- GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
+ std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override;
void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
bool onIsEqual(const GrFragmentProcessor&) const override;
#if GR_TEST_UTILS
diff --git a/src/gpu/effects/generated/GrMagnifierEffect.cpp b/src/gpu/effects/generated/GrMagnifierEffect.cpp
index 84e7e03..e5bf371 100644
--- a/src/gpu/effects/generated/GrMagnifierEffect.cpp
+++ b/src/gpu/effects/generated/GrMagnifierEffect.cpp
@@ -117,8 +117,8 @@
UniformHandle xInvInsetVar;
UniformHandle yInvInsetVar;
};
-GrGLSLFragmentProcessor* GrMagnifierEffect::onCreateGLSLInstance() const {
- return new GrGLSLMagnifierEffect();
+std::unique_ptr<GrGLSLFragmentProcessor> GrMagnifierEffect::onMakeProgramImpl() const {
+ return std::make_unique<GrGLSLMagnifierEffect>();
}
void GrMagnifierEffect::onGetGLSLProcessorKey(const GrShaderCaps& caps,
GrProcessorKeyBuilder* b) const {}
diff --git a/src/gpu/effects/generated/GrMagnifierEffect.h b/src/gpu/effects/generated/GrMagnifierEffect.h
index 30313f5..20b72e4 100644
--- a/src/gpu/effects/generated/GrMagnifierEffect.h
+++ b/src/gpu/effects/generated/GrMagnifierEffect.h
@@ -56,7 +56,7 @@
this->setUsesSampleCoordsDirectly();
this->registerChild(std::move(src), SkSL::SampleUsage::Explicit());
}
- GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
+ std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override;
void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
bool onIsEqual(const GrFragmentProcessor&) const override;
#if GR_TEST_UTILS
diff --git a/src/gpu/effects/generated/GrOverrideInputFragmentProcessor.cpp b/src/gpu/effects/generated/GrOverrideInputFragmentProcessor.cpp
index 9906a80..ec020f9 100644
--- a/src/gpu/effects/generated/GrOverrideInputFragmentProcessor.cpp
+++ b/src/gpu/effects/generated/GrOverrideInputFragmentProcessor.cpp
@@ -61,8 +61,9 @@
}
UniformHandle uniformColorVar;
};
-GrGLSLFragmentProcessor* GrOverrideInputFragmentProcessor::onCreateGLSLInstance() const {
- return new GrGLSLOverrideInputFragmentProcessor();
+std::unique_ptr<GrGLSLFragmentProcessor> GrOverrideInputFragmentProcessor::onMakeProgramImpl()
+ const {
+ return std::make_unique<GrGLSLOverrideInputFragmentProcessor>();
}
void GrOverrideInputFragmentProcessor::onGetGLSLProcessorKey(const GrShaderCaps& caps,
GrProcessorKeyBuilder* b) const {
diff --git a/src/gpu/effects/generated/GrOverrideInputFragmentProcessor.h b/src/gpu/effects/generated/GrOverrideInputFragmentProcessor.h
index 6486e95..5d73a2a 100644
--- a/src/gpu/effects/generated/GrOverrideInputFragmentProcessor.h
+++ b/src/gpu/effects/generated/GrOverrideInputFragmentProcessor.h
@@ -60,7 +60,7 @@
, literalColor(literalColor) {
this->registerChild(std::move(fp), SkSL::SampleUsage::PassThrough());
}
- GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
+ std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override;
void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
bool onIsEqual(const GrFragmentProcessor&) const override;
#if GR_TEST_UTILS
diff --git a/src/gpu/effects/generated/GrRGBToHSLFilterEffect.cpp b/src/gpu/effects/generated/GrRGBToHSLFilterEffect.cpp
index 637bd95..1229d78 100644
--- a/src/gpu/effects/generated/GrRGBToHSLFilterEffect.cpp
+++ b/src/gpu/effects/generated/GrRGBToHSLFilterEffect.cpp
@@ -45,8 +45,8 @@
void onSetData(const GrGLSLProgramDataManager& pdman,
const GrFragmentProcessor& _proc) override {}
};
-GrGLSLFragmentProcessor* GrRGBToHSLFilterEffect::onCreateGLSLInstance() const {
- return new GrGLSLRGBToHSLFilterEffect();
+std::unique_ptr<GrGLSLFragmentProcessor> GrRGBToHSLFilterEffect::onMakeProgramImpl() const {
+ return std::make_unique<GrGLSLRGBToHSLFilterEffect>();
}
void GrRGBToHSLFilterEffect::onGetGLSLProcessorKey(const GrShaderCaps& caps,
GrProcessorKeyBuilder* b) const {}
diff --git a/src/gpu/effects/generated/GrRGBToHSLFilterEffect.h b/src/gpu/effects/generated/GrRGBToHSLFilterEffect.h
index 7ef7390..cb61eb4 100644
--- a/src/gpu/effects/generated/GrRGBToHSLFilterEffect.h
+++ b/src/gpu/effects/generated/GrRGBToHSLFilterEffect.h
@@ -50,7 +50,7 @@
kPreservesOpaqueInput_OptimizationFlag)) {
this->registerChild(std::move(inputFP), SkSL::SampleUsage::PassThrough());
}
- GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
+ std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override;
void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
bool onIsEqual(const GrFragmentProcessor&) const override;
#if GR_TEST_UTILS
diff --git a/src/gpu/effects/generated/GrRRectBlurEffect.cpp b/src/gpu/effects/generated/GrRRectBlurEffect.cpp
index b3205c9..fd6773f 100644
--- a/src/gpu/effects/generated/GrRRectBlurEffect.cpp
+++ b/src/gpu/effects/generated/GrRRectBlurEffect.cpp
@@ -411,8 +411,8 @@
UniformHandle blurRadiusVar;
UniformHandle cornerRadiusVar;
};
-GrGLSLFragmentProcessor* GrRRectBlurEffect::onCreateGLSLInstance() const {
- return new GrGLSLRRectBlurEffect();
+std::unique_ptr<GrGLSLFragmentProcessor> GrRRectBlurEffect::onMakeProgramImpl() const {
+ return std::make_unique<GrGLSLRRectBlurEffect>();
}
void GrRRectBlurEffect::onGetGLSLProcessorKey(const GrShaderCaps& caps,
GrProcessorKeyBuilder* b) const {}
diff --git a/src/gpu/effects/generated/GrRRectBlurEffect.h b/src/gpu/effects/generated/GrRRectBlurEffect.h
index 59246b9..ed29b78 100644
--- a/src/gpu/effects/generated/GrRRectBlurEffect.h
+++ b/src/gpu/effects/generated/GrRRectBlurEffect.h
@@ -51,7 +51,7 @@
this->registerChild(std::move(inputFP), SkSL::SampleUsage::PassThrough());
this->registerChild(std::move(ninePatchFP), SkSL::SampleUsage::Explicit());
}
- GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
+ std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override;
void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
bool onIsEqual(const GrFragmentProcessor&) const override;
#if GR_TEST_UTILS
diff --git a/src/gpu/effects/generated/GrRectBlurEffect.cpp b/src/gpu/effects/generated/GrRectBlurEffect.cpp
index 31bf19b..d5d36af 100644
--- a/src/gpu/effects/generated/GrRectBlurEffect.cpp
+++ b/src/gpu/effects/generated/GrRectBlurEffect.cpp
@@ -151,8 +151,8 @@
UniformHandle rectHVar;
UniformHandle invVMVar;
};
-GrGLSLFragmentProcessor* GrRectBlurEffect::onCreateGLSLInstance() const {
- return new GrGLSLRectBlurEffect();
+std::unique_ptr<GrGLSLFragmentProcessor> GrRectBlurEffect::onMakeProgramImpl() const {
+ return std::make_unique<GrGLSLRectBlurEffect>();
}
void GrRectBlurEffect::onGetGLSLProcessorKey(const GrShaderCaps& caps,
GrProcessorKeyBuilder* b) const {
diff --git a/src/gpu/effects/generated/GrRectBlurEffect.h b/src/gpu/effects/generated/GrRectBlurEffect.h
index b0a9a3c..4fc6d52 100644
--- a/src/gpu/effects/generated/GrRectBlurEffect.h
+++ b/src/gpu/effects/generated/GrRectBlurEffect.h
@@ -175,7 +175,7 @@
this->registerChild(std::move(inputFP), SkSL::SampleUsage::PassThrough());
this->registerChild(std::move(integral), SkSL::SampleUsage::Explicit());
}
- GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
+ std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override;
void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
bool onIsEqual(const GrFragmentProcessor&) const override;
#if GR_TEST_UTILS
diff --git a/src/gpu/glsl/GrGLSLFragmentProcessor.h b/src/gpu/glsl/GrGLSLFragmentProcessor.h
index e0885fb..8914347 100644
--- a/src/gpu/glsl/GrGLSLFragmentProcessor.h
+++ b/src/gpu/glsl/GrGLSLFragmentProcessor.h
@@ -22,13 +22,9 @@
class GrGLSLFragmentProcessor {
public:
- GrGLSLFragmentProcessor() {}
+ GrGLSLFragmentProcessor() = default;
- virtual ~GrGLSLFragmentProcessor() {
- for (int i = 0; i < fChildProcessors.count(); ++i) {
- delete fChildProcessors[i];
- }
- }
+ virtual ~GrGLSLFragmentProcessor() = default;
using UniformHandle = GrGLSLUniformHandler::UniformHandle;
using SamplerHandle = GrGLSLUniformHandler::SamplerHandle;
@@ -131,7 +127,9 @@
int numChildProcessors() const { return fChildProcessors.count(); }
- GrGLSLFragmentProcessor* childProcessor(int index) const { return fChildProcessors[index]; }
+ GrGLSLFragmentProcessor* childProcessor(int index) const {
+ return fChildProcessors[index].get();
+ }
void emitChildFunction(int childIndex, EmitArgs& parentArgs);
@@ -247,7 +245,7 @@
// one per child; either not present or empty string if not yet emitted
SkTArray<SkString> fFunctionNames;
- SkTArray<GrGLSLFragmentProcessor*, true> fChildProcessors;
+ SkTArray<std::unique_ptr<GrGLSLFragmentProcessor>, true> fChildProcessors;
friend class GrFragmentProcessor;
};
diff --git a/src/gpu/glsl/GrGLSLProgramBuilder.cpp b/src/gpu/glsl/GrGLSLProgramBuilder.cpp
index 271bdd7..91e691d 100644
--- a/src/gpu/glsl/GrGLSLProgramBuilder.cpp
+++ b/src/gpu/glsl/GrGLSLProgramBuilder.cpp
@@ -137,7 +137,7 @@
SkString* inOut = this->pipeline().isColorFragmentProcessor(i) ? color : coverage;
SkString output;
const GrFragmentProcessor& fp = this->pipeline().getFragmentProcessor(i);
- fFragmentProcessors[i] = std::unique_ptr<GrGLSLFragmentProcessor>(fp.createGLSLInstance());
+ fFragmentProcessors[i] = fp.makeProgramImpl();
output = this->emitFragProc(fp, *fFragmentProcessors[i], transformedCoordVarsIdx, *inOut,
output);
for (const auto& subFP : GrFragmentProcessor::FPRange(fp)) {
diff --git a/src/gpu/gradients/generated/GrClampedGradientEffect.cpp b/src/gpu/gradients/generated/GrClampedGradientEffect.cpp
index 7230426..872513c 100644
--- a/src/gpu/gradients/generated/GrClampedGradientEffect.cpp
+++ b/src/gpu/gradients/generated/GrClampedGradientEffect.cpp
@@ -87,8 +87,8 @@
UniformHandle leftBorderColorVar;
UniformHandle rightBorderColorVar;
};
-GrGLSLFragmentProcessor* GrClampedGradientEffect::onCreateGLSLInstance() const {
- return new GrGLSLClampedGradientEffect();
+std::unique_ptr<GrGLSLFragmentProcessor> GrClampedGradientEffect::onMakeProgramImpl() const {
+ return std::make_unique<GrGLSLClampedGradientEffect>();
}
void GrClampedGradientEffect::onGetGLSLProcessorKey(const GrShaderCaps& caps,
GrProcessorKeyBuilder* b) const {
diff --git a/src/gpu/gradients/generated/GrClampedGradientEffect.h b/src/gpu/gradients/generated/GrClampedGradientEffect.h
index 99694de..5beef16 100644
--- a/src/gpu/gradients/generated/GrClampedGradientEffect.h
+++ b/src/gpu/gradients/generated/GrClampedGradientEffect.h
@@ -56,7 +56,7 @@
this->registerChild(std::move(colorizer), SkSL::SampleUsage::Explicit());
this->registerChild(std::move(gradLayout), SkSL::SampleUsage::PassThrough());
}
- GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
+ std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override;
void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
bool onIsEqual(const GrFragmentProcessor&) const override;
#if GR_TEST_UTILS
diff --git a/src/gpu/gradients/generated/GrDualIntervalGradientColorizer.cpp b/src/gpu/gradients/generated/GrDualIntervalGradientColorizer.cpp
index 09a43b2..a2a8a94 100644
--- a/src/gpu/gradients/generated/GrDualIntervalGradientColorizer.cpp
+++ b/src/gpu/gradients/generated/GrDualIntervalGradientColorizer.cpp
@@ -110,8 +110,9 @@
UniformHandle bias23Var;
UniformHandle thresholdVar;
};
-GrGLSLFragmentProcessor* GrDualIntervalGradientColorizer::onCreateGLSLInstance() const {
- return new GrGLSLDualIntervalGradientColorizer();
+std::unique_ptr<GrGLSLFragmentProcessor> GrDualIntervalGradientColorizer::onMakeProgramImpl()
+ const {
+ return std::make_unique<GrGLSLDualIntervalGradientColorizer>();
}
void GrDualIntervalGradientColorizer::onGetGLSLProcessorKey(const GrShaderCaps& caps,
GrProcessorKeyBuilder* b) const {}
diff --git a/src/gpu/gradients/generated/GrDualIntervalGradientColorizer.h b/src/gpu/gradients/generated/GrDualIntervalGradientColorizer.h
index cc4f9ed..068a045 100644
--- a/src/gpu/gradients/generated/GrDualIntervalGradientColorizer.h
+++ b/src/gpu/gradients/generated/GrDualIntervalGradientColorizer.h
@@ -46,7 +46,7 @@
, threshold(threshold) {
this->setUsesSampleCoordsDirectly();
}
- GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
+ std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override;
void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
bool onIsEqual(const GrFragmentProcessor&) const override;
#if GR_TEST_UTILS
diff --git a/src/gpu/gradients/generated/GrLinearGradientLayout.cpp b/src/gpu/gradients/generated/GrLinearGradientLayout.cpp
index 8d83ebb..cc31c05 100644
--- a/src/gpu/gradients/generated/GrLinearGradientLayout.cpp
+++ b/src/gpu/gradients/generated/GrLinearGradientLayout.cpp
@@ -35,8 +35,8 @@
void onSetData(const GrGLSLProgramDataManager& pdman,
const GrFragmentProcessor& _proc) override {}
};
-GrGLSLFragmentProcessor* GrLinearGradientLayout::onCreateGLSLInstance() const {
- return new GrGLSLLinearGradientLayout();
+std::unique_ptr<GrGLSLFragmentProcessor> GrLinearGradientLayout::onMakeProgramImpl() const {
+ return std::make_unique<GrGLSLLinearGradientLayout>();
}
void GrLinearGradientLayout::onGetGLSLProcessorKey(const GrShaderCaps& caps,
GrProcessorKeyBuilder* b) const {}
diff --git a/src/gpu/gradients/generated/GrLinearGradientLayout.h b/src/gpu/gradients/generated/GrLinearGradientLayout.h
index b8cb488..092d560 100644
--- a/src/gpu/gradients/generated/GrLinearGradientLayout.h
+++ b/src/gpu/gradients/generated/GrLinearGradientLayout.h
@@ -34,7 +34,7 @@
(OptimizationFlags)kPreservesOpaqueInput_OptimizationFlag) {
this->setUsesSampleCoordsDirectly();
}
- GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
+ std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override;
void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
bool onIsEqual(const GrFragmentProcessor&) const override;
#if GR_TEST_UTILS
diff --git a/src/gpu/gradients/generated/GrRadialGradientLayout.cpp b/src/gpu/gradients/generated/GrRadialGradientLayout.cpp
index 3c9b627..24a287f 100644
--- a/src/gpu/gradients/generated/GrRadialGradientLayout.cpp
+++ b/src/gpu/gradients/generated/GrRadialGradientLayout.cpp
@@ -35,8 +35,8 @@
void onSetData(const GrGLSLProgramDataManager& pdman,
const GrFragmentProcessor& _proc) override {}
};
-GrGLSLFragmentProcessor* GrRadialGradientLayout::onCreateGLSLInstance() const {
- return new GrGLSLRadialGradientLayout();
+std::unique_ptr<GrGLSLFragmentProcessor> GrRadialGradientLayout::onMakeProgramImpl() const {
+ return std::make_unique<GrGLSLRadialGradientLayout>();
}
void GrRadialGradientLayout::onGetGLSLProcessorKey(const GrShaderCaps& caps,
GrProcessorKeyBuilder* b) const {}
diff --git a/src/gpu/gradients/generated/GrRadialGradientLayout.h b/src/gpu/gradients/generated/GrRadialGradientLayout.h
index 30b32b6..31c6f6c 100644
--- a/src/gpu/gradients/generated/GrRadialGradientLayout.h
+++ b/src/gpu/gradients/generated/GrRadialGradientLayout.h
@@ -34,7 +34,7 @@
(OptimizationFlags)kPreservesOpaqueInput_OptimizationFlag) {
this->setUsesSampleCoordsDirectly();
}
- GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
+ std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override;
void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
bool onIsEqual(const GrFragmentProcessor&) const override;
#if GR_TEST_UTILS
diff --git a/src/gpu/gradients/generated/GrSingleIntervalGradientColorizer.cpp b/src/gpu/gradients/generated/GrSingleIntervalGradientColorizer.cpp
index 47870af..0cb199b 100644
--- a/src/gpu/gradients/generated/GrSingleIntervalGradientColorizer.cpp
+++ b/src/gpu/gradients/generated/GrSingleIntervalGradientColorizer.cpp
@@ -64,8 +64,9 @@
UniformHandle startVar;
UniformHandle endVar;
};
-GrGLSLFragmentProcessor* GrSingleIntervalGradientColorizer::onCreateGLSLInstance() const {
- return new GrGLSLSingleIntervalGradientColorizer();
+std::unique_ptr<GrGLSLFragmentProcessor> GrSingleIntervalGradientColorizer::onMakeProgramImpl()
+ const {
+ return std::make_unique<GrGLSLSingleIntervalGradientColorizer>();
}
void GrSingleIntervalGradientColorizer::onGetGLSLProcessorKey(const GrShaderCaps& caps,
GrProcessorKeyBuilder* b) const {}
diff --git a/src/gpu/gradients/generated/GrSingleIntervalGradientColorizer.h b/src/gpu/gradients/generated/GrSingleIntervalGradientColorizer.h
index 4d86fb2..89cef95 100644
--- a/src/gpu/gradients/generated/GrSingleIntervalGradientColorizer.h
+++ b/src/gpu/gradients/generated/GrSingleIntervalGradientColorizer.h
@@ -35,7 +35,7 @@
, end(end) {
this->setUsesSampleCoordsDirectly();
}
- GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
+ std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override;
void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
bool onIsEqual(const GrFragmentProcessor&) const override;
#if GR_TEST_UTILS
diff --git a/src/gpu/gradients/generated/GrSweepGradientLayout.cpp b/src/gpu/gradients/generated/GrSweepGradientLayout.cpp
index ea4b98a..4c245af 100644
--- a/src/gpu/gradients/generated/GrSweepGradientLayout.cpp
+++ b/src/gpu/gradients/generated/GrSweepGradientLayout.cpp
@@ -64,8 +64,8 @@
UniformHandle biasVar;
UniformHandle scaleVar;
};
-GrGLSLFragmentProcessor* GrSweepGradientLayout::onCreateGLSLInstance() const {
- return new GrGLSLSweepGradientLayout();
+std::unique_ptr<GrGLSLFragmentProcessor> GrSweepGradientLayout::onMakeProgramImpl() const {
+ return std::make_unique<GrGLSLSweepGradientLayout>();
}
void GrSweepGradientLayout::onGetGLSLProcessorKey(const GrShaderCaps& caps,
GrProcessorKeyBuilder* b) const {}
diff --git a/src/gpu/gradients/generated/GrSweepGradientLayout.h b/src/gpu/gradients/generated/GrSweepGradientLayout.h
index 73a6508..9ecfc4a 100644
--- a/src/gpu/gradients/generated/GrSweepGradientLayout.h
+++ b/src/gpu/gradients/generated/GrSweepGradientLayout.h
@@ -38,7 +38,7 @@
, scale(scale) {
this->setUsesSampleCoordsDirectly();
}
- GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
+ std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override;
void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
bool onIsEqual(const GrFragmentProcessor&) const override;
#if GR_TEST_UTILS
diff --git a/src/gpu/gradients/generated/GrTiledGradientEffect.cpp b/src/gpu/gradients/generated/GrTiledGradientEffect.cpp
index 0185625..21700c2 100644
--- a/src/gpu/gradients/generated/GrTiledGradientEffect.cpp
+++ b/src/gpu/gradients/generated/GrTiledGradientEffect.cpp
@@ -73,8 +73,8 @@
void onSetData(const GrGLSLProgramDataManager& pdman,
const GrFragmentProcessor& _proc) override {}
};
-GrGLSLFragmentProcessor* GrTiledGradientEffect::onCreateGLSLInstance() const {
- return new GrGLSLTiledGradientEffect();
+std::unique_ptr<GrGLSLFragmentProcessor> GrTiledGradientEffect::onMakeProgramImpl() const {
+ return std::make_unique<GrGLSLTiledGradientEffect>();
}
void GrTiledGradientEffect::onGetGLSLProcessorKey(const GrShaderCaps& caps,
GrProcessorKeyBuilder* b) const {
diff --git a/src/gpu/gradients/generated/GrTiledGradientEffect.h b/src/gpu/gradients/generated/GrTiledGradientEffect.h
index 69ba018..2edad86 100644
--- a/src/gpu/gradients/generated/GrTiledGradientEffect.h
+++ b/src/gpu/gradients/generated/GrTiledGradientEffect.h
@@ -51,7 +51,7 @@
this->registerChild(std::move(colorizer), SkSL::SampleUsage::Explicit());
this->registerChild(std::move(gradLayout), SkSL::SampleUsage::PassThrough());
}
- GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
+ std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override;
void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
bool onIsEqual(const GrFragmentProcessor&) const override;
#if GR_TEST_UTILS
diff --git a/src/gpu/gradients/generated/GrTwoPointConicalGradientLayout.cpp b/src/gpu/gradients/generated/GrTwoPointConicalGradientLayout.cpp
index fb2bb00..42cc7c6 100644
--- a/src/gpu/gradients/generated/GrTwoPointConicalGradientLayout.cpp
+++ b/src/gpu/gradients/generated/GrTwoPointConicalGradientLayout.cpp
@@ -144,8 +144,9 @@
SkPoint focalParamsPrev = SkPoint::Make(SK_FloatNaN, SK_FloatNaN);
UniformHandle focalParamsVar;
};
-GrGLSLFragmentProcessor* GrTwoPointConicalGradientLayout::onCreateGLSLInstance() const {
- return new GrGLSLTwoPointConicalGradientLayout();
+std::unique_ptr<GrGLSLFragmentProcessor> GrTwoPointConicalGradientLayout::onMakeProgramImpl()
+ const {
+ return std::make_unique<GrGLSLTwoPointConicalGradientLayout>();
}
void GrTwoPointConicalGradientLayout::onGetGLSLProcessorKey(const GrShaderCaps& caps,
GrProcessorKeyBuilder* b) const {
diff --git a/src/gpu/gradients/generated/GrTwoPointConicalGradientLayout.h b/src/gpu/gradients/generated/GrTwoPointConicalGradientLayout.h
index 35aa727..b0d800d 100644
--- a/src/gpu/gradients/generated/GrTwoPointConicalGradientLayout.h
+++ b/src/gpu/gradients/generated/GrTwoPointConicalGradientLayout.h
@@ -56,7 +56,7 @@
, focalParams(focalParams) {
this->setUsesSampleCoordsDirectly();
}
- GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
+ std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override;
void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
bool onIsEqual(const GrFragmentProcessor&) const override;
#if GR_TEST_UTILS
diff --git a/src/gpu/gradients/generated/GrUnrolledBinaryGradientColorizer.cpp b/src/gpu/gradients/generated/GrUnrolledBinaryGradientColorizer.cpp
index adec447..2a27601 100644
--- a/src/gpu/gradients/generated/GrUnrolledBinaryGradientColorizer.cpp
+++ b/src/gpu/gradients/generated/GrUnrolledBinaryGradientColorizer.cpp
@@ -286,8 +286,9 @@
UniformHandle thresholds1_7Var;
UniformHandle thresholds9_13Var;
};
-GrGLSLFragmentProcessor* GrUnrolledBinaryGradientColorizer::onCreateGLSLInstance() const {
- return new GrGLSLUnrolledBinaryGradientColorizer();
+std::unique_ptr<GrGLSLFragmentProcessor> GrUnrolledBinaryGradientColorizer::onMakeProgramImpl()
+ const {
+ return std::make_unique<GrGLSLUnrolledBinaryGradientColorizer>();
}
void GrUnrolledBinaryGradientColorizer::onGetGLSLProcessorKey(const GrShaderCaps& caps,
GrProcessorKeyBuilder* b) const {
diff --git a/src/gpu/gradients/generated/GrUnrolledBinaryGradientColorizer.h b/src/gpu/gradients/generated/GrUnrolledBinaryGradientColorizer.h
index fad49a4..3e22d88 100644
--- a/src/gpu/gradients/generated/GrUnrolledBinaryGradientColorizer.h
+++ b/src/gpu/gradients/generated/GrUnrolledBinaryGradientColorizer.h
@@ -88,7 +88,7 @@
, thresholds9_13(thresholds9_13) {
this->setUsesSampleCoordsDirectly();
}
- GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
+ std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override;
void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
bool onIsEqual(const GrFragmentProcessor&) const override;
#if GR_TEST_UTILS
diff --git a/src/shaders/SkPerlinNoiseShader.cpp b/src/shaders/SkPerlinNoiseShader.cpp
index 73f6d0a..7601357 100644
--- a/src/shaders/SkPerlinNoiseShader.cpp
+++ b/src/shaders/SkPerlinNoiseShader.cpp
@@ -628,8 +628,8 @@
int numOctaves() const { return fNumOctaves; }
private:
- GrGLSLFragmentProcessor* onCreateGLSLInstance() const override {
- return new GrGLPerlinNoise;
+ std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override {
+ return std::make_unique<GrGLPerlinNoise>();
}
void onGetGLSLProcessorKey(const GrShaderCaps& caps, GrProcessorKeyBuilder* b) const override {
diff --git a/src/sksl/SkSLCPPCodeGenerator.cpp b/src/sksl/SkSLCPPCodeGenerator.cpp
index 1c19804..cd92597 100644
--- a/src/sksl/SkSLCPPCodeGenerator.cpp
+++ b/src/sksl/SkSLCPPCodeGenerator.cpp
@@ -1412,8 +1412,8 @@
}
}
this->writef("};\n"
- "GrGLSLFragmentProcessor* %s::onCreateGLSLInstance() const {\n"
- " return new GrGLSL%s();\n"
+ "std::unique_ptr<GrGLSLFragmentProcessor> %s::onMakeProgramImpl() const {\n"
+ " return std::make_unique<GrGLSL%s>();\n"
"}\n",
fullName, baseName);
this->writeGetKey();
diff --git a/src/sksl/SkSLHCodeGenerator.cpp b/src/sksl/SkSLHCodeGenerator.cpp
index 8d5e2e9..7f2d3d1 100644
--- a/src/sksl/SkSLHCodeGenerator.cpp
+++ b/src/sksl/SkSLHCodeGenerator.cpp
@@ -363,10 +363,11 @@
this->writeFields();
this->writef("private:\n");
this->writeConstructor();
- this->writef(" GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;\n"
- " void onGetGLSLProcessorKey(const GrShaderCaps&, "
- "GrProcessorKeyBuilder*) const override;\n"
- " bool onIsEqual(const GrFragmentProcessor&) const override;\n");
+ this->writef(
+ " std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override;\n"
+ " void onGetGLSLProcessorKey(const GrShaderCaps&, "
+ "GrProcessorKeyBuilder*) const override;\n"
+ " bool onIsEqual(const GrFragmentProcessor&) const override;\n");
for (const auto& param : fSectionAndParameterHelper.getParameters()) {
if (param->type().typeKind() == Type::TypeKind::kSampler) {
this->writef(" const TextureSampler& onTextureSampler(int) const override;");
diff --git a/tests/LazyProxyTest.cpp b/tests/LazyProxyTest.cpp
index 2bc4f3b..1b28655 100644
--- a/tests/LazyProxyTest.cpp
+++ b/tests/LazyProxyTest.cpp
@@ -155,7 +155,9 @@
std::unique_ptr<GrFragmentProcessor> clone() const override {
return std::make_unique<ClipFP>(fContext, fProxyProvider, fTest, fAtlas);
}
- GrGLSLFragmentProcessor* onCreateGLSLInstance() const override { return nullptr; }
+ std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override {
+ return nullptr;
+ }
void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override {}
bool onIsEqual(const GrFragmentProcessor&) const override { return false; }
diff --git a/tests/ProcessorTest.cpp b/tests/ProcessorTest.cpp
index f84b2fe..d903019 100644
--- a/tests/ProcessorTest.cpp
+++ b/tests/ProcessorTest.cpp
@@ -125,7 +125,7 @@
this->cloneAndRegisterAllChildProcessors(that);
}
- GrGLSLFragmentProcessor* onCreateGLSLInstance() const override {
+ std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override {
class TestGLSLFP : public GrGLSLFragmentProcessor {
public:
TestGLSLFP() {}
@@ -135,7 +135,7 @@
private:
};
- return new TestGLSLFP();
+ return std::make_unique<TestGLSLFP>();
}
bool onIsEqual(const GrFragmentProcessor&) const override { return false; }
diff --git a/tests/ProgramsTest.cpp b/tests/ProgramsTest.cpp
index e3310e2..19305f1 100644
--- a/tests/ProgramsTest.cpp
+++ b/tests/ProgramsTest.cpp
@@ -63,8 +63,8 @@
const char* name() const override { return "Big_Ole_Key"; }
- GrGLSLFragmentProcessor* onCreateGLSLInstance() const override {
- return new GLBigKeyProcessor;
+ std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override {
+ return std::make_unique<GLBigKeyProcessor>();
}
std::unique_ptr<GrFragmentProcessor> clone() const override { return Make(); }
@@ -99,7 +99,9 @@
const char* name() const override { return "Block_Input"; }
- GrGLSLFragmentProcessor* onCreateGLSLInstance() const override { return new GLFP; }
+ std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override {
+ return std::make_unique<GLFP>();
+ }
std::unique_ptr<GrFragmentProcessor> clone() const override {
return Make(this->childProcessor(0)->clone());
diff --git a/tests/SkSLCross.cpp b/tests/SkSLCross.cpp
index 4c4202d..ac77391 100644
--- a/tests/SkSLCross.cpp
+++ b/tests/SkSLCross.cpp
@@ -75,7 +75,9 @@
GrGLSLUniformHandler::UniformHandle fBUniform;
};
- GrGLSLFragmentProcessor* onCreateGLSLInstance() const override { return new Impl; }
+ std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override {
+ return std::make_unique<Impl>();
+ }
const SkVector fA, fB;
};
diff --git a/tests/sksl/errors/GrRecursion.cpp b/tests/sksl/errors/GrRecursion.cpp
index d9753a9..3e53e7f 100644
--- a/tests/sksl/errors/GrRecursion.cpp
+++ b/tests/sksl/errors/GrRecursion.cpp
@@ -34,8 +34,8 @@
void onSetData(const GrGLSLProgramDataManager& pdman, const GrFragmentProcessor& _proc) override {
}
};
-GrGLSLFragmentProcessor* GrRecursion::onCreateGLSLInstance() const {
- return new GrGLSLRecursion();
+std::unique_ptr<GrGLSLFragmentProcessor> GrRecursion::onMakeProgramImpl() const {
+ return std::make_unique<GrGLSLRecursion>();
}
void GrRecursion::onGetGLSLProcessorKey(const GrShaderCaps& caps, GrProcessorKeyBuilder* b) const {
}
diff --git a/tests/sksl/errors/GrRecursion.h b/tests/sksl/errors/GrRecursion.h
index aec42c0..907c6c2 100644
--- a/tests/sksl/errors/GrRecursion.h
+++ b/tests/sksl/errors/GrRecursion.h
@@ -24,7 +24,7 @@
GrRecursion()
: INHERITED(kGrRecursion_ClassID, kNone_OptimizationFlags) {
}
- GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
+ std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override;
void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
bool onIsEqual(const GrFragmentProcessor&) const override;
#if GR_TEST_UTILS
diff --git a/tests/sksl/fp/GrChildProcessorAndGlobal.cpp b/tests/sksl/fp/GrChildProcessorAndGlobal.cpp
index fb57b54..3bc78b7 100644
--- a/tests/sksl/fp/GrChildProcessorAndGlobal.cpp
+++ b/tests/sksl/fp/GrChildProcessorAndGlobal.cpp
@@ -39,8 +39,8 @@
}
bool hasCap = false;
};
-GrGLSLFragmentProcessor* GrChildProcessorAndGlobal::onCreateGLSLInstance() const {
- return new GrGLSLChildProcessorAndGlobal();
+std::unique_ptr<GrGLSLFragmentProcessor> GrChildProcessorAndGlobal::onMakeProgramImpl() const {
+ return std::make_unique<GrGLSLChildProcessorAndGlobal>();
}
void GrChildProcessorAndGlobal::onGetGLSLProcessorKey(const GrShaderCaps& caps, GrProcessorKeyBuilder* b) const {
}
diff --git a/tests/sksl/fp/GrChildProcessorAndGlobal.h b/tests/sksl/fp/GrChildProcessorAndGlobal.h
index 6470e2d..98d9901 100644
--- a/tests/sksl/fp/GrChildProcessorAndGlobal.h
+++ b/tests/sksl/fp/GrChildProcessorAndGlobal.h
@@ -24,7 +24,7 @@
GrChildProcessorAndGlobal(std::unique_ptr<GrFragmentProcessor> child)
: INHERITED(kGrChildProcessorAndGlobal_ClassID, kNone_OptimizationFlags) {
this->registerChild(std::move(child), SkSL::SampleUsage::PassThrough()); }
- GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
+ std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override;
void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
bool onIsEqual(const GrFragmentProcessor&) const override;
#if GR_TEST_UTILS
diff --git a/tests/sksl/fp/GrChildProcessorFieldAccess.cpp b/tests/sksl/fp/GrChildProcessorFieldAccess.cpp
index 762e8d6..b302984 100644
--- a/tests/sksl/fp/GrChildProcessorFieldAccess.cpp
+++ b/tests/sksl/fp/GrChildProcessorFieldAccess.cpp
@@ -39,8 +39,8 @@
}
bool opaque = false;
};
-GrGLSLFragmentProcessor* GrChildProcessorFieldAccess::onCreateGLSLInstance() const {
- return new GrGLSLChildProcessorFieldAccess();
+std::unique_ptr<GrGLSLFragmentProcessor> GrChildProcessorFieldAccess::onMakeProgramImpl() const {
+ return std::make_unique<GrGLSLChildProcessorFieldAccess>();
}
void GrChildProcessorFieldAccess::onGetGLSLProcessorKey(const GrShaderCaps& caps, GrProcessorKeyBuilder* b) const {
}
diff --git a/tests/sksl/fp/GrChildProcessorFieldAccess.h b/tests/sksl/fp/GrChildProcessorFieldAccess.h
index 05bb9fd..dbbfed8 100644
--- a/tests/sksl/fp/GrChildProcessorFieldAccess.h
+++ b/tests/sksl/fp/GrChildProcessorFieldAccess.h
@@ -24,7 +24,7 @@
GrChildProcessorFieldAccess(std::unique_ptr<GrFragmentProcessor> child)
: INHERITED(kGrChildProcessorFieldAccess_ClassID, kNone_OptimizationFlags) {
this->registerChild(std::move(child), SkSL::SampleUsage::PassThrough()); }
- GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
+ std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override;
void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
bool onIsEqual(const GrFragmentProcessor&) const override;
#if GR_TEST_UTILS
diff --git a/tests/sksl/fp/GrChildProcessorInlineFieldAccess.cpp b/tests/sksl/fp/GrChildProcessorInlineFieldAccess.cpp
index e174e44..50d805b 100644
--- a/tests/sksl/fp/GrChildProcessorInlineFieldAccess.cpp
+++ b/tests/sksl/fp/GrChildProcessorInlineFieldAccess.cpp
@@ -36,8 +36,8 @@
void onSetData(const GrGLSLProgramDataManager& pdman, const GrFragmentProcessor& _proc) override {
}
};
-GrGLSLFragmentProcessor* GrChildProcessorInlineFieldAccess::onCreateGLSLInstance() const {
- return new GrGLSLChildProcessorInlineFieldAccess();
+std::unique_ptr<GrGLSLFragmentProcessor> GrChildProcessorInlineFieldAccess::onMakeProgramImpl() const {
+ return std::make_unique<GrGLSLChildProcessorInlineFieldAccess>();
}
void GrChildProcessorInlineFieldAccess::onGetGLSLProcessorKey(const GrShaderCaps& caps, GrProcessorKeyBuilder* b) const {
}
diff --git a/tests/sksl/fp/GrChildProcessorInlineFieldAccess.h b/tests/sksl/fp/GrChildProcessorInlineFieldAccess.h
index 7518ef7..79571f9 100644
--- a/tests/sksl/fp/GrChildProcessorInlineFieldAccess.h
+++ b/tests/sksl/fp/GrChildProcessorInlineFieldAccess.h
@@ -24,7 +24,7 @@
GrChildProcessorInlineFieldAccess(std::unique_ptr<GrFragmentProcessor> child)
: INHERITED(kGrChildProcessorInlineFieldAccess_ClassID, kNone_OptimizationFlags) {
this->registerChild(std::move(child), SkSL::SampleUsage::PassThrough()); }
- GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
+ std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override;
void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
bool onIsEqual(const GrFragmentProcessor&) const override;
#if GR_TEST_UTILS
diff --git a/tests/sksl/fp/GrChildProcessorSampleCoords.cpp b/tests/sksl/fp/GrChildProcessorSampleCoords.cpp
index bb6a552..4c75228 100644
--- a/tests/sksl/fp/GrChildProcessorSampleCoords.cpp
+++ b/tests/sksl/fp/GrChildProcessorSampleCoords.cpp
@@ -31,8 +31,8 @@
void onSetData(const GrGLSLProgramDataManager& pdman, const GrFragmentProcessor& _proc) override {
}
};
-GrGLSLFragmentProcessor* GrChildProcessorSampleCoords::onCreateGLSLInstance() const {
- return new GrGLSLChildProcessorSampleCoords();
+std::unique_ptr<GrGLSLFragmentProcessor> GrChildProcessorSampleCoords::onMakeProgramImpl() const {
+ return std::make_unique<GrGLSLChildProcessorSampleCoords>();
}
void GrChildProcessorSampleCoords::onGetGLSLProcessorKey(const GrShaderCaps& caps, GrProcessorKeyBuilder* b) const {
}
diff --git a/tests/sksl/fp/GrChildProcessorSampleCoords.h b/tests/sksl/fp/GrChildProcessorSampleCoords.h
index d4e64c3..6114fc4 100644
--- a/tests/sksl/fp/GrChildProcessorSampleCoords.h
+++ b/tests/sksl/fp/GrChildProcessorSampleCoords.h
@@ -25,7 +25,7 @@
: INHERITED(kGrChildProcessorSampleCoords_ClassID, kNone_OptimizationFlags) {
this->setUsesSampleCoordsDirectly();
this->registerChild(std::move(child), SkSL::SampleUsage(SkSL::SampleUsage::Kind::kNone, "", false, true, true)); }
- GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
+ std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override;
void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
bool onIsEqual(const GrFragmentProcessor&) const override;
#if GR_TEST_UTILS
diff --git a/tests/sksl/fp/GrChildProcessorSampleMatrixAndCoords.cpp b/tests/sksl/fp/GrChildProcessorSampleMatrixAndCoords.cpp
index b2e44b3..e5f4612 100644
--- a/tests/sksl/fp/GrChildProcessorSampleMatrixAndCoords.cpp
+++ b/tests/sksl/fp/GrChildProcessorSampleMatrixAndCoords.cpp
@@ -38,8 +38,8 @@
}
UniformHandle colorVar;
};
-GrGLSLFragmentProcessor* GrChildProcessorSampleMatrixAndCoords::onCreateGLSLInstance() const {
- return new GrGLSLChildProcessorSampleMatrixAndCoords();
+std::unique_ptr<GrGLSLFragmentProcessor> GrChildProcessorSampleMatrixAndCoords::onMakeProgramImpl() const {
+ return std::make_unique<GrGLSLChildProcessorSampleMatrixAndCoords>();
}
void GrChildProcessorSampleMatrixAndCoords::onGetGLSLProcessorKey(const GrShaderCaps& caps, GrProcessorKeyBuilder* b) const {
}
diff --git a/tests/sksl/fp/GrChildProcessorSampleMatrixAndCoords.h b/tests/sksl/fp/GrChildProcessorSampleMatrixAndCoords.h
index fe82fce..4692dd8 100644
--- a/tests/sksl/fp/GrChildProcessorSampleMatrixAndCoords.h
+++ b/tests/sksl/fp/GrChildProcessorSampleMatrixAndCoords.h
@@ -25,7 +25,7 @@
: INHERITED(kGrChildProcessorSampleMatrixAndCoords_ClassID, kNone_OptimizationFlags) {
this->setUsesSampleCoordsDirectly();
this->registerChild(std::move(child), SkSL::SampleUsage(SkSL::SampleUsage::Kind::kVariable, "", true, true, false)); }
- GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
+ std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override;
void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
bool onIsEqual(const GrFragmentProcessor&) const override;
#if GR_TEST_UTILS
diff --git a/tests/sksl/fp/GrChildProcessorSampleMatrixConstant.cpp b/tests/sksl/fp/GrChildProcessorSampleMatrixConstant.cpp
index 98d02cb..1b8a418 100644
--- a/tests/sksl/fp/GrChildProcessorSampleMatrixConstant.cpp
+++ b/tests/sksl/fp/GrChildProcessorSampleMatrixConstant.cpp
@@ -29,8 +29,8 @@
void onSetData(const GrGLSLProgramDataManager& pdman, const GrFragmentProcessor& _proc) override {
}
};
-GrGLSLFragmentProcessor* GrChildProcessorSampleMatrixConstant::onCreateGLSLInstance() const {
- return new GrGLSLChildProcessorSampleMatrixConstant();
+std::unique_ptr<GrGLSLFragmentProcessor> GrChildProcessorSampleMatrixConstant::onMakeProgramImpl() const {
+ return std::make_unique<GrGLSLChildProcessorSampleMatrixConstant>();
}
void GrChildProcessorSampleMatrixConstant::onGetGLSLProcessorKey(const GrShaderCaps& caps, GrProcessorKeyBuilder* b) const {
}
diff --git a/tests/sksl/fp/GrChildProcessorSampleMatrixConstant.h b/tests/sksl/fp/GrChildProcessorSampleMatrixConstant.h
index ea72517..3041522 100644
--- a/tests/sksl/fp/GrChildProcessorSampleMatrixConstant.h
+++ b/tests/sksl/fp/GrChildProcessorSampleMatrixConstant.h
@@ -24,7 +24,7 @@
GrChildProcessorSampleMatrixConstant(std::unique_ptr<GrFragmentProcessor> child)
: INHERITED(kGrChildProcessorSampleMatrixConstant_ClassID, kNone_OptimizationFlags) {
this->registerChild(std::move(child), SkSL::SampleUsage::UniformMatrix("float3x3(2.0)", true)); }
- GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
+ std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override;
void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
bool onIsEqual(const GrFragmentProcessor&) const override;
#if GR_TEST_UTILS
diff --git a/tests/sksl/fp/GrChildProcessorSampleMatrixConstantAndCoords.cpp b/tests/sksl/fp/GrChildProcessorSampleMatrixConstantAndCoords.cpp
index 60a35bb..a76f9c0 100644
--- a/tests/sksl/fp/GrChildProcessorSampleMatrixConstantAndCoords.cpp
+++ b/tests/sksl/fp/GrChildProcessorSampleMatrixConstantAndCoords.cpp
@@ -31,8 +31,8 @@
void onSetData(const GrGLSLProgramDataManager& pdman, const GrFragmentProcessor& _proc) override {
}
};
-GrGLSLFragmentProcessor* GrChildProcessorSampleMatrixConstantAndCoords::onCreateGLSLInstance() const {
- return new GrGLSLChildProcessorSampleMatrixConstantAndCoords();
+std::unique_ptr<GrGLSLFragmentProcessor> GrChildProcessorSampleMatrixConstantAndCoords::onMakeProgramImpl() const {
+ return std::make_unique<GrGLSLChildProcessorSampleMatrixConstantAndCoords>();
}
void GrChildProcessorSampleMatrixConstantAndCoords::onGetGLSLProcessorKey(const GrShaderCaps& caps, GrProcessorKeyBuilder* b) const {
}
diff --git a/tests/sksl/fp/GrChildProcessorSampleMatrixConstantAndCoords.h b/tests/sksl/fp/GrChildProcessorSampleMatrixConstantAndCoords.h
index 0561ec3..d02754e 100644
--- a/tests/sksl/fp/GrChildProcessorSampleMatrixConstantAndCoords.h
+++ b/tests/sksl/fp/GrChildProcessorSampleMatrixConstantAndCoords.h
@@ -25,7 +25,7 @@
: INHERITED(kGrChildProcessorSampleMatrixConstantAndCoords_ClassID, kNone_OptimizationFlags) {
this->setUsesSampleCoordsDirectly();
this->registerChild(std::move(child), SkSL::SampleUsage(SkSL::SampleUsage::Kind::kUniform, "float3x3(0.5)", true, true, false)); }
- GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
+ std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override;
void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
bool onIsEqual(const GrFragmentProcessor&) const override;
#if GR_TEST_UTILS
diff --git a/tests/sksl/fp/GrChildProcessorSampleMatrixMultipleUniforms.cpp b/tests/sksl/fp/GrChildProcessorSampleMatrixMultipleUniforms.cpp
index b6a63bf..d02a890 100644
--- a/tests/sksl/fp/GrChildProcessorSampleMatrixMultipleUniforms.cpp
+++ b/tests/sksl/fp/GrChildProcessorSampleMatrixMultipleUniforms.cpp
@@ -45,8 +45,8 @@
UniformHandle matrixAVar;
UniformHandle matrixBVar;
};
-GrGLSLFragmentProcessor* GrChildProcessorSampleMatrixMultipleUniforms::onCreateGLSLInstance() const {
- return new GrGLSLChildProcessorSampleMatrixMultipleUniforms();
+std::unique_ptr<GrGLSLFragmentProcessor> GrChildProcessorSampleMatrixMultipleUniforms::onMakeProgramImpl() const {
+ return std::make_unique<GrGLSLChildProcessorSampleMatrixMultipleUniforms>();
}
void GrChildProcessorSampleMatrixMultipleUniforms::onGetGLSLProcessorKey(const GrShaderCaps& caps, GrProcessorKeyBuilder* b) const {
}
diff --git a/tests/sksl/fp/GrChildProcessorSampleMatrixMultipleUniforms.h b/tests/sksl/fp/GrChildProcessorSampleMatrixMultipleUniforms.h
index bff3337..ba42ad2 100644
--- a/tests/sksl/fp/GrChildProcessorSampleMatrixMultipleUniforms.h
+++ b/tests/sksl/fp/GrChildProcessorSampleMatrixMultipleUniforms.h
@@ -28,7 +28,7 @@
, matrixA(matrixA)
, matrixB(matrixB) {
this->registerChild(std::move(child), SkSL::SampleUsage::VariableMatrix(true)); }
- GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
+ std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override;
void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
bool onIsEqual(const GrFragmentProcessor&) const override;
#if GR_TEST_UTILS
diff --git a/tests/sksl/fp/GrChildProcessorSampleMatrixSingleInUniform.cpp b/tests/sksl/fp/GrChildProcessorSampleMatrixSingleInUniform.cpp
index c6517da..2dd1ee8 100644
--- a/tests/sksl/fp/GrChildProcessorSampleMatrixSingleInUniform.cpp
+++ b/tests/sksl/fp/GrChildProcessorSampleMatrixSingleInUniform.cpp
@@ -37,8 +37,8 @@
}
UniformHandle matrixVar;
};
-GrGLSLFragmentProcessor* GrChildProcessorSampleMatrixSingleInUniform::onCreateGLSLInstance() const {
- return new GrGLSLChildProcessorSampleMatrixSingleInUniform();
+std::unique_ptr<GrGLSLFragmentProcessor> GrChildProcessorSampleMatrixSingleInUniform::onMakeProgramImpl() const {
+ return std::make_unique<GrGLSLChildProcessorSampleMatrixSingleInUniform>();
}
void GrChildProcessorSampleMatrixSingleInUniform::onGetGLSLProcessorKey(const GrShaderCaps& caps, GrProcessorKeyBuilder* b) const {
}
diff --git a/tests/sksl/fp/GrChildProcessorSampleMatrixSingleInUniform.h b/tests/sksl/fp/GrChildProcessorSampleMatrixSingleInUniform.h
index 1cc988c..9250081 100644
--- a/tests/sksl/fp/GrChildProcessorSampleMatrixSingleInUniform.h
+++ b/tests/sksl/fp/GrChildProcessorSampleMatrixSingleInUniform.h
@@ -26,7 +26,7 @@
: INHERITED(kGrChildProcessorSampleMatrixSingleInUniform_ClassID, kNone_OptimizationFlags)
, matrix(matrix) {
this->registerChild(std::move(child), SkSL::SampleUsage::UniformMatrix("matrix", matrix.hasPerspective())); }
- GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
+ std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override;
void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
bool onIsEqual(const GrFragmentProcessor&) const override;
#if GR_TEST_UTILS
diff --git a/tests/sksl/fp/GrChildProcessorSampleMatrixSingleUniform.cpp b/tests/sksl/fp/GrChildProcessorSampleMatrixSingleUniform.cpp
index e4c1aab..6b69b9d 100644
--- a/tests/sksl/fp/GrChildProcessorSampleMatrixSingleUniform.cpp
+++ b/tests/sksl/fp/GrChildProcessorSampleMatrixSingleUniform.cpp
@@ -31,8 +31,8 @@
}
UniformHandle matrixVar;
};
-GrGLSLFragmentProcessor* GrChildProcessorSampleMatrixSingleUniform::onCreateGLSLInstance() const {
- return new GrGLSLChildProcessorSampleMatrixSingleUniform();
+std::unique_ptr<GrGLSLFragmentProcessor> GrChildProcessorSampleMatrixSingleUniform::onMakeProgramImpl() const {
+ return std::make_unique<GrGLSLChildProcessorSampleMatrixSingleUniform>();
}
void GrChildProcessorSampleMatrixSingleUniform::onGetGLSLProcessorKey(const GrShaderCaps& caps, GrProcessorKeyBuilder* b) const {
}
diff --git a/tests/sksl/fp/GrChildProcessorSampleMatrixSingleUniform.h b/tests/sksl/fp/GrChildProcessorSampleMatrixSingleUniform.h
index 7ddad1e..7d4ca6f 100644
--- a/tests/sksl/fp/GrChildProcessorSampleMatrixSingleUniform.h
+++ b/tests/sksl/fp/GrChildProcessorSampleMatrixSingleUniform.h
@@ -24,7 +24,7 @@
GrChildProcessorSampleMatrixSingleUniform(std::unique_ptr<GrFragmentProcessor> child)
: INHERITED(kGrChildProcessorSampleMatrixSingleUniform_ClassID, kNone_OptimizationFlags) {
this->registerChild(std::move(child), SkSL::SampleUsage::UniformMatrix("matrix", true)); }
- GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
+ std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override;
void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
bool onIsEqual(const GrFragmentProcessor&) const override;
#if GR_TEST_UTILS
diff --git a/tests/sksl/fp/GrChildProcessorSampleMatrixSingleUniformExpr.cpp b/tests/sksl/fp/GrChildProcessorSampleMatrixSingleUniformExpr.cpp
index b878f9f..0f99bf0 100644
--- a/tests/sksl/fp/GrChildProcessorSampleMatrixSingleUniformExpr.cpp
+++ b/tests/sksl/fp/GrChildProcessorSampleMatrixSingleUniformExpr.cpp
@@ -32,8 +32,8 @@
}
UniformHandle matrixVar;
};
-GrGLSLFragmentProcessor* GrChildProcessorSampleMatrixSingleUniformExpr::onCreateGLSLInstance() const {
- return new GrGLSLChildProcessorSampleMatrixSingleUniformExpr();
+std::unique_ptr<GrGLSLFragmentProcessor> GrChildProcessorSampleMatrixSingleUniformExpr::onMakeProgramImpl() const {
+ return std::make_unique<GrGLSLChildProcessorSampleMatrixSingleUniformExpr>();
}
void GrChildProcessorSampleMatrixSingleUniformExpr::onGetGLSLProcessorKey(const GrShaderCaps& caps, GrProcessorKeyBuilder* b) const {
}
diff --git a/tests/sksl/fp/GrChildProcessorSampleMatrixSingleUniformExpr.h b/tests/sksl/fp/GrChildProcessorSampleMatrixSingleUniformExpr.h
index 02d6f0d..083c292 100644
--- a/tests/sksl/fp/GrChildProcessorSampleMatrixSingleUniformExpr.h
+++ b/tests/sksl/fp/GrChildProcessorSampleMatrixSingleUniformExpr.h
@@ -24,7 +24,7 @@
GrChildProcessorSampleMatrixSingleUniformExpr(std::unique_ptr<GrFragmentProcessor> child)
: INHERITED(kGrChildProcessorSampleMatrixSingleUniformExpr_ClassID, kNone_OptimizationFlags) {
this->registerChild(std::move(child), SkSL::SampleUsage::VariableMatrix(true)); }
- GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
+ std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override;
void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
bool onIsEqual(const GrFragmentProcessor&) const override;
#if GR_TEST_UTILS
diff --git a/tests/sksl/fp/GrChildProcessorWithInputExpression.cpp b/tests/sksl/fp/GrChildProcessorWithInputExpression.cpp
index 3c5f760..4ac7572 100644
--- a/tests/sksl/fp/GrChildProcessorWithInputExpression.cpp
+++ b/tests/sksl/fp/GrChildProcessorWithInputExpression.cpp
@@ -32,8 +32,8 @@
}
UniformHandle colorVar;
};
-GrGLSLFragmentProcessor* GrChildProcessorWithInputExpression::onCreateGLSLInstance() const {
- return new GrGLSLChildProcessorWithInputExpression();
+std::unique_ptr<GrGLSLFragmentProcessor> GrChildProcessorWithInputExpression::onMakeProgramImpl() const {
+ return std::make_unique<GrGLSLChildProcessorWithInputExpression>();
}
void GrChildProcessorWithInputExpression::onGetGLSLProcessorKey(const GrShaderCaps& caps, GrProcessorKeyBuilder* b) const {
}
diff --git a/tests/sksl/fp/GrChildProcessorWithInputExpression.h b/tests/sksl/fp/GrChildProcessorWithInputExpression.h
index 3c3f848..d6a7882 100644
--- a/tests/sksl/fp/GrChildProcessorWithInputExpression.h
+++ b/tests/sksl/fp/GrChildProcessorWithInputExpression.h
@@ -24,7 +24,7 @@
GrChildProcessorWithInputExpression(std::unique_ptr<GrFragmentProcessor> child)
: INHERITED(kGrChildProcessorWithInputExpression_ClassID, kNone_OptimizationFlags) {
this->registerChild(std::move(child), SkSL::SampleUsage::PassThrough()); }
- GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
+ std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override;
void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
bool onIsEqual(const GrFragmentProcessor&) const override;
#if GR_TEST_UTILS
diff --git a/tests/sksl/fp/GrChildProcessors.cpp b/tests/sksl/fp/GrChildProcessors.cpp
index f0b75c3..e40bfc0 100644
--- a/tests/sksl/fp/GrChildProcessors.cpp
+++ b/tests/sksl/fp/GrChildProcessors.cpp
@@ -30,8 +30,8 @@
void onSetData(const GrGLSLProgramDataManager& pdman, const GrFragmentProcessor& _proc) override {
}
};
-GrGLSLFragmentProcessor* GrChildProcessors::onCreateGLSLInstance() const {
- return new GrGLSLChildProcessors();
+std::unique_ptr<GrGLSLFragmentProcessor> GrChildProcessors::onMakeProgramImpl() const {
+ return std::make_unique<GrGLSLChildProcessors>();
}
void GrChildProcessors::onGetGLSLProcessorKey(const GrShaderCaps& caps, GrProcessorKeyBuilder* b) const {
}
diff --git a/tests/sksl/fp/GrChildProcessors.h b/tests/sksl/fp/GrChildProcessors.h
index 0dda182..2c8816f 100644
--- a/tests/sksl/fp/GrChildProcessors.h
+++ b/tests/sksl/fp/GrChildProcessors.h
@@ -24,7 +24,7 @@
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()); }
- GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
+ std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override;
void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
bool onIsEqual(const GrFragmentProcessor&) const override;
#if GR_TEST_UTILS
diff --git a/tests/sksl/fp/GrChildProcessorsWithInput.cpp b/tests/sksl/fp/GrChildProcessorsWithInput.cpp
index 1047637..57075f5 100644
--- a/tests/sksl/fp/GrChildProcessorsWithInput.cpp
+++ b/tests/sksl/fp/GrChildProcessorsWithInput.cpp
@@ -43,8 +43,8 @@
}
UniformHandle colorVar;
};
-GrGLSLFragmentProcessor* GrChildProcessorsWithInput::onCreateGLSLInstance() const {
- return new GrGLSLChildProcessorsWithInput();
+std::unique_ptr<GrGLSLFragmentProcessor> GrChildProcessorsWithInput::onMakeProgramImpl() const {
+ return std::make_unique<GrGLSLChildProcessorsWithInput>();
}
void GrChildProcessorsWithInput::onGetGLSLProcessorKey(const GrShaderCaps& caps, GrProcessorKeyBuilder* b) const {
}
diff --git a/tests/sksl/fp/GrChildProcessorsWithInput.h b/tests/sksl/fp/GrChildProcessorsWithInput.h
index 486acb9..b84df3e 100644
--- a/tests/sksl/fp/GrChildProcessorsWithInput.h
+++ b/tests/sksl/fp/GrChildProcessorsWithInput.h
@@ -24,7 +24,7 @@
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()); }
- GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
+ std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override;
void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
bool onIsEqual(const GrFragmentProcessor&) const override;
#if GR_TEST_UTILS
diff --git a/tests/sksl/fp/GrConditionalInUniform.cpp b/tests/sksl/fp/GrConditionalInUniform.cpp
index 7ee5891..6cd086b 100644
--- a/tests/sksl/fp/GrConditionalInUniform.cpp
+++ b/tests/sksl/fp/GrConditionalInUniform.cpp
@@ -51,8 +51,8 @@
SkPMColor4f colorPrev = {SK_FloatNaN, SK_FloatNaN, SK_FloatNaN, SK_FloatNaN};
UniformHandle colorVar;
};
-GrGLSLFragmentProcessor* GrConditionalInUniform::onCreateGLSLInstance() const {
- return new GrGLSLConditionalInUniform();
+std::unique_ptr<GrGLSLFragmentProcessor> GrConditionalInUniform::onMakeProgramImpl() const {
+ return std::make_unique<GrGLSLConditionalInUniform>();
}
void GrConditionalInUniform::onGetGLSLProcessorKey(const GrShaderCaps& caps, GrProcessorKeyBuilder* b) const {
b->add32((uint32_t) test);
diff --git a/tests/sksl/fp/GrConditionalInUniform.h b/tests/sksl/fp/GrConditionalInUniform.h
index 5bab1c6..f481a48 100644
--- a/tests/sksl/fp/GrConditionalInUniform.h
+++ b/tests/sksl/fp/GrConditionalInUniform.h
@@ -28,7 +28,7 @@
, test(test)
, color(color) {
}
- GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
+ std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override;
void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
bool onIsEqual(const GrFragmentProcessor&) const override;
#if GR_TEST_UTILS
diff --git a/tests/sksl/fp/GrFunction.cpp b/tests/sksl/fp/GrFunction.cpp
index c26379b..225c960 100644
--- a/tests/sksl/fp/GrFunction.cpp
+++ b/tests/sksl/fp/GrFunction.cpp
@@ -66,8 +66,8 @@
}
UniformHandle colorVar;
};
-GrGLSLFragmentProcessor* GrFunction::onCreateGLSLInstance() const {
- return new GrGLSLFunction();
+std::unique_ptr<GrGLSLFragmentProcessor> GrFunction::onMakeProgramImpl() const {
+ return std::make_unique<GrGLSLFunction>();
}
void GrFunction::onGetGLSLProcessorKey(const GrShaderCaps& caps, GrProcessorKeyBuilder* b) const {
}
diff --git a/tests/sksl/fp/GrFunction.h b/tests/sksl/fp/GrFunction.h
index 8b25c05..8cf7025 100644
--- a/tests/sksl/fp/GrFunction.h
+++ b/tests/sksl/fp/GrFunction.h
@@ -24,7 +24,7 @@
GrFunction()
: INHERITED(kGrFunction_ClassID, kNone_OptimizationFlags) {
}
- GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
+ std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override;
void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
bool onIsEqual(const GrFragmentProcessor&) const override;
#if GR_TEST_UTILS
diff --git a/tests/sksl/fp/GrFunctionArgTypes.cpp b/tests/sksl/fp/GrFunctionArgTypes.cpp
index d6c224f..c149201 100644
--- a/tests/sksl/fp/GrFunctionArgTypes.cpp
+++ b/tests/sksl/fp/GrFunctionArgTypes.cpp
@@ -58,8 +58,8 @@
void onSetData(const GrGLSLProgramDataManager& pdman, const GrFragmentProcessor& _proc) override {
}
};
-GrGLSLFragmentProcessor* GrFunctionArgTypes::onCreateGLSLInstance() const {
- return new GrGLSLFunctionArgTypes();
+std::unique_ptr<GrGLSLFragmentProcessor> GrFunctionArgTypes::onMakeProgramImpl() const {
+ return std::make_unique<GrGLSLFunctionArgTypes>();
}
void GrFunctionArgTypes::onGetGLSLProcessorKey(const GrShaderCaps& caps, GrProcessorKeyBuilder* b) const {
}
diff --git a/tests/sksl/fp/GrFunctionArgTypes.h b/tests/sksl/fp/GrFunctionArgTypes.h
index 00f2f9a..3765002 100644
--- a/tests/sksl/fp/GrFunctionArgTypes.h
+++ b/tests/sksl/fp/GrFunctionArgTypes.h
@@ -24,7 +24,7 @@
GrFunctionArgTypes()
: INHERITED(kGrFunctionArgTypes_ClassID, kNone_OptimizationFlags) {
}
- GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
+ std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override;
void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
bool onIsEqual(const GrFragmentProcessor&) const override;
#if GR_TEST_UTILS
diff --git a/tests/sksl/fp/GrFunctionReturnTypes.cpp b/tests/sksl/fp/GrFunctionReturnTypes.cpp
index ee7ea40..611845b 100644
--- a/tests/sksl/fp/GrFunctionReturnTypes.cpp
+++ b/tests/sksl/fp/GrFunctionReturnTypes.cpp
@@ -160,8 +160,8 @@
void onSetData(const GrGLSLProgramDataManager& pdman, const GrFragmentProcessor& _proc) override {
}
};
-GrGLSLFragmentProcessor* GrFunctionReturnTypes::onCreateGLSLInstance() const {
- return new GrGLSLFunctionReturnTypes();
+std::unique_ptr<GrGLSLFragmentProcessor> GrFunctionReturnTypes::onMakeProgramImpl() const {
+ return std::make_unique<GrGLSLFunctionReturnTypes>();
}
void GrFunctionReturnTypes::onGetGLSLProcessorKey(const GrShaderCaps& caps, GrProcessorKeyBuilder* b) const {
}
diff --git a/tests/sksl/fp/GrFunctionReturnTypes.h b/tests/sksl/fp/GrFunctionReturnTypes.h
index 58874c7..b9b327d 100644
--- a/tests/sksl/fp/GrFunctionReturnTypes.h
+++ b/tests/sksl/fp/GrFunctionReturnTypes.h
@@ -24,7 +24,7 @@
GrFunctionReturnTypes()
: INHERITED(kGrFunctionReturnTypes_ClassID, kNone_OptimizationFlags) {
}
- GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
+ std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override;
void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
bool onIsEqual(const GrFragmentProcessor&) const override;
#if GR_TEST_UTILS
diff --git a/tests/sksl/fp/GrGrSLTypesAreSupported.cpp b/tests/sksl/fp/GrGrSLTypesAreSupported.cpp
index af071f9..1d9d307 100644
--- a/tests/sksl/fp/GrGrSLTypesAreSupported.cpp
+++ b/tests/sksl/fp/GrGrSLTypesAreSupported.cpp
@@ -70,8 +70,8 @@
void onSetData(const GrGLSLProgramDataManager& pdman, const GrFragmentProcessor& _proc) override {
}
};
-GrGLSLFragmentProcessor* GrGrSLTypesAreSupported::onCreateGLSLInstance() const {
- return new GrGLSLGrSLTypesAreSupported();
+std::unique_ptr<GrGLSLFragmentProcessor> GrGrSLTypesAreSupported::onMakeProgramImpl() const {
+ return std::make_unique<GrGLSLGrSLTypesAreSupported>();
}
void GrGrSLTypesAreSupported::onGetGLSLProcessorKey(const GrShaderCaps& caps, GrProcessorKeyBuilder* b) const {
}
diff --git a/tests/sksl/fp/GrGrSLTypesAreSupported.h b/tests/sksl/fp/GrGrSLTypesAreSupported.h
index 1ab4de0..5cc90b5 100644
--- a/tests/sksl/fp/GrGrSLTypesAreSupported.h
+++ b/tests/sksl/fp/GrGrSLTypesAreSupported.h
@@ -24,7 +24,7 @@
GrGrSLTypesAreSupported()
: INHERITED(kGrGrSLTypesAreSupported_ClassID, kNone_OptimizationFlags) {
}
- GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
+ std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override;
void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
bool onIsEqual(const GrFragmentProcessor&) const override;
#if GR_TEST_UTILS
diff --git a/tests/sksl/fp/GrHelloWorld.cpp b/tests/sksl/fp/GrHelloWorld.cpp
index ea186bf..a92e30e 100644
--- a/tests/sksl/fp/GrHelloWorld.cpp
+++ b/tests/sksl/fp/GrHelloWorld.cpp
@@ -28,8 +28,8 @@
void onSetData(const GrGLSLProgramDataManager& pdman, const GrFragmentProcessor& _proc) override {
}
};
-GrGLSLFragmentProcessor* GrHelloWorld::onCreateGLSLInstance() const {
- return new GrGLSLHelloWorld();
+std::unique_ptr<GrGLSLFragmentProcessor> GrHelloWorld::onMakeProgramImpl() const {
+ return std::make_unique<GrGLSLHelloWorld>();
}
void GrHelloWorld::onGetGLSLProcessorKey(const GrShaderCaps& caps, GrProcessorKeyBuilder* b) const {
}
diff --git a/tests/sksl/fp/GrHelloWorld.h b/tests/sksl/fp/GrHelloWorld.h
index 33ac39f..d3ad32c 100644
--- a/tests/sksl/fp/GrHelloWorld.h
+++ b/tests/sksl/fp/GrHelloWorld.h
@@ -24,7 +24,7 @@
GrHelloWorld()
: INHERITED(kGrHelloWorld_ClassID, kNone_OptimizationFlags) {
}
- GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
+ std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override;
void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
bool onIsEqual(const GrFragmentProcessor&) const override;
#if GR_TEST_UTILS
diff --git a/tests/sksl/fp/GrInUniform.cpp b/tests/sksl/fp/GrInUniform.cpp
index b0a638e..6bf7f92 100644
--- a/tests/sksl/fp/GrInUniform.cpp
+++ b/tests/sksl/fp/GrInUniform.cpp
@@ -36,8 +36,8 @@
}
UniformHandle colorVar;
};
-GrGLSLFragmentProcessor* GrInUniform::onCreateGLSLInstance() const {
- return new GrGLSLInUniform();
+std::unique_ptr<GrGLSLFragmentProcessor> GrInUniform::onMakeProgramImpl() const {
+ return std::make_unique<GrGLSLInUniform>();
}
void GrInUniform::onGetGLSLProcessorKey(const GrShaderCaps& caps, GrProcessorKeyBuilder* b) const {
}
diff --git a/tests/sksl/fp/GrInUniform.h b/tests/sksl/fp/GrInUniform.h
index 36ee284..733c3fd 100644
--- a/tests/sksl/fp/GrInUniform.h
+++ b/tests/sksl/fp/GrInUniform.h
@@ -26,7 +26,7 @@
: INHERITED(kGrInUniform_ClassID, kNone_OptimizationFlags)
, color(color) {
}
- GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
+ std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override;
void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
bool onIsEqual(const GrFragmentProcessor&) const override;
#if GR_TEST_UTILS
diff --git a/tests/sksl/fp/GrInUniformCType.cpp b/tests/sksl/fp/GrInUniformCType.cpp
index 0f73918..4d485e4 100644
--- a/tests/sksl/fp/GrInUniformCType.cpp
+++ b/tests/sksl/fp/GrInUniformCType.cpp
@@ -36,8 +36,8 @@
}
UniformHandle colorVar;
};
-GrGLSLFragmentProcessor* GrInUniformCType::onCreateGLSLInstance() const {
- return new GrGLSLInUniformCType();
+std::unique_ptr<GrGLSLFragmentProcessor> GrInUniformCType::onMakeProgramImpl() const {
+ return std::make_unique<GrGLSLInUniformCType>();
}
void GrInUniformCType::onGetGLSLProcessorKey(const GrShaderCaps& caps, GrProcessorKeyBuilder* b) const {
}
diff --git a/tests/sksl/fp/GrInUniformCType.h b/tests/sksl/fp/GrInUniformCType.h
index 69962ce..1bfdac9 100644
--- a/tests/sksl/fp/GrInUniformCType.h
+++ b/tests/sksl/fp/GrInUniformCType.h
@@ -26,7 +26,7 @@
: INHERITED(kGrInUniformCType_ClassID, kNone_OptimizationFlags)
, color(color) {
}
- GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
+ std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override;
void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
bool onIsEqual(const GrFragmentProcessor&) const override;
#if GR_TEST_UTILS
diff --git a/tests/sksl/fp/GrInlinedFunction.cpp b/tests/sksl/fp/GrInlinedFunction.cpp
index 173d465..1486aaf 100644
--- a/tests/sksl/fp/GrInlinedFunction.cpp
+++ b/tests/sksl/fp/GrInlinedFunction.cpp
@@ -31,8 +31,8 @@
}
UniformHandle colorVar;
};
-GrGLSLFragmentProcessor* GrInlinedFunction::onCreateGLSLInstance() const {
- return new GrGLSLInlinedFunction();
+std::unique_ptr<GrGLSLFragmentProcessor> GrInlinedFunction::onMakeProgramImpl() const {
+ return std::make_unique<GrGLSLInlinedFunction>();
}
void GrInlinedFunction::onGetGLSLProcessorKey(const GrShaderCaps& caps, GrProcessorKeyBuilder* b) const {
}
diff --git a/tests/sksl/fp/GrInlinedFunction.h b/tests/sksl/fp/GrInlinedFunction.h
index b0ccf37..9eef7e7 100644
--- a/tests/sksl/fp/GrInlinedFunction.h
+++ b/tests/sksl/fp/GrInlinedFunction.h
@@ -24,7 +24,7 @@
GrInlinedFunction()
: INHERITED(kGrInlinedFunction_ClassID, kNone_OptimizationFlags) {
}
- GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
+ std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override;
void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
bool onIsEqual(const GrFragmentProcessor&) const override;
#if GR_TEST_UTILS
diff --git a/tests/sksl/fp/GrKeyIn.cpp b/tests/sksl/fp/GrKeyIn.cpp
index 94117c3..9d3c03a 100644
--- a/tests/sksl/fp/GrKeyIn.cpp
+++ b/tests/sksl/fp/GrKeyIn.cpp
@@ -30,8 +30,8 @@
void onSetData(const GrGLSLProgramDataManager& pdman, const GrFragmentProcessor& _proc) override {
}
};
-GrGLSLFragmentProcessor* GrKeyIn::onCreateGLSLInstance() const {
- return new GrGLSLKeyIn();
+std::unique_ptr<GrGLSLFragmentProcessor> GrKeyIn::onMakeProgramImpl() const {
+ return std::make_unique<GrGLSLKeyIn>();
}
void GrKeyIn::onGetGLSLProcessorKey(const GrShaderCaps& caps, GrProcessorKeyBuilder* b) const {
uint16_t red = SkFloatToHalf(color.fR);
diff --git a/tests/sksl/fp/GrKeyIn.h b/tests/sksl/fp/GrKeyIn.h
index 9fac219..b9de204 100644
--- a/tests/sksl/fp/GrKeyIn.h
+++ b/tests/sksl/fp/GrKeyIn.h
@@ -26,7 +26,7 @@
: INHERITED(kGrKeyIn_ClassID, kNone_OptimizationFlags)
, color(color) {
}
- GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
+ std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override;
void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
bool onIsEqual(const GrFragmentProcessor&) const override;
#if GR_TEST_UTILS
diff --git a/tests/sksl/fp/GrLayoutWhen.cpp b/tests/sksl/fp/GrLayoutWhen.cpp
index c5c78b2..2d5c0b7 100644
--- a/tests/sksl/fp/GrLayoutWhen.cpp
+++ b/tests/sksl/fp/GrLayoutWhen.cpp
@@ -32,8 +32,8 @@
}
UniformHandle sometimesVar;
};
-GrGLSLFragmentProcessor* GrLayoutWhen::onCreateGLSLInstance() const {
- return new GrGLSLLayoutWhen();
+std::unique_ptr<GrGLSLFragmentProcessor> GrLayoutWhen::onMakeProgramImpl() const {
+ return std::make_unique<GrGLSLLayoutWhen>();
}
void GrLayoutWhen::onGetGLSLProcessorKey(const GrShaderCaps& caps, GrProcessorKeyBuilder* b) const {
}
diff --git a/tests/sksl/fp/GrLayoutWhen.h b/tests/sksl/fp/GrLayoutWhen.h
index 88491b4..60852eb 100644
--- a/tests/sksl/fp/GrLayoutWhen.h
+++ b/tests/sksl/fp/GrLayoutWhen.h
@@ -24,7 +24,7 @@
GrLayoutWhen()
: INHERITED(kGrLayoutWhen_ClassID, kNone_OptimizationFlags) {
}
- GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
+ std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override;
void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
bool onIsEqual(const GrFragmentProcessor&) const override;
#if GR_TEST_UTILS
diff --git a/tests/sksl/fp/GrMainCoords.cpp b/tests/sksl/fp/GrMainCoords.cpp
index 3e1cac5..3275ef9 100644
--- a/tests/sksl/fp/GrMainCoords.cpp
+++ b/tests/sksl/fp/GrMainCoords.cpp
@@ -28,8 +28,8 @@
void onSetData(const GrGLSLProgramDataManager& pdman, const GrFragmentProcessor& _proc) override {
}
};
-GrGLSLFragmentProcessor* GrMainCoords::onCreateGLSLInstance() const {
- return new GrGLSLMainCoords();
+std::unique_ptr<GrGLSLFragmentProcessor> GrMainCoords::onMakeProgramImpl() const {
+ return std::make_unique<GrGLSLMainCoords>();
}
void GrMainCoords::onGetGLSLProcessorKey(const GrShaderCaps& caps, GrProcessorKeyBuilder* b) const {
}
diff --git a/tests/sksl/fp/GrMainCoords.h b/tests/sksl/fp/GrMainCoords.h
index 60a765e..413ade6 100644
--- a/tests/sksl/fp/GrMainCoords.h
+++ b/tests/sksl/fp/GrMainCoords.h
@@ -25,7 +25,7 @@
: INHERITED(kGrMainCoords_ClassID, kNone_OptimizationFlags) {
this->setUsesSampleCoordsDirectly();
}
- GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
+ std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override;
void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
bool onIsEqual(const GrFragmentProcessor&) const override;
#if GR_TEST_UTILS
diff --git a/tests/sksl/fp/GrModuloOp.cpp b/tests/sksl/fp/GrModuloOp.cpp
index fc93773..93cd3a7 100644
--- a/tests/sksl/fp/GrModuloOp.cpp
+++ b/tests/sksl/fp/GrModuloOp.cpp
@@ -28,8 +28,8 @@
void onSetData(const GrGLSLProgramDataManager& pdman, const GrFragmentProcessor& _proc) override {
}
};
-GrGLSLFragmentProcessor* GrModuloOp::onCreateGLSLInstance() const {
- return new GrGLSLModuloOp();
+std::unique_ptr<GrGLSLFragmentProcessor> GrModuloOp::onMakeProgramImpl() const {
+ return std::make_unique<GrGLSLModuloOp>();
}
void GrModuloOp::onGetGLSLProcessorKey(const GrShaderCaps& caps, GrProcessorKeyBuilder* b) const {
}
diff --git a/tests/sksl/fp/GrModuloOp.h b/tests/sksl/fp/GrModuloOp.h
index 07c46b0..ddab939 100644
--- a/tests/sksl/fp/GrModuloOp.h
+++ b/tests/sksl/fp/GrModuloOp.h
@@ -24,7 +24,7 @@
GrModuloOp()
: INHERITED(kGrModuloOp_ClassID, kNone_OptimizationFlags) {
}
- GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
+ std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override;
void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
bool onIsEqual(const GrFragmentProcessor&) const override;
#if GR_TEST_UTILS
diff --git a/tests/sksl/fp/GrNestedCall.cpp b/tests/sksl/fp/GrNestedCall.cpp
index 5ed19f3..fed7c55 100644
--- a/tests/sksl/fp/GrNestedCall.cpp
+++ b/tests/sksl/fp/GrNestedCall.cpp
@@ -45,8 +45,8 @@
void onSetData(const GrGLSLProgramDataManager& pdman, const GrFragmentProcessor& _proc) override {
}
};
-GrGLSLFragmentProcessor* GrNestedCall::onCreateGLSLInstance() const {
- return new GrGLSLNestedCall();
+std::unique_ptr<GrGLSLFragmentProcessor> GrNestedCall::onMakeProgramImpl() const {
+ return std::make_unique<GrGLSLNestedCall>();
}
void GrNestedCall::onGetGLSLProcessorKey(const GrShaderCaps& caps, GrProcessorKeyBuilder* b) const {
}
diff --git a/tests/sksl/fp/GrNestedCall.h b/tests/sksl/fp/GrNestedCall.h
index 8cf4a68..807f115 100644
--- a/tests/sksl/fp/GrNestedCall.h
+++ b/tests/sksl/fp/GrNestedCall.h
@@ -24,7 +24,7 @@
GrNestedCall(std::unique_ptr<GrFragmentProcessor> fp)
: INHERITED(kGrNestedCall_ClassID, kNone_OptimizationFlags) {
this->registerChild(std::move(fp), SkSL::SampleUsage::PassThrough()); }
- GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
+ std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override;
void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
bool onIsEqual(const GrFragmentProcessor&) const override;
#if GR_TEST_UTILS
diff --git a/tests/sksl/fp/GrNestedChildProcessors.cpp b/tests/sksl/fp/GrNestedChildProcessors.cpp
index e2855ce..0c0ea59 100644
--- a/tests/sksl/fp/GrNestedChildProcessors.cpp
+++ b/tests/sksl/fp/GrNestedChildProcessors.cpp
@@ -34,8 +34,8 @@
}
UniformHandle colorVar;
};
-GrGLSLFragmentProcessor* GrNestedChildProcessors::onCreateGLSLInstance() const {
- return new GrGLSLNestedChildProcessors();
+std::unique_ptr<GrGLSLFragmentProcessor> GrNestedChildProcessors::onMakeProgramImpl() const {
+ return std::make_unique<GrGLSLNestedChildProcessors>();
}
void GrNestedChildProcessors::onGetGLSLProcessorKey(const GrShaderCaps& caps, GrProcessorKeyBuilder* b) const {
}
diff --git a/tests/sksl/fp/GrNestedChildProcessors.h b/tests/sksl/fp/GrNestedChildProcessors.h
index 52d6005..bc6e539 100644
--- a/tests/sksl/fp/GrNestedChildProcessors.h
+++ b/tests/sksl/fp/GrNestedChildProcessors.h
@@ -24,7 +24,7 @@
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()); }
- GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
+ std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override;
void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
bool onIsEqual(const GrFragmentProcessor&) const override;
#if GR_TEST_UTILS
diff --git a/tests/sksl/fp/GrNonInlinedInUniform.cpp b/tests/sksl/fp/GrNonInlinedInUniform.cpp
index 727f975..0e70c19 100644
--- a/tests/sksl/fp/GrNonInlinedInUniform.cpp
+++ b/tests/sksl/fp/GrNonInlinedInUniform.cpp
@@ -37,8 +37,8 @@
}
UniformHandle pointVar;
};
-GrGLSLFragmentProcessor* GrNonInlinedInUniform::onCreateGLSLInstance() const {
- return new GrGLSLNonInlinedInUniform();
+std::unique_ptr<GrGLSLFragmentProcessor> GrNonInlinedInUniform::onMakeProgramImpl() const {
+ return std::make_unique<GrGLSLNonInlinedInUniform>();
}
void GrNonInlinedInUniform::onGetGLSLProcessorKey(const GrShaderCaps& caps, GrProcessorKeyBuilder* b) const {
}
diff --git a/tests/sksl/fp/GrNonInlinedInUniform.h b/tests/sksl/fp/GrNonInlinedInUniform.h
index 876f202..ca36d1f 100644
--- a/tests/sksl/fp/GrNonInlinedInUniform.h
+++ b/tests/sksl/fp/GrNonInlinedInUniform.h
@@ -26,7 +26,7 @@
: INHERITED(kGrNonInlinedInUniform_ClassID, kNone_OptimizationFlags)
, point(point) {
}
- GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
+ std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override;
void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
bool onIsEqual(const GrFragmentProcessor&) const override;
#if GR_TEST_UTILS
diff --git a/tests/sksl/fp/GrSectionClass.cpp b/tests/sksl/fp/GrSectionClass.cpp
index dc02ccf..a80e6c8 100644
--- a/tests/sksl/fp/GrSectionClass.cpp
+++ b/tests/sksl/fp/GrSectionClass.cpp
@@ -28,8 +28,8 @@
void onSetData(const GrGLSLProgramDataManager& pdman, const GrFragmentProcessor& _proc) override {
}
};
-GrGLSLFragmentProcessor* GrSectionClass::onCreateGLSLInstance() const {
- return new GrGLSLSectionClass();
+std::unique_ptr<GrGLSLFragmentProcessor> GrSectionClass::onMakeProgramImpl() const {
+ return std::make_unique<GrGLSLSectionClass>();
}
void GrSectionClass::onGetGLSLProcessorKey(const GrShaderCaps& caps, GrProcessorKeyBuilder* b) const {
}
diff --git a/tests/sksl/fp/GrSectionClass.h b/tests/sksl/fp/GrSectionClass.h
index 0d26f34..0f73e25 100644
--- a/tests/sksl/fp/GrSectionClass.h
+++ b/tests/sksl/fp/GrSectionClass.h
@@ -24,7 +24,7 @@
GrSectionClass()
: INHERITED(kGrSectionClass_ClassID, kNone_OptimizationFlags) {
}
- GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
+ std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override;
void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
bool onIsEqual(const GrFragmentProcessor&) const override;
#if GR_TEST_UTILS
diff --git a/tests/sksl/fp/GrSectionConstructor.cpp b/tests/sksl/fp/GrSectionConstructor.cpp
index ab2f0ef..c3d937e 100644
--- a/tests/sksl/fp/GrSectionConstructor.cpp
+++ b/tests/sksl/fp/GrSectionConstructor.cpp
@@ -28,8 +28,8 @@
void onSetData(const GrGLSLProgramDataManager& pdman, const GrFragmentProcessor& _proc) override {
}
};
-GrGLSLFragmentProcessor* GrSectionConstructor::onCreateGLSLInstance() const {
- return new GrGLSLSectionConstructor();
+std::unique_ptr<GrGLSLFragmentProcessor> GrSectionConstructor::onMakeProgramImpl() const {
+ return std::make_unique<GrGLSLSectionConstructor>();
}
void GrSectionConstructor::onGetGLSLProcessorKey(const GrShaderCaps& caps, GrProcessorKeyBuilder* b) const {
}
diff --git a/tests/sksl/fp/GrSectionConstructor.h b/tests/sksl/fp/GrSectionConstructor.h
index 160d372..924cc24 100644
--- a/tests/sksl/fp/GrSectionConstructor.h
+++ b/tests/sksl/fp/GrSectionConstructor.h
@@ -21,7 +21,7 @@
std::unique_ptr<GrFragmentProcessor> clone() const override;
const char* name() const override { return "SectionConstructor"; }
private:
-constructor section GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
+constructor section std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override;
void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
bool onIsEqual(const GrFragmentProcessor&) const override;
#if GR_TEST_UTILS
diff --git a/tests/sksl/fp/GrSectionConstructorParams.cpp b/tests/sksl/fp/GrSectionConstructorParams.cpp
index dab824a..49d8bf5 100644
--- a/tests/sksl/fp/GrSectionConstructorParams.cpp
+++ b/tests/sksl/fp/GrSectionConstructorParams.cpp
@@ -30,8 +30,8 @@
void onSetData(const GrGLSLProgramDataManager& pdman, const GrFragmentProcessor& _proc) override {
}
};
-GrGLSLFragmentProcessor* GrSectionConstructorParams::onCreateGLSLInstance() const {
- return new GrGLSLSectionConstructorParams();
+std::unique_ptr<GrGLSLFragmentProcessor> GrSectionConstructorParams::onMakeProgramImpl() const {
+ return std::make_unique<GrGLSLSectionConstructorParams>();
}
void GrSectionConstructorParams::onGetGLSLProcessorKey(const GrShaderCaps& caps, GrProcessorKeyBuilder* b) const {
}
diff --git a/tests/sksl/fp/GrSectionConstructorParams.h b/tests/sksl/fp/GrSectionConstructorParams.h
index 2830531..83cdc3f 100644
--- a/tests/sksl/fp/GrSectionConstructorParams.h
+++ b/tests/sksl/fp/GrSectionConstructorParams.h
@@ -26,7 +26,7 @@
: INHERITED(kGrSectionConstructorParams_ClassID, kNone_OptimizationFlags)
, w(w) {
}
- GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
+ std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override;
void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
bool onIsEqual(const GrFragmentProcessor&) const override;
#if GR_TEST_UTILS
diff --git a/tests/sksl/fp/GrSectionCpp.cpp b/tests/sksl/fp/GrSectionCpp.cpp
index b6479ed..308a2db 100644
--- a/tests/sksl/fp/GrSectionCpp.cpp
+++ b/tests/sksl/fp/GrSectionCpp.cpp
@@ -28,8 +28,8 @@
void onSetData(const GrGLSLProgramDataManager& pdman, const GrFragmentProcessor& _proc) override {
}
};
-GrGLSLFragmentProcessor* GrSectionCpp::onCreateGLSLInstance() const {
- return new GrGLSLSectionCpp();
+std::unique_ptr<GrGLSLFragmentProcessor> GrSectionCpp::onMakeProgramImpl() const {
+ return std::make_unique<GrGLSLSectionCpp>();
}
void GrSectionCpp::onGetGLSLProcessorKey(const GrShaderCaps& caps, GrProcessorKeyBuilder* b) const {
}
diff --git a/tests/sksl/fp/GrSectionCpp.h b/tests/sksl/fp/GrSectionCpp.h
index b73338f..53b9004 100644
--- a/tests/sksl/fp/GrSectionCpp.h
+++ b/tests/sksl/fp/GrSectionCpp.h
@@ -24,7 +24,7 @@
GrSectionCpp()
: INHERITED(kGrSectionCpp_ClassID, kNone_OptimizationFlags) {
}
- GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
+ std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override;
void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
bool onIsEqual(const GrFragmentProcessor&) const override;
#if GR_TEST_UTILS
diff --git a/tests/sksl/fp/GrSectionDumpInfo.cpp b/tests/sksl/fp/GrSectionDumpInfo.cpp
index 37e7a19..858896f 100644
--- a/tests/sksl/fp/GrSectionDumpInfo.cpp
+++ b/tests/sksl/fp/GrSectionDumpInfo.cpp
@@ -28,8 +28,8 @@
void onSetData(const GrGLSLProgramDataManager& pdman, const GrFragmentProcessor& _proc) override {
}
};
-GrGLSLFragmentProcessor* GrSectionDumpInfo::onCreateGLSLInstance() const {
- return new GrGLSLSectionDumpInfo();
+std::unique_ptr<GrGLSLFragmentProcessor> GrSectionDumpInfo::onMakeProgramImpl() const {
+ return std::make_unique<GrGLSLSectionDumpInfo>();
}
void GrSectionDumpInfo::onGetGLSLProcessorKey(const GrShaderCaps& caps, GrProcessorKeyBuilder* b) const {
}
diff --git a/tests/sksl/fp/GrSectionDumpInfo.h b/tests/sksl/fp/GrSectionDumpInfo.h
index 2e9c01c..d16916f 100644
--- a/tests/sksl/fp/GrSectionDumpInfo.h
+++ b/tests/sksl/fp/GrSectionDumpInfo.h
@@ -24,7 +24,7 @@
GrSectionDumpInfo()
: INHERITED(kGrSectionDumpInfo_ClassID, kNone_OptimizationFlags) {
}
- GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
+ std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override;
void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
bool onIsEqual(const GrFragmentProcessor&) const override;
#if GR_TEST_UTILS
diff --git a/tests/sksl/fp/GrSectionEmitCode.cpp b/tests/sksl/fp/GrSectionEmitCode.cpp
index c762435..79888f6 100644
--- a/tests/sksl/fp/GrSectionEmitCode.cpp
+++ b/tests/sksl/fp/GrSectionEmitCode.cpp
@@ -31,8 +31,8 @@
}
float x = 0;
};
-GrGLSLFragmentProcessor* GrSectionEmitCode::onCreateGLSLInstance() const {
- return new GrGLSLSectionEmitCode();
+std::unique_ptr<GrGLSLFragmentProcessor> GrSectionEmitCode::onMakeProgramImpl() const {
+ return std::make_unique<GrGLSLSectionEmitCode>();
}
void GrSectionEmitCode::onGetGLSLProcessorKey(const GrShaderCaps& caps, GrProcessorKeyBuilder* b) const {
}
diff --git a/tests/sksl/fp/GrSectionEmitCode.h b/tests/sksl/fp/GrSectionEmitCode.h
index 91079a5..8af5636 100644
--- a/tests/sksl/fp/GrSectionEmitCode.h
+++ b/tests/sksl/fp/GrSectionEmitCode.h
@@ -24,7 +24,7 @@
GrSectionEmitCode()
: INHERITED(kGrSectionEmitCode_ClassID, kNone_OptimizationFlags) {
}
- GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
+ std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override;
void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
bool onIsEqual(const GrFragmentProcessor&) const override;
#if GR_TEST_UTILS
diff --git a/tests/sksl/fp/GrSectionFields.cpp b/tests/sksl/fp/GrSectionFields.cpp
index 94aeded..6d26c33 100644
--- a/tests/sksl/fp/GrSectionFields.cpp
+++ b/tests/sksl/fp/GrSectionFields.cpp
@@ -28,8 +28,8 @@
void onSetData(const GrGLSLProgramDataManager& pdman, const GrFragmentProcessor& _proc) override {
}
};
-GrGLSLFragmentProcessor* GrSectionFields::onCreateGLSLInstance() const {
- return new GrGLSLSectionFields();
+std::unique_ptr<GrGLSLFragmentProcessor> GrSectionFields::onMakeProgramImpl() const {
+ return std::make_unique<GrGLSLSectionFields>();
}
void GrSectionFields::onGetGLSLProcessorKey(const GrShaderCaps& caps, GrProcessorKeyBuilder* b) const {
}
diff --git a/tests/sksl/fp/GrSectionFields.h b/tests/sksl/fp/GrSectionFields.h
index f7cc010..db4716b 100644
--- a/tests/sksl/fp/GrSectionFields.h
+++ b/tests/sksl/fp/GrSectionFields.h
@@ -24,7 +24,7 @@
GrSectionFields()
: INHERITED(kGrSectionFields_ClassID, kNone_OptimizationFlags) {
}
- GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
+ std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override;
void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
bool onIsEqual(const GrFragmentProcessor&) const override;
#if GR_TEST_UTILS
diff --git a/tests/sksl/fp/GrSectionHeader.cpp b/tests/sksl/fp/GrSectionHeader.cpp
index a7731b9..70c124d 100644
--- a/tests/sksl/fp/GrSectionHeader.cpp
+++ b/tests/sksl/fp/GrSectionHeader.cpp
@@ -28,8 +28,8 @@
void onSetData(const GrGLSLProgramDataManager& pdman, const GrFragmentProcessor& _proc) override {
}
};
-GrGLSLFragmentProcessor* GrSectionHeader::onCreateGLSLInstance() const {
- return new GrGLSLSectionHeader();
+std::unique_ptr<GrGLSLFragmentProcessor> GrSectionHeader::onMakeProgramImpl() const {
+ return std::make_unique<GrGLSLSectionHeader>();
}
void GrSectionHeader::onGetGLSLProcessorKey(const GrShaderCaps& caps, GrProcessorKeyBuilder* b) const {
}
diff --git a/tests/sksl/fp/GrSectionHeader.h b/tests/sksl/fp/GrSectionHeader.h
index 348bb6b..a73c9ab 100644
--- a/tests/sksl/fp/GrSectionHeader.h
+++ b/tests/sksl/fp/GrSectionHeader.h
@@ -24,7 +24,7 @@
GrSectionHeader()
: INHERITED(kGrSectionHeader_ClassID, kNone_OptimizationFlags) {
}
- GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
+ std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override;
void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
bool onIsEqual(const GrFragmentProcessor&) const override;
#if GR_TEST_UTILS
diff --git a/tests/sksl/fp/GrSectionInitializers.cpp b/tests/sksl/fp/GrSectionInitializers.cpp
index 2bf8e46..3880b62 100644
--- a/tests/sksl/fp/GrSectionInitializers.cpp
+++ b/tests/sksl/fp/GrSectionInitializers.cpp
@@ -28,8 +28,8 @@
void onSetData(const GrGLSLProgramDataManager& pdman, const GrFragmentProcessor& _proc) override {
}
};
-GrGLSLFragmentProcessor* GrSectionInitializers::onCreateGLSLInstance() const {
- return new GrGLSLSectionInitializers();
+std::unique_ptr<GrGLSLFragmentProcessor> GrSectionInitializers::onMakeProgramImpl() const {
+ return std::make_unique<GrGLSLSectionInitializers>();
}
void GrSectionInitializers::onGetGLSLProcessorKey(const GrShaderCaps& caps, GrProcessorKeyBuilder* b) const {
}
diff --git a/tests/sksl/fp/GrSectionInitializers.h b/tests/sksl/fp/GrSectionInitializers.h
index b6c3daf..d627382 100644
--- a/tests/sksl/fp/GrSectionInitializers.h
+++ b/tests/sksl/fp/GrSectionInitializers.h
@@ -25,7 +25,7 @@
: INHERITED(kGrSectionInitializers_ClassID, kNone_OptimizationFlags)
, initializers section {
}
- GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
+ std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override;
void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
bool onIsEqual(const GrFragmentProcessor&) const override;
#if GR_TEST_UTILS
diff --git a/tests/sksl/fp/GrSectionMake.cpp b/tests/sksl/fp/GrSectionMake.cpp
index 8003900..7ddaad3 100644
--- a/tests/sksl/fp/GrSectionMake.cpp
+++ b/tests/sksl/fp/GrSectionMake.cpp
@@ -28,8 +28,8 @@
void onSetData(const GrGLSLProgramDataManager& pdman, const GrFragmentProcessor& _proc) override {
}
};
-GrGLSLFragmentProcessor* GrSectionMake::onCreateGLSLInstance() const {
- return new GrGLSLSectionMake();
+std::unique_ptr<GrGLSLFragmentProcessor> GrSectionMake::onMakeProgramImpl() const {
+ return std::make_unique<GrGLSLSectionMake>();
}
void GrSectionMake::onGetGLSLProcessorKey(const GrShaderCaps& caps, GrProcessorKeyBuilder* b) const {
}
diff --git a/tests/sksl/fp/GrSectionMake.h b/tests/sksl/fp/GrSectionMake.h
index f00de92..53dd9a4 100644
--- a/tests/sksl/fp/GrSectionMake.h
+++ b/tests/sksl/fp/GrSectionMake.h
@@ -21,7 +21,7 @@
GrSectionMake()
: INHERITED(kGrSectionMake_ClassID, kNone_OptimizationFlags) {
}
- GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
+ std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override;
void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
bool onIsEqual(const GrFragmentProcessor&) const override;
#if GR_TEST_UTILS
diff --git a/tests/sksl/fp/GrSectionSetData.cpp b/tests/sksl/fp/GrSectionSetData.cpp
index 8107312..b5a0f4f 100644
--- a/tests/sksl/fp/GrSectionSetData.cpp
+++ b/tests/sksl/fp/GrSectionSetData.cpp
@@ -37,8 +37,8 @@
varName.set1f(calculated, provided * 2); }
UniformHandle calculatedVar;
};
-GrGLSLFragmentProcessor* GrSectionSetData::onCreateGLSLInstance() const {
- return new GrGLSLSectionSetData();
+std::unique_ptr<GrGLSLFragmentProcessor> GrSectionSetData::onMakeProgramImpl() const {
+ return std::make_unique<GrGLSLSectionSetData>();
}
void GrSectionSetData::onGetGLSLProcessorKey(const GrShaderCaps& caps, GrProcessorKeyBuilder* b) const {
b->add32(sk_bit_cast<uint32_t>(provided));
diff --git a/tests/sksl/fp/GrSectionSetData.h b/tests/sksl/fp/GrSectionSetData.h
index 24cae38..e2cba5a 100644
--- a/tests/sksl/fp/GrSectionSetData.h
+++ b/tests/sksl/fp/GrSectionSetData.h
@@ -26,7 +26,7 @@
: INHERITED(kGrSectionSetData_ClassID, kNone_OptimizationFlags)
, provided(provided) {
}
- GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
+ std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override;
void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
bool onIsEqual(const GrFragmentProcessor&) const override;
#if GR_TEST_UTILS
diff --git a/tests/sksl/fp/GrSectionTest.cpp b/tests/sksl/fp/GrSectionTest.cpp
index 0141b41..e6230a2 100644
--- a/tests/sksl/fp/GrSectionTest.cpp
+++ b/tests/sksl/fp/GrSectionTest.cpp
@@ -28,8 +28,8 @@
void onSetData(const GrGLSLProgramDataManager& pdman, const GrFragmentProcessor& _proc) override {
}
};
-GrGLSLFragmentProcessor* GrSectionTest::onCreateGLSLInstance() const {
- return new GrGLSLSectionTest();
+std::unique_ptr<GrGLSLFragmentProcessor> GrSectionTest::onMakeProgramImpl() const {
+ return std::make_unique<GrGLSLSectionTest>();
}
void GrSectionTest::onGetGLSLProcessorKey(const GrShaderCaps& caps, GrProcessorKeyBuilder* b) const {
}
diff --git a/tests/sksl/fp/GrSectionTest.h b/tests/sksl/fp/GrSectionTest.h
index eccccfe..22e8fe0 100644
--- a/tests/sksl/fp/GrSectionTest.h
+++ b/tests/sksl/fp/GrSectionTest.h
@@ -24,7 +24,7 @@
GrSectionTest()
: INHERITED(kGrSectionTest_ClassID, kNone_OptimizationFlags) {
}
- GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
+ std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override;
void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
bool onIsEqual(const GrFragmentProcessor&) const override;
#if GR_TEST_UTILS
diff --git a/tests/sksl/fp/GrTrackedInUniform.cpp b/tests/sksl/fp/GrTrackedInUniform.cpp
index 5e2d13f..0d6ca29 100644
--- a/tests/sksl/fp/GrTrackedInUniform.cpp
+++ b/tests/sksl/fp/GrTrackedInUniform.cpp
@@ -41,8 +41,8 @@
SkRect colorPrev = SkRect::MakeEmpty();
UniformHandle colorVar;
};
-GrGLSLFragmentProcessor* GrTrackedInUniform::onCreateGLSLInstance() const {
- return new GrGLSLTrackedInUniform();
+std::unique_ptr<GrGLSLFragmentProcessor> GrTrackedInUniform::onMakeProgramImpl() const {
+ return std::make_unique<GrGLSLTrackedInUniform>();
}
void GrTrackedInUniform::onGetGLSLProcessorKey(const GrShaderCaps& caps, GrProcessorKeyBuilder* b) const {
}
diff --git a/tests/sksl/fp/GrTrackedInUniform.h b/tests/sksl/fp/GrTrackedInUniform.h
index 0fefb93..3fbc5e3 100644
--- a/tests/sksl/fp/GrTrackedInUniform.h
+++ b/tests/sksl/fp/GrTrackedInUniform.h
@@ -26,7 +26,7 @@
: INHERITED(kGrTrackedInUniform_ClassID, kNone_OptimizationFlags)
, color(color) {
}
- GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
+ std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override;
void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
bool onIsEqual(const GrFragmentProcessor&) const override;
#if GR_TEST_UTILS
diff --git a/tests/sksl/fp/GrUniform.cpp b/tests/sksl/fp/GrUniform.cpp
index 181146a..b68eecb 100644
--- a/tests/sksl/fp/GrUniform.cpp
+++ b/tests/sksl/fp/GrUniform.cpp
@@ -30,8 +30,8 @@
}
UniformHandle colorVar;
};
-GrGLSLFragmentProcessor* GrUniform::onCreateGLSLInstance() const {
- return new GrGLSLUniform();
+std::unique_ptr<GrGLSLFragmentProcessor> GrUniform::onMakeProgramImpl() const {
+ return std::make_unique<GrGLSLUniform>();
}
void GrUniform::onGetGLSLProcessorKey(const GrShaderCaps& caps, GrProcessorKeyBuilder* b) const {
}
diff --git a/tests/sksl/fp/GrUniform.h b/tests/sksl/fp/GrUniform.h
index 0e8f244..bee7a94 100644
--- a/tests/sksl/fp/GrUniform.h
+++ b/tests/sksl/fp/GrUniform.h
@@ -24,7 +24,7 @@
GrUniform()
: INHERITED(kGrUniform_ClassID, kNone_OptimizationFlags) {
}
- GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
+ std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override;
void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
bool onIsEqual(const GrFragmentProcessor&) const override;
#if GR_TEST_UTILS
diff --git a/tests/sksl/fp/GrUniformArrays.cpp b/tests/sksl/fp/GrUniformArrays.cpp
index 0811b84..83afadb 100644
--- a/tests/sksl/fp/GrUniformArrays.cpp
+++ b/tests/sksl/fp/GrUniformArrays.cpp
@@ -32,8 +32,8 @@
UniformHandle scalarArrayVar;
UniformHandle pointArrayVar;
};
-GrGLSLFragmentProcessor* GrUniformArrays::onCreateGLSLInstance() const {
- return new GrGLSLUniformArrays();
+std::unique_ptr<GrGLSLFragmentProcessor> GrUniformArrays::onMakeProgramImpl() const {
+ return std::make_unique<GrGLSLUniformArrays>();
}
void GrUniformArrays::onGetGLSLProcessorKey(const GrShaderCaps& caps, GrProcessorKeyBuilder* b) const {
}
diff --git a/tests/sksl/fp/GrUniformArrays.h b/tests/sksl/fp/GrUniformArrays.h
index d2f3465..ee3339f 100644
--- a/tests/sksl/fp/GrUniformArrays.h
+++ b/tests/sksl/fp/GrUniformArrays.h
@@ -24,7 +24,7 @@
GrUniformArrays()
: INHERITED(kGrUniformArrays_ClassID, kNone_OptimizationFlags) {
}
- GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
+ std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override;
void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
bool onIsEqual(const GrFragmentProcessor&) const override;
#if GR_TEST_UTILS
diff --git a/tests/sksl/fp/GrUseExplicitReturn.cpp b/tests/sksl/fp/GrUseExplicitReturn.cpp
index c82c592..e669c69 100644
--- a/tests/sksl/fp/GrUseExplicitReturn.cpp
+++ b/tests/sksl/fp/GrUseExplicitReturn.cpp
@@ -28,8 +28,8 @@
void onSetData(const GrGLSLProgramDataManager& pdman, const GrFragmentProcessor& _proc) override {
}
};
-GrGLSLFragmentProcessor* GrUseExplicitReturn::onCreateGLSLInstance() const {
- return new GrGLSLUseExplicitReturn();
+std::unique_ptr<GrGLSLFragmentProcessor> GrUseExplicitReturn::onMakeProgramImpl() const {
+ return std::make_unique<GrGLSLUseExplicitReturn>();
}
void GrUseExplicitReturn::onGetGLSLProcessorKey(const GrShaderCaps& caps, GrProcessorKeyBuilder* b) const {
}
diff --git a/tests/sksl/fp/GrUseExplicitReturn.h b/tests/sksl/fp/GrUseExplicitReturn.h
index de44fc2..8f14ef7 100644
--- a/tests/sksl/fp/GrUseExplicitReturn.h
+++ b/tests/sksl/fp/GrUseExplicitReturn.h
@@ -24,7 +24,7 @@
GrUseExplicitReturn()
: INHERITED(kGrUseExplicitReturn_ClassID, kNone_OptimizationFlags) {
}
- GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
+ std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override;
void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
bool onIsEqual(const GrFragmentProcessor&) const override;
#if GR_TEST_UTILS