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

Unified Diff: src/effects/SkColorFilters.cpp

Issue 53983005: Check that Mode is valid for ModeColorFilterEffect (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: add comment Created 7 years, 1 month 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/SkColorFilters.cpp
diff --git a/src/effects/SkColorFilters.cpp b/src/effects/SkColorFilters.cpp
index 43478c834d32ff33de31e588aaf663ea7f6c4340..613163e5a6c5d069eeab9cdff0b6eeef9901866d 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);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698