Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(142)

Unified Diff: src/core/SkColorFilterShader.cpp

Issue 2041113004: sk_sp for gpu. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Reserve correctly. Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/core/SkColorFilterShader.h ('k') | src/core/SkColorMatrixFilterRowMajor255.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkColorFilterShader.cpp
diff --git a/src/core/SkColorFilterShader.cpp b/src/core/SkColorFilterShader.cpp
index 4ab232aa38dc515ea4c803a90449bf6ddf089410..6f9fc978191adcc7af1c56972e045f6dccd84af4 100644
--- a/src/core/SkColorFilterShader.cpp
+++ b/src/core/SkColorFilterShader.cpp
@@ -97,27 +97,25 @@ void SkColorFilterShader::FilterShaderContext::shadeSpan4f(int x, int y, SkPM4f
#if SK_SUPPORT_GPU
/////////////////////////////////////////////////////////////////////
-const GrFragmentProcessor* SkColorFilterShader::asFragmentProcessor(
+sk_sp<GrFragmentProcessor> SkColorFilterShader::asFragmentProcessor(
GrContext* context,
const SkMatrix& viewM,
const SkMatrix* localMatrix,
SkFilterQuality fq,
SkSourceGammaTreatment gammaTreatment) const {
- SkAutoTUnref<const GrFragmentProcessor> fp1(fShader->asFragmentProcessor(context, viewM,
- localMatrix, fq,
- gammaTreatment));
- if (!fp1.get()) {
+ sk_sp<GrFragmentProcessor> fp1(fShader->asFragmentProcessor(context, viewM, localMatrix, fq,
+ gammaTreatment));
+ if (!fp1) {
return nullptr;
}
- SkAutoTUnref<const GrFragmentProcessor> fp2(fFilter->asFragmentProcessor(context));
- if (!fp2.get()) {
- return fp1.release();
+ sk_sp<GrFragmentProcessor> fp2(fFilter->asFragmentProcessor(context));
+ if (!fp2) {
+ return fp1;
}
- const GrFragmentProcessor* fpSeries[] = { fp1.get(), fp2.get() };
-
+ sk_sp<GrFragmentProcessor> fpSeries[] = { std::move(fp1), std::move(fp2) };
return GrFragmentProcessor::RunInSeries(fpSeries, 2);
}
#endif
« no previous file with comments | « src/core/SkColorFilterShader.h ('k') | src/core/SkColorMatrixFilterRowMajor255.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698