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>();
}
};