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

Unified Diff: src/core/SkColorFilter.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 | « include/gpu/GrFragmentProcessor.h ('k') | src/effects/SkColorCubeFilter.cpp » ('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 4605a1d7ab8231c068d4fe48072b9ff81de4132c..25e6b2ea7389e7392823ca54cc034e30853cb46d 100644
--- a/src/core/SkColorFilter.cpp
+++ b/src/core/SkColorFilter.cpp
@@ -13,7 +13,9 @@
#include "SkUnPreMultiply.h"
#include "SkWriteBuffer.h"
-class GrFragmentProcessor;
+#if SK_SUPPORT_GPU
+#include "GrFragmentProcessor.h"
+#endif
bool SkColorFilter::asColorMode(SkColor* color, SkXfermode::Mode* mode) const {
return false;
@@ -67,11 +69,15 @@ public:
#endif
#if SK_SUPPORT_GPU
- bool asFragmentProcessors(GrContext* context, GrProcessorDataManager* procDataManager,
- SkTDArray<const GrFragmentProcessor*>* array) const override {
- bool hasFrags = fInner->asFragmentProcessors(context, procDataManager, array);
- hasFrags |= fOuter->asFragmentProcessors(context, procDataManager, array);
- return hasFrags;
+ const GrFragmentProcessor* asFragmentProcessor(GrContext* context,
+ GrProcessorDataManager* pdm) const override {
+ SkAutoTUnref<const GrFragmentProcessor> innerFP(fInner->asFragmentProcessor(context, pdm));
+ SkAutoTUnref<const GrFragmentProcessor> outerFP(fOuter->asFragmentProcessor(context, pdm));
+ if (!innerFP || !outerFP) {
+ return nullptr;
+ }
+ const GrFragmentProcessor* series[] = { innerFP, outerFP };
+ return GrFragmentProcessor::RunInSeries(series, 2);
}
#endif
« no previous file with comments | « include/gpu/GrFragmentProcessor.h ('k') | src/effects/SkColorCubeFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698