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

Unified Diff: src/gpu/effects/GrOvalEffect.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/GrMatrixConvolutionEffect.cpp ('k') | src/gpu/effects/GrPorterDuffXferProcessor.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/effects/GrOvalEffect.cpp
diff --git a/src/gpu/effects/GrOvalEffect.cpp b/src/gpu/effects/GrOvalEffect.cpp
index 7b9fd0a7c8474c44fcd13f86de42de335f2ada49..1b6df12790c0edba9abf00376eb956ae74b23ec1 100644
--- a/src/gpu/effects/GrOvalEffect.cpp
+++ b/src/gpu/effects/GrOvalEffect.cpp
@@ -75,17 +75,14 @@ bool CircleEffect::onIsEqual(const GrFragmentProcessor& other) const {
GR_DEFINE_FRAGMENT_PROCESSOR_TEST(CircleEffect);
-GrFragmentProcessor* CircleEffect::TestCreate(SkRandom* random,
- GrContext*,
- const GrCaps& caps,
- GrTexture*[]) {
+GrFragmentProcessor* CircleEffect::TestCreate(GrProcessorTestData* d) {
SkPoint center;
- center.fX = random->nextRangeScalar(0.f, 1000.f);
- center.fY = random->nextRangeScalar(0.f, 1000.f);
- SkScalar radius = random->nextRangeF(0.f, 1000.f);
+ center.fX = d->fRandom->nextRangeScalar(0.f, 1000.f);
+ center.fY = d->fRandom->nextRangeScalar(0.f, 1000.f);
+ SkScalar radius = d->fRandom->nextRangeF(0.f, 1000.f);
GrPrimitiveEdgeType et;
do {
- et = (GrPrimitiveEdgeType)random->nextULessThan(kGrProcessorEdgeTypeCnt);
+ et = (GrPrimitiveEdgeType)d->fRandom->nextULessThan(kGrProcessorEdgeTypeCnt);
} while (kHairlineAA_GrProcessorEdgeType == et);
return CircleEffect::Create(et, center, radius);
}
@@ -257,18 +254,15 @@ bool EllipseEffect::onIsEqual(const GrFragmentProcessor& other) const {
GR_DEFINE_FRAGMENT_PROCESSOR_TEST(EllipseEffect);
-GrFragmentProcessor* EllipseEffect::TestCreate(SkRandom* random,
- GrContext*,
- const GrCaps& caps,
- GrTexture*[]) {
+GrFragmentProcessor* EllipseEffect::TestCreate(GrProcessorTestData* d) {
SkPoint center;
- center.fX = random->nextRangeScalar(0.f, 1000.f);
- center.fY = random->nextRangeScalar(0.f, 1000.f);
- SkScalar rx = random->nextRangeF(0.f, 1000.f);
- SkScalar ry = random->nextRangeF(0.f, 1000.f);
+ center.fX = d->fRandom->nextRangeScalar(0.f, 1000.f);
+ center.fY = d->fRandom->nextRangeScalar(0.f, 1000.f);
+ SkScalar rx = d->fRandom->nextRangeF(0.f, 1000.f);
+ SkScalar ry = d->fRandom->nextRangeF(0.f, 1000.f);
GrPrimitiveEdgeType et;
do {
- et = (GrPrimitiveEdgeType)random->nextULessThan(kGrProcessorEdgeTypeCnt);
+ et = (GrPrimitiveEdgeType)d->fRandom->nextULessThan(kGrProcessorEdgeTypeCnt);
} while (kHairlineAA_GrProcessorEdgeType == et);
return EllipseEffect::Create(et, center, rx, ry);
}
« no previous file with comments | « src/gpu/effects/GrMatrixConvolutionEffect.cpp ('k') | src/gpu/effects/GrPorterDuffXferProcessor.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698