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

Unified Diff: src/core/SkComposeShader.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/SkComposeShader.h ('k') | src/core/SkImageFilter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkComposeShader.cpp
diff --git a/src/core/SkComposeShader.cpp b/src/core/SkComposeShader.cpp
index 13569f1b48d9d0d44c04b726e606fa4736c352aa..e9f3f4c6180f5f6ac6547fd9c2c4d7eae0350c69 100644
--- a/src/core/SkComposeShader.cpp
+++ b/src/core/SkComposeShader.cpp
@@ -183,7 +183,7 @@ void SkComposeShader::ComposeShaderContext::shadeSpan(int x, int y, SkPMColor re
/////////////////////////////////////////////////////////////////////
-const GrFragmentProcessor* SkComposeShader::asFragmentProcessor(
+sk_sp<GrFragmentProcessor> SkComposeShader::asFragmentProcessor(
GrContext* context,
const SkMatrix& viewM,
const SkMatrix* localMatrix,
@@ -197,8 +197,8 @@ const GrFragmentProcessor* SkComposeShader::asFragmentProcessor(
switch (mode) {
case SkXfermode::kClear_Mode:
- return GrConstColorProcessor::Create(GrColor_TRANSPARENT_BLACK,
- GrConstColorProcessor::kIgnore_InputMode);
+ return GrConstColorProcessor::Make(GrColor_TRANSPARENT_BLACK,
+ GrConstColorProcessor::kIgnore_InputMode);
break;
case SkXfermode::kSrc_Mode:
return fShaderB->asFragmentProcessor(context, viewM, localMatrix, fq, gammaTreatment);
@@ -207,17 +207,18 @@ const GrFragmentProcessor* SkComposeShader::asFragmentProcessor(
return fShaderA->asFragmentProcessor(context, viewM, localMatrix, fq, gammaTreatment);
break;
default:
- SkAutoTUnref<const GrFragmentProcessor> fpA(fShaderA->asFragmentProcessor(context,
- viewM, localMatrix, fq, gammaTreatment));
- if (!fpA.get()) {
+ sk_sp<GrFragmentProcessor> fpA(fShaderA->asFragmentProcessor(context,
+ viewM, localMatrix, fq, gammaTreatment));
+ if (!fpA) {
return nullptr;
}
- SkAutoTUnref<const GrFragmentProcessor> fpB(fShaderB->asFragmentProcessor(context,
- viewM, localMatrix, fq, gammaTreatment));
- if (!fpB.get()) {
+ sk_sp<GrFragmentProcessor> fpB(fShaderB->asFragmentProcessor(context,
+ viewM, localMatrix, fq, gammaTreatment));
+ if (!fpB) {
return nullptr;
}
- return GrXfermodeFragmentProcessor::CreateFromTwoProcessors(fpB, fpA, mode);
+ return GrXfermodeFragmentProcessor::MakeFromTwoProcessors(std::move(fpB),
+ std::move(fpA), mode);
}
}
#endif
« no previous file with comments | « src/core/SkComposeShader.h ('k') | src/core/SkImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698