aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/effects/SkColorFilters.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/effects/SkColorFilters.cpp b/src/effects/SkColorFilters.cpp
index 43478c834d..613163e5a6 100644
--- a/src/effects/SkColorFilters.cpp
+++ b/src/effects/SkColorFilters.cpp
@@ -186,6 +186,13 @@ static inline ColorExpr color_filter_expression(const SkXfermode::Mode& mode,
class ModeColorFilterEffect : public GrEffect {
public:
static GrEffectRef* Create(const GrColor& c, SkXfermode::Mode mode) {
+ // TODO: Make the effect take the coeffs rather than mode since we already do the
+ // conversion here.
+ SkXfermode::Coeff srcCoeff, dstCoeff;
+ if (!SkXfermode::ModeAsCoeff(mode, &srcCoeff, &dstCoeff)) {
+ SkDebugf("Failing to create color filter for mode %d\n", mode);
+ return NULL;
+ }
AutoEffectUnref effect(SkNEW_ARGS(ModeColorFilterEffect, (c, mode)));
return CreateEffectRef(effect);
}