Index: src/effects/SkColorFilters.cpp |
diff --git a/src/effects/SkColorFilters.cpp b/src/effects/SkColorFilters.cpp |
index d53e20cf0686423f76c8233db666284e3bfae036..43478c834d32ff33de31e588aaf663ea7f6c4340 100644 |
--- a/src/effects/SkColorFilters.cpp |
+++ b/src/effects/SkColorFilters.cpp |
@@ -392,10 +392,12 @@ GrEffectRef* ModeColorFilterEffect::TestCreate(SkRandom* rand, |
GrContext*, |
const GrDrawTargetCaps&, |
GrTexture*[]) { |
- int mode = rand->nextRangeU(0, SkXfermode::kLastCoeffMode); |
+ SkXfermode::Mode mode = SkXfermode::kDst_Mode; |
+ while (SkXfermode::kDst_Mode == mode) { |
+ mode = static_cast<SkXfermode::Mode>(rand->nextRangeU(0, SkXfermode::kLastCoeffMode)); |
+ } |
GrColor color = rand->nextU(); |
- static AutoEffectUnref gEffect(SkNEW_ARGS(ModeColorFilterEffect, (color, static_cast<SkXfermode::Mode>(mode)))); |
- return CreateEffectRef(gEffect); |
+ return ModeColorFilterEffect::Create(color, mode); |
} |
GrEffectRef* SkModeColorFilter::asNewEffect(GrContext*) const { |