aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/sksl/SkSLCPPCodeGenerator.cpp
diff options
context:
space:
mode:
authorGravatar Brian Salomon <bsalomon@google.com>2017-08-11 09:40:37 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-08-11 14:13:26 +0000
commitaff329b8e9b239bca1d93b13a914fbef45ccf7fe (patch)
tree06ba42a557c6695f145bcf4956c981fc87af55ff /src/sksl/SkSLCPPCodeGenerator.cpp
parente2cbd0451832ec71d1b498e0f64d02b7d096b2b7 (diff)
Make GrFragmentProcessor be non-refcounted and use std::unique_ptr.
Change-Id: I985e54a071338e99292a5aa2f42c92bc115b4008 Reviewed-on: https://skia-review.googlesource.com/32760 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Brian Osman <brianosman@google.com>
Diffstat (limited to 'src/sksl/SkSLCPPCodeGenerator.cpp')
-rw-r--r--src/sksl/SkSLCPPCodeGenerator.cpp19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/sksl/SkSLCPPCodeGenerator.cpp b/src/sksl/SkSLCPPCodeGenerator.cpp
index 76faef9aae..bc47ff0ce3 100644
--- a/src/sksl/SkSLCPPCodeGenerator.cpp
+++ b/src/sksl/SkSLCPPCodeGenerator.cpp
@@ -543,8 +543,10 @@ void CPPCodeGenerator::writeClone() {
this->writef(" this->addCoordTransform(&%sCoordTransform);\n", field.c_str());
}
this->write("}\n");
- this->writef("sk_sp<GrFragmentProcessor> %s::clone() const {\n", fFullName.c_str());
- this->writef(" return sk_sp<GrFragmentProcessor>(new %s(*this));\n", fFullName.c_str());
+ this->writef("std::unique_ptr<GrFragmentProcessor> %s::clone() const {\n",
+ fFullName.c_str());
+ this->writef(" return std::unique_ptr<GrFragmentProcessor>(new %s(*this));\n",
+ fFullName.c_str());
this->write("}\n");
}
}
@@ -552,12 +554,13 @@ void CPPCodeGenerator::writeClone() {
void CPPCodeGenerator::writeTest() {
const Section* test = fSectionAndParameterHelper.getSection(TEST_CODE_SECTION);
if (test) {
- this->writef("GR_DEFINE_FRAGMENT_PROCESSOR_TEST(%s);\n"
- "#if GR_TEST_UTILS\n"
- "sk_sp<GrFragmentProcessor> %s::TestCreate(GrProcessorTestData* %s) {\n",
- fFullName.c_str(),
- fFullName.c_str(),
- test->fArgument.c_str());
+ this->writef(
+ "GR_DEFINE_FRAGMENT_PROCESSOR_TEST(%s);\n"
+ "#if GR_TEST_UTILS\n"
+ "std::unique_ptr<GrFragmentProcessor> %s::TestCreate(GrProcessorTestData* %s) {\n",
+ fFullName.c_str(),
+ fFullName.c_str(),
+ test->fArgument.c_str());
this->writeSection(TEST_CODE_SECTION);
this->write("}\n"
"#endif\n");