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

Unified Diff: src/gpu/effects/GrConvolutionEffect.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/GrConvexPolyEffect.cpp ('k') | src/gpu/effects/GrCoverageSetOpXP.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/effects/GrConvolutionEffect.cpp
diff --git a/src/gpu/effects/GrConvolutionEffect.cpp b/src/gpu/effects/GrConvolutionEffect.cpp
index 0dfc3bf54e6c8e06ed5cb5f945894e24fa6c5533..9f3c6c117004db8b6dbbb9eac1626fe5fbfee083 100644
--- a/src/gpu/effects/GrConvolutionEffect.cpp
+++ b/src/gpu/effects/GrConvolutionEffect.cpp
@@ -224,25 +224,22 @@ bool GrConvolutionEffect::onIsEqual(const GrFragmentProcessor& sBase) const {
GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrConvolutionEffect);
-GrFragmentProcessor* GrConvolutionEffect::TestCreate(SkRandom* random,
- GrContext*,
- const GrCaps&,
- GrTexture* textures[]) {
- int texIdx = random->nextBool() ? GrProcessorUnitTest::kSkiaPMTextureIdx :
- GrProcessorUnitTest::kAlphaTextureIdx;
- Direction dir = random->nextBool() ? kX_Direction : kY_Direction;
- int radius = random->nextRangeU(1, kMaxKernelRadius);
+GrFragmentProcessor* GrConvolutionEffect::TestCreate(GrProcessorTestData* d) {
+ int texIdx = d->fRandom->nextBool() ? GrProcessorUnitTest::kSkiaPMTextureIdx :
+ GrProcessorUnitTest::kAlphaTextureIdx;
+ Direction dir = d->fRandom->nextBool() ? kX_Direction : kY_Direction;
+ int radius = d->fRandom->nextRangeU(1, kMaxKernelRadius);
float kernel[kMaxKernelWidth];
for (size_t i = 0; i < SK_ARRAY_COUNT(kernel); ++i) {
- kernel[i] = random->nextSScalar1();
+ kernel[i] = d->fRandom->nextSScalar1();
}
float bounds[2];
for (size_t i = 0; i < SK_ARRAY_COUNT(bounds); ++i) {
- bounds[i] = random->nextF();
+ bounds[i] = d->fRandom->nextF();
}
- bool useBounds = random->nextBool();
- return GrConvolutionEffect::Create(textures[texIdx],
+ bool useBounds = d->fRandom->nextBool();
+ return GrConvolutionEffect::Create(d->fTextures[texIdx],
dir,
radius,
kernel,
« no previous file with comments | « src/gpu/effects/GrConvexPolyEffect.cpp ('k') | src/gpu/effects/GrCoverageSetOpXP.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698