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

Unified Diff: src/image/SkImageShader.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/image/SkImageShader.h ('k') | src/image/SkImage_Gpu.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/image/SkImageShader.cpp
diff --git a/src/image/SkImageShader.cpp b/src/image/SkImageShader.cpp
index b2fab39e11869291a8d3b854a7e46c779d261bb9..33edfdeb578849fc6b9490562511e3391be89b94 100644
--- a/src/image/SkImageShader.cpp
+++ b/src/image/SkImageShader.cpp
@@ -83,7 +83,7 @@ void SkImageShader::toString(SkString* str) const {
#include "effects/GrBicubicEffect.h"
#include "effects/GrSimpleTextureEffect.h"
-const GrFragmentProcessor* SkImageShader::asFragmentProcessor(
+sk_sp<GrFragmentProcessor> SkImageShader::asFragmentProcessor(
GrContext* context,
const SkMatrix& viewM,
const SkMatrix* localMatrix,
@@ -120,17 +120,17 @@ const GrFragmentProcessor* SkImageShader::asFragmentProcessor(
return nullptr;
}
- SkAutoTUnref<const GrFragmentProcessor> inner;
+ sk_sp<GrFragmentProcessor> inner;
if (doBicubic) {
- inner.reset(GrBicubicEffect::Create(texture, matrix, tm));
+ inner = GrBicubicEffect::Make(texture, matrix, tm);
} else {
- inner.reset(GrSimpleTextureEffect::Create(texture, matrix, params));
+ inner = GrSimpleTextureEffect::Make(texture, matrix, params);
}
if (GrPixelConfigIsAlphaOnly(texture->config())) {
- return SkRef(inner.get());
+ return inner;
}
- return GrFragmentProcessor::MulOutputByInputAlpha(inner);
+ return sk_sp<GrFragmentProcessor>(GrFragmentProcessor::MulOutputByInputAlpha(std::move(inner)));
}
#endif
« no previous file with comments | « src/image/SkImageShader.h ('k') | src/image/SkImage_Gpu.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698