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

Unified Diff: src/effects/SkLightingImageFilter.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/SkDisplacementMapEffect.cpp ('k') | src/effects/SkMagnifierImageFilter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/SkLightingImageFilter.cpp
diff --git a/src/effects/SkLightingImageFilter.cpp b/src/effects/SkLightingImageFilter.cpp
index 1b309abd0aa0905912a24d01e5c7ac47a860513f..3a96bc3b9a2dd5ac7ced55ee8a4e4f0db1d30cb7 100644
--- a/src/effects/SkLightingImageFilter.cpp
+++ b/src/effects/SkLightingImageFilter.cpp
@@ -1597,19 +1597,16 @@ GrGLFragmentProcessor* GrDiffuseLightingEffect::createGLInstance() const {
GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrDiffuseLightingEffect);
-GrFragmentProcessor* GrDiffuseLightingEffect::TestCreate(SkRandom* random,
- GrContext* context,
- const GrCaps&,
- GrTexture* textures[]) {
- SkScalar surfaceScale = random->nextSScalar1();
- SkScalar kd = random->nextUScalar1();
- SkAutoTUnref<SkLight> light(create_random_light(random));
+GrFragmentProcessor* GrDiffuseLightingEffect::TestCreate(GrProcessorTestData* d) {
+ SkScalar surfaceScale = d->fRandom->nextSScalar1();
+ SkScalar kd = d->fRandom->nextUScalar1();
+ SkAutoTUnref<SkLight> light(create_random_light(d->fRandom));
SkMatrix matrix;
for (int i = 0; i < 9; i++) {
- matrix[i] = random->nextUScalar1();
+ matrix[i] = d->fRandom->nextUScalar1();
}
- BoundaryMode mode = static_cast<BoundaryMode>(random->nextU() % kBoundaryModeCount);
- return GrDiffuseLightingEffect::Create(textures[GrProcessorUnitTest::kAlphaTextureIdx],
+ BoundaryMode mode = static_cast<BoundaryMode>(d->fRandom->nextU() % kBoundaryModeCount);
+ return GrDiffuseLightingEffect::Create(d->fTextures[GrProcessorUnitTest::kAlphaTextureIdx],
light, surfaceScale, matrix, kd, mode);
}
@@ -1805,20 +1802,17 @@ GrGLFragmentProcessor* GrSpecularLightingEffect::createGLInstance() const {
GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrSpecularLightingEffect);
-GrFragmentProcessor* GrSpecularLightingEffect::TestCreate(SkRandom* random,
- GrContext* context,
- const GrCaps&,
- GrTexture* textures[]) {
- SkScalar surfaceScale = random->nextSScalar1();
- SkScalar ks = random->nextUScalar1();
- SkScalar shininess = random->nextUScalar1();
- SkAutoTUnref<SkLight> light(create_random_light(random));
+GrFragmentProcessor* GrSpecularLightingEffect::TestCreate(GrProcessorTestData* d) {
+ SkScalar surfaceScale = d->fRandom->nextSScalar1();
+ SkScalar ks = d->fRandom->nextUScalar1();
+ SkScalar shininess = d->fRandom->nextUScalar1();
+ SkAutoTUnref<SkLight> light(create_random_light(d->fRandom));
SkMatrix matrix;
for (int i = 0; i < 9; i++) {
- matrix[i] = random->nextUScalar1();
+ matrix[i] = d->fRandom->nextUScalar1();
}
- BoundaryMode mode = static_cast<BoundaryMode>(random->nextU() % kBoundaryModeCount);
- return GrSpecularLightingEffect::Create(textures[GrProcessorUnitTest::kAlphaTextureIdx],
+ BoundaryMode mode = static_cast<BoundaryMode>(d->fRandom->nextU() % kBoundaryModeCount);
+ return GrSpecularLightingEffect::Create(d->fTextures[GrProcessorUnitTest::kAlphaTextureIdx],
light, surfaceScale, matrix, ks, shininess, mode);
}
« no previous file with comments | « src/effects/SkDisplacementMapEffect.cpp ('k') | src/effects/SkMagnifierImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698