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

Unified Diff: src/effects/SkColorMatrixFilter.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/SkColorFilters.cpp ('k') | src/effects/SkLumaColorFilter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/SkColorMatrixFilter.cpp
diff --git a/src/effects/SkColorMatrixFilter.cpp b/src/effects/SkColorMatrixFilter.cpp
index 6131b264e7f202c78a054bbb6efc872e5f8c7169..7c121b1b428a9809bb0545f112e012dc26224137 100644
--- a/src/effects/SkColorMatrixFilter.cpp
+++ b/src/effects/SkColorMatrixFilter.cpp
@@ -390,7 +390,7 @@ SkColorFilter* SkColorMatrixFilter::newComposed(const SkColorFilter* innerFilter
class ColorMatrixEffect : public GrFragmentProcessor {
public:
- static GrFragmentProcessor* Create(const SkColorMatrix& matrix) {
+ static const GrFragmentProcessor* Create(const SkColorMatrix& matrix) {
return new ColorMatrixEffect(matrix);
}
@@ -536,19 +536,9 @@ const GrFragmentProcessor* ColorMatrixEffect::TestCreate(GrProcessorTestData* d)
return ColorMatrixEffect::Create(colorMatrix);
}
-bool SkColorMatrixFilter::asFragmentProcessors(GrContext*, GrProcessorDataManager*,
- SkTDArray<const GrFragmentProcessor*>* array) const {
- GrFragmentProcessor* frag = ColorMatrixEffect::Create(fMatrix);
- if (frag) {
- if (array) {
- *array->append() = frag;
- } else {
- frag->unref();
- SkDEBUGCODE(frag = nullptr;)
- }
- return true;
- }
- return false;
+const GrFragmentProcessor* SkColorMatrixFilter::asFragmentProcessor(GrContext*,
+ GrProcessorDataManager*) const {
+ return ColorMatrixEffect::Create(fMatrix);
}
#endif
« no previous file with comments | « src/effects/SkColorFilters.cpp ('k') | src/effects/SkLumaColorFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698