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

Unified Diff: src/effects/SkTableColorFilter.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/effects/SkPerlinNoiseShader.cpp ('k') | src/effects/gradients/SkLinearGradient.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/SkTableColorFilter.cpp
diff --git a/src/effects/SkTableColorFilter.cpp b/src/effects/SkTableColorFilter.cpp
index e4bc778a8e974477576e0528dc936494ef42dc23..faffa4a43dea2d8af2998fc022c445cc96d418e9 100644
--- a/src/effects/SkTableColorFilter.cpp
+++ b/src/effects/SkTableColorFilter.cpp
@@ -551,21 +551,18 @@ void ColorTableEffect::onComputeInvariantOutput(GrInvariantOutput* inout) const
GR_DEFINE_FRAGMENT_PROCESSOR_TEST(ColorTableEffect);
-GrFragmentProcessor* ColorTableEffect::TestCreate(SkRandom* random,
- GrContext* context,
- const GrCaps&,
- GrTexture* textures[]) {
+GrFragmentProcessor* ColorTableEffect::TestCreate(GrProcessorTestData* d) {
int flags = 0;
uint8_t luts[256][4];
do {
for (int i = 0; i < 4; ++i) {
- flags |= random->nextBool() ? (1 << i): 0;
+ flags |= d->fRandom->nextBool() ? (1 << i): 0;
}
} while (!flags);
for (int i = 0; i < 4; ++i) {
if (flags & (1 << i)) {
for (int j = 0; j < 256; ++j) {
- luts[j][i] = SkToU8(random->nextBits(8));
+ luts[j][i] = SkToU8(d->fRandom->nextBits(8));
}
}
}
@@ -577,8 +574,7 @@ GrFragmentProcessor* ColorTableEffect::TestCreate(SkRandom* random,
));
SkTDArray<GrFragmentProcessor*> array;
- GrPaint grPaint;
- if (filter->asFragmentProcessors(context, grPaint.getShaderDataManager(), &array)) {
+ if (filter->asFragmentProcessors(d->fContext, d->fShaderDataManager, &array)) {
SkASSERT(1 == array.count()); // TableColorFilter only returns 1
return array[0];
}
« no previous file with comments | « src/effects/SkPerlinNoiseShader.cpp ('k') | src/effects/gradients/SkLinearGradient.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698