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

Unified Diff: src/effects/SkLumaColorFilter.cpp

Issue 1368423003: Use child processors to implement compose color filter. (Closed) Base URL: https://skia.googlesource.com/skia.git@upm
Patch Set: Address comments Created 5 years, 3 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/effects/SkColorMatrixFilter.cpp ('k') | src/effects/SkTableColorFilter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/SkLumaColorFilter.cpp
diff --git a/src/effects/SkLumaColorFilter.cpp b/src/effects/SkLumaColorFilter.cpp
index 7e16f3ac89b6ce3abb3575821d73d4a495b01ccc..8c89ab054454a1094297fe5970ec98aba948be05 100644
--- a/src/effects/SkLumaColorFilter.cpp
+++ b/src/effects/SkLumaColorFilter.cpp
@@ -54,7 +54,7 @@ void SkLumaColorFilter::toString(SkString* str) const {
#if SK_SUPPORT_GPU
class LumaColorFilterEffect : public GrFragmentProcessor {
public:
- static GrFragmentProcessor* Create() {
+ static const GrFragmentProcessor* Create() {
static LumaColorFilterEffect gLumaEffect;
return SkRef(&gLumaEffect);
}
@@ -108,19 +108,9 @@ private:
}
};
-bool SkLumaColorFilter::asFragmentProcessors(GrContext*, GrProcessorDataManager*,
- SkTDArray<const GrFragmentProcessor*>* array) const {
+const GrFragmentProcessor* SkLumaColorFilter::asFragmentProcessor(GrContext*,
+ GrProcessorDataManager*) const {
- GrFragmentProcessor* frag = LumaColorFilterEffect::Create();
- if (frag) {
- if (array) {
- *array->append() = frag;
- } else {
- frag->unref();
- SkDEBUGCODE(frag = nullptr;)
- }
- return true;
- }
- return false;
+ return LumaColorFilterEffect::Create();
}
#endif
« no previous file with comments | « src/effects/SkColorMatrixFilter.cpp ('k') | src/effects/SkTableColorFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698