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

Unified Diff: src/gpu/effects/GrConvexPolyEffect.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/GrConstColorProcessor.cpp ('k') | src/gpu/effects/GrConvolutionEffect.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/effects/GrConvexPolyEffect.cpp
diff --git a/src/gpu/effects/GrConvexPolyEffect.cpp b/src/gpu/effects/GrConvexPolyEffect.cpp
index c42ac5326c3a9e4dbe2009193fbafe113d5a841f..a3d032f4a0f106ff7bc59e4dbf5aa0a39b330481 100644
--- a/src/gpu/effects/GrConvexPolyEffect.cpp
+++ b/src/gpu/effects/GrConvexPolyEffect.cpp
@@ -60,18 +60,15 @@ private:
GR_DEFINE_FRAGMENT_PROCESSOR_TEST(AARectEffect);
-GrFragmentProcessor* AARectEffect::TestCreate(SkRandom* random,
- GrContext*,
- const GrCaps& caps,
- GrTexture*[]) {
- SkRect rect = SkRect::MakeLTRB(random->nextSScalar1(),
- random->nextSScalar1(),
- random->nextSScalar1(),
- random->nextSScalar1());
+GrFragmentProcessor* AARectEffect::TestCreate(GrProcessorTestData* d) {
+ SkRect rect = SkRect::MakeLTRB(d->fRandom->nextSScalar1(),
+ d->fRandom->nextSScalar1(),
+ d->fRandom->nextSScalar1(),
+ d->fRandom->nextSScalar1());
GrFragmentProcessor* fp;
do {
- GrPrimitiveEdgeType edgeType = static_cast<GrPrimitiveEdgeType>(random->nextULessThan(
- kGrProcessorEdgeTypeCnt));
+ GrPrimitiveEdgeType edgeType = static_cast<GrPrimitiveEdgeType>(
+ d->fRandom->nextULessThan(kGrProcessorEdgeTypeCnt));
fp = AARectEffect::Create(edgeType, rect);
} while (NULL == fp);
@@ -360,20 +357,17 @@ bool GrConvexPolyEffect::onIsEqual(const GrFragmentProcessor& other) const {
GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrConvexPolyEffect);
-GrFragmentProcessor* GrConvexPolyEffect::TestCreate(SkRandom* random,
- GrContext*,
- const GrCaps& caps,
- GrTexture*[]) {
- int count = random->nextULessThan(kMaxEdges) + 1;
+GrFragmentProcessor* GrConvexPolyEffect::TestCreate(GrProcessorTestData* d) {
+ int count = d->fRandom->nextULessThan(kMaxEdges) + 1;
SkScalar edges[kMaxEdges * 3];
for (int i = 0; i < 3 * count; ++i) {
- edges[i] = random->nextSScalar1();
+ edges[i] = d->fRandom->nextSScalar1();
}
GrFragmentProcessor* fp;
do {
GrPrimitiveEdgeType edgeType = static_cast<GrPrimitiveEdgeType>(
- random->nextULessThan(kGrProcessorEdgeTypeCnt));
+ d->fRandom->nextULessThan(kGrProcessorEdgeTypeCnt));
fp = GrConvexPolyEffect::Create(edgeType, count, edges);
} while (NULL == fp);
return fp;
« no previous file with comments | « src/gpu/effects/GrConstColorProcessor.cpp ('k') | src/gpu/effects/GrConvolutionEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698