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

Unified Diff: src/gpu/effects/GrConstColorProcessor.cpp

Issue 1213623022: fix up test create functions (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: more cleanup Created 5 years, 5 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 | « src/gpu/effects/GrConfigConversionEffect.cpp ('k') | src/gpu/effects/GrConvexPolyEffect.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/effects/GrConstColorProcessor.cpp
diff --git a/src/gpu/effects/GrConstColorProcessor.cpp b/src/gpu/effects/GrConstColorProcessor.cpp
index e80e06a4a6396d1bf655e7584e8a79d5c7ea8cb2..964e85c70841bbfbb6f256e634c3a6a4fe7847ad 100644
--- a/src/gpu/effects/GrConstColorProcessor.cpp
+++ b/src/gpu/effects/GrConstColorProcessor.cpp
@@ -105,18 +105,15 @@ bool GrConstColorProcessor::onIsEqual(const GrFragmentProcessor& other) const {
GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrConstColorProcessor);
-GrFragmentProcessor* GrConstColorProcessor::TestCreate(SkRandom* random,
- GrContext*,
- const GrCaps&,
- GrTexture*[]) {
+GrFragmentProcessor* GrConstColorProcessor::TestCreate(GrProcessorTestData* d) {
GrColor color;
- int colorPicker = random->nextULessThan(3);
+ int colorPicker = d->fRandom->nextULessThan(3);
switch (colorPicker) {
case 0: {
- uint32_t a = random->nextULessThan(0x100);
- uint32_t r = random->nextULessThan(a+1);
- uint32_t g = random->nextULessThan(a+1);
- uint32_t b = random->nextULessThan(a+1);
+ uint32_t a = d->fRandom->nextULessThan(0x100);
+ uint32_t r = d->fRandom->nextULessThan(a+1);
+ uint32_t g = d->fRandom->nextULessThan(a+1);
+ uint32_t b = d->fRandom->nextULessThan(a+1);
color = GrColorPackRGBA(r, g, b, a);
break;
}
@@ -124,10 +121,10 @@ GrFragmentProcessor* GrConstColorProcessor::TestCreate(SkRandom* random,
color = 0;
break;
case 2:
- color = random->nextULessThan(0x100);
+ color = d->fRandom->nextULessThan(0x100);
color = color | (color << 8) | (color << 16) | (color << 24);
break;
}
- InputMode mode = static_cast<InputMode>(random->nextULessThan(kInputModeCnt));
+ InputMode mode = static_cast<InputMode>(d->fRandom->nextULessThan(kInputModeCnt));
return GrConstColorProcessor::Create(color, mode);
}
« no previous file with comments | « src/gpu/effects/GrConfigConversionEffect.cpp ('k') | src/gpu/effects/GrConvexPolyEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698