Index: src/effects/SkColorFilters.cpp |
diff --git a/src/effects/SkColorFilters.cpp b/src/effects/SkColorFilters.cpp |
index 0c6a612355fecad8eefd615e44d23c7805917ff0..da01893b74671a9e3659d041780d60a526066ae4 100644 |
--- a/src/effects/SkColorFilters.cpp |
+++ b/src/effects/SkColorFilters.cpp |
@@ -70,36 +70,32 @@ SkFlattenable* SkModeColorFilter::CreateProc(SkReadBuffer& buffer) { |
#include "effects/GrConstColorProcessor.h" |
#include "SkGr.h" |
-bool SkModeColorFilter::asFragmentProcessors(GrContext*, GrProcessorDataManager*, |
- SkTDArray<const GrFragmentProcessor*>* array) const { |
- if (SkXfermode::kDst_Mode != fMode) { |
- SkAutoTUnref<const GrFragmentProcessor> constFP( |
- GrConstColorProcessor::Create(SkColorToPremulGrColor(fColor), |
- GrConstColorProcessor::kIgnore_InputMode)); |
- const GrFragmentProcessor* fp = |
- GrXfermodeFragmentProcessor::CreateFromSrcProcessor(constFP, fMode); |
- if (fp) { |
+const GrFragmentProcessor* SkModeColorFilter::asFragmentProcessor(GrContext*, |
+ GrProcessorDataManager*) const { |
+ if (SkXfermode::kDst_Mode == fMode) { |
+ return nullptr; |
+ } |
+ |
+ SkAutoTUnref<const GrFragmentProcessor> constFP( |
+ GrConstColorProcessor::Create(SkColorToPremulGrColor(fColor), |
+ GrConstColorProcessor::kIgnore_InputMode)); |
+ const GrFragmentProcessor* fp = |
+ GrXfermodeFragmentProcessor::CreateFromSrcProcessor(constFP, fMode); |
+ if (!fp) { |
+ return nullptr; |
+ } |
#ifdef SK_DEBUG |
- // With a solid color input this should always be able to compute the blended color |
- // (at least for coeff modes) |
- if (fMode <= SkXfermode::kLastCoeffMode) { |
- static SkRandom gRand; |
- GrInvariantOutput io(GrPremulColor(gRand.nextU()), kRGBA_GrColorComponentFlags, |
- false); |
- fp->computeInvariantOutput(&io); |
- SkASSERT(io.validFlags() == kRGBA_GrColorComponentFlags); |
- } |
-#endif |
- if (array) { |
- *array->append() = fp; |
- } else { |
- fp->unref(); |
- SkDEBUGCODE(fp = nullptr;) |
- } |
- return true; |
- } |
+ // With a solid color input this should always be able to compute the blended color |
+ // (at least for coeff modes) |
+ if (fMode <= SkXfermode::kLastCoeffMode) { |
+ static SkRandom gRand; |
+ GrInvariantOutput io(GrPremulColor(gRand.nextU()), kRGBA_GrColorComponentFlags, |
+ false); |
+ fp->computeInvariantOutput(&io); |
+ SkASSERT(io.validFlags() == kRGBA_GrColorComponentFlags); |
} |
- return false; |
+#endif |
+ return fp; |
} |
#endif |