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

Unified Diff: src/effects/SkColorFilters.cpp

Issue 39403002: Fix ModeColorFilterEffect assert during GLProgramsTest (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 2 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 | « 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 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 {
« 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