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

Unified Diff: src/core/SkColorFilter.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/SkBitmapProcShader.cpp ('k') | src/core/SkColorFilterShader.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkColorFilter.cpp
diff --git a/src/core/SkColorFilter.cpp b/src/core/SkColorFilter.cpp
index e3d89579471aa6f4c1cb82f18e04360ee08058fd..9470766732146c81723c4bea7a0c3d76f29903fa 100644
--- a/src/core/SkColorFilter.cpp
+++ b/src/core/SkColorFilter.cpp
@@ -31,6 +31,12 @@ bool SkColorFilter::asComponentTable(SkBitmap*) const {
return false;
}
+#if SK_SUPPORT_GPU
+sk_sp<GrFragmentProcessor> SkColorFilter::asFragmentProcessor(GrContext*) const {
+ return nullptr;
+}
+#endif
+
void SkColorFilter::filterSpan4f(const SkPM4f[], int count, SkPM4f span[]) const {
const int N = 128;
SkPMColor tmp[N];
@@ -99,13 +105,13 @@ public:
#endif
#if SK_SUPPORT_GPU
- const GrFragmentProcessor* asFragmentProcessor(GrContext* context) const override {
- SkAutoTUnref<const GrFragmentProcessor> innerFP(fInner->asFragmentProcessor(context));
- SkAutoTUnref<const GrFragmentProcessor> outerFP(fOuter->asFragmentProcessor(context));
+ sk_sp<GrFragmentProcessor> asFragmentProcessor(GrContext* context) const override {
+ sk_sp<GrFragmentProcessor> innerFP(fInner->asFragmentProcessor(context));
+ sk_sp<GrFragmentProcessor> outerFP(fOuter->asFragmentProcessor(context));
if (!innerFP || !outerFP) {
return nullptr;
}
- const GrFragmentProcessor* series[] = { innerFP, outerFP };
+ sk_sp<GrFragmentProcessor> series[] = { std::move(innerFP), std::move(outerFP) };
return GrFragmentProcessor::RunInSeries(series, 2);
}
#endif
« no previous file with comments | « src/core/SkBitmapProcShader.cpp ('k') | src/core/SkColorFilterShader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698