fix up test create functions

TBR=bsalomon@google.com
BUG=skia:

Review URL: https://codereview.chromium.org/1213623022
diff --git a/src/gpu/effects/GrBezierEffect.cpp b/src/gpu/effects/GrBezierEffect.cpp
index cdea9d0..6f492c7 100644
--- a/src/gpu/effects/GrBezierEffect.cpp
+++ b/src/gpu/effects/GrBezierEffect.cpp
@@ -217,17 +217,15 @@
 
 GR_DEFINE_GEOMETRY_PROCESSOR_TEST(GrConicEffect);
 
-GrGeometryProcessor* GrConicEffect::TestCreate(SkRandom* random,
-                                               GrContext*,
-                                               const GrCaps& caps,
-                                               GrTexture*[]) {
+GrGeometryProcessor* GrConicEffect::TestCreate(GrProcessorTestData* d) {
     GrGeometryProcessor* gp;
     do {
-        GrPrimitiveEdgeType edgeType = static_cast<GrPrimitiveEdgeType>(
-                                                    random->nextULessThan(kGrProcessorEdgeTypeCnt));
-        gp = GrConicEffect::Create(GrRandomColor(random), GrTest::TestMatrix(random),
-                                   edgeType, caps,
-                                   GrTest::TestMatrix(random), random->nextBool());
+        GrPrimitiveEdgeType edgeType =
+                static_cast<GrPrimitiveEdgeType>(
+                        d->fRandom->nextULessThan(kGrProcessorEdgeTypeCnt));
+        gp = GrConicEffect::Create(GrRandomColor(d->fRandom), GrTest::TestMatrix(d->fRandom),
+                                   edgeType, *d->fCaps,
+                                   GrTest::TestMatrix(d->fRandom), d->fRandom->nextBool());
     } while (NULL == gp);
     return gp;
 }
@@ -427,19 +425,16 @@
 
 GR_DEFINE_GEOMETRY_PROCESSOR_TEST(GrQuadEffect);
 
-GrGeometryProcessor* GrQuadEffect::TestCreate(SkRandom* random,
-                                              GrContext*,
-                                              const GrCaps& caps,
-                                              GrTexture*[]) {
+GrGeometryProcessor* GrQuadEffect::TestCreate(GrProcessorTestData* d) {
     GrGeometryProcessor* gp;
     do {
         GrPrimitiveEdgeType edgeType = static_cast<GrPrimitiveEdgeType>(
-                random->nextULessThan(kGrProcessorEdgeTypeCnt));
-        gp = GrQuadEffect::Create(GrRandomColor(random),
-                                  GrTest::TestMatrix(random),
-                                  edgeType, caps,
-                                  GrTest::TestMatrix(random),
-                                  random->nextBool());
+                d->fRandom->nextULessThan(kGrProcessorEdgeTypeCnt));
+        gp = GrQuadEffect::Create(GrRandomColor(d->fRandom),
+                                  GrTest::TestMatrix(d->fRandom),
+                                  edgeType, *d->fCaps,
+                                  GrTest::TestMatrix(d->fRandom),
+                                  d->fRandom->nextBool());
     } while (NULL == gp);
     return gp;
 }
@@ -650,16 +645,14 @@
 
 GR_DEFINE_GEOMETRY_PROCESSOR_TEST(GrCubicEffect);
 
-GrGeometryProcessor* GrCubicEffect::TestCreate(SkRandom* random,
-                                               GrContext*,
-                                               const GrCaps& caps,
-                                               GrTexture*[]) {
+GrGeometryProcessor* GrCubicEffect::TestCreate(GrProcessorTestData* d) {
     GrGeometryProcessor* gp;
     do {
-        GrPrimitiveEdgeType edgeType = static_cast<GrPrimitiveEdgeType>(
-                                                    random->nextULessThan(kGrProcessorEdgeTypeCnt));
-        gp = GrCubicEffect::Create(GrRandomColor(random),
-                                   GrTest::TestMatrix(random), edgeType, caps);
+        GrPrimitiveEdgeType edgeType =
+                static_cast<GrPrimitiveEdgeType>(
+                        d->fRandom->nextULessThan(kGrProcessorEdgeTypeCnt));
+        gp = GrCubicEffect::Create(GrRandomColor(d->fRandom),
+                                   GrTest::TestMatrix(d->fRandom), edgeType, *d->fCaps);
     } while (NULL == gp);
     return gp;
 }
diff --git a/src/gpu/effects/GrBicubicEffect.cpp b/src/gpu/effects/GrBicubicEffect.cpp
index 5d94bd9..c4ceeba 100644
--- a/src/gpu/effects/GrBicubicEffect.cpp
+++ b/src/gpu/effects/GrBicubicEffect.cpp
@@ -180,17 +180,14 @@
 
 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrBicubicEffect);
 
-GrFragmentProcessor* GrBicubicEffect::TestCreate(SkRandom* random,
-                                                 GrContext* context,
-                                                 const GrCaps&,
-                                                 GrTexture* textures[]) {
-    int texIdx = random->nextBool() ? GrProcessorUnitTest::kSkiaPMTextureIdx :
-                                      GrProcessorUnitTest::kAlphaTextureIdx;
+GrFragmentProcessor* GrBicubicEffect::TestCreate(GrProcessorTestData* d) {
+    int texIdx = d->fRandom->nextBool() ? GrProcessorUnitTest::kSkiaPMTextureIdx :
+                                          GrProcessorUnitTest::kAlphaTextureIdx;
     SkScalar coefficients[16];
     for (int i = 0; i < 16; i++) {
-        coefficients[i] = random->nextSScalar1();
+        coefficients[i] = d->fRandom->nextSScalar1();
     }
-    return GrBicubicEffect::Create(textures[texIdx], coefficients);
+    return GrBicubicEffect::Create(d->fTextures[texIdx], coefficients);
 }
 
 //////////////////////////////////////////////////////////////////////////////
diff --git a/src/gpu/effects/GrBitmapTextGeoProc.cpp b/src/gpu/effects/GrBitmapTextGeoProc.cpp
index 2871f86..4bfa016 100644
--- a/src/gpu/effects/GrBitmapTextGeoProc.cpp
+++ b/src/gpu/effects/GrBitmapTextGeoProc.cpp
@@ -152,28 +152,23 @@
 
 GR_DEFINE_GEOMETRY_PROCESSOR_TEST(GrBitmapTextGeoProc);
 
-GrGeometryProcessor* GrBitmapTextGeoProc::TestCreate(SkRandom* random,
-                                                     GrContext*,
-                                                     const GrCaps&,
-                                                     GrTexture* textures[]) {
-    int texIdx = random->nextBool() ? GrProcessorUnitTest::kSkiaPMTextureIdx :
-                                      GrProcessorUnitTest::kAlphaTextureIdx;
+GrGeometryProcessor* GrBitmapTextGeoProc::TestCreate(GrProcessorTestData* d) {
+    int texIdx = d->fRandom->nextBool() ? GrProcessorUnitTest::kSkiaPMTextureIdx :
+                                          GrProcessorUnitTest::kAlphaTextureIdx;
     static const SkShader::TileMode kTileModes[] = {
         SkShader::kClamp_TileMode,
         SkShader::kRepeat_TileMode,
         SkShader::kMirror_TileMode,
     };
     SkShader::TileMode tileModes[] = {
-        kTileModes[random->nextULessThan(SK_ARRAY_COUNT(kTileModes))],
-        kTileModes[random->nextULessThan(SK_ARRAY_COUNT(kTileModes))],
+        kTileModes[d->fRandom->nextULessThan(SK_ARRAY_COUNT(kTileModes))],
+        kTileModes[d->fRandom->nextULessThan(SK_ARRAY_COUNT(kTileModes))],
     };
-    GrTextureParams params(tileModes, random->nextBool() ? GrTextureParams::kBilerp_FilterMode :
+    GrTextureParams params(tileModes, d->fRandom->nextBool() ? GrTextureParams::kBilerp_FilterMode :
                                                            GrTextureParams::kNone_FilterMode);
 
     GrMaskFormat format;
-    switch (random->nextULessThan(3)) {
-        default:
-            SkFAIL("Incomplete enum\n");
+    switch (d->fRandom->nextULessThan(3)) {
         case 0:
             format = kA8_GrMaskFormat;
             break;
@@ -185,6 +180,7 @@
             break;
     }
 
-    return GrBitmapTextGeoProc::Create(GrRandomColor(random), textures[texIdx], params,
-                                       format, GrTest::TestMatrix(random), random->nextBool());
+    return GrBitmapTextGeoProc::Create(GrRandomColor(d->fRandom), d->fTextures[texIdx], params,
+                                       format, GrTest::TestMatrix(d->fRandom),
+                                       d->fRandom->nextBool());
 }
diff --git a/src/gpu/effects/GrConfigConversionEffect.cpp b/src/gpu/effects/GrConfigConversionEffect.cpp
index d5b8a18..8b072f6 100644
--- a/src/gpu/effects/GrConfigConversionEffect.cpp
+++ b/src/gpu/effects/GrConfigConversionEffect.cpp
@@ -128,22 +128,19 @@
 
 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrConfigConversionEffect);
 
-GrFragmentProcessor* GrConfigConversionEffect::TestCreate(SkRandom* random,
-                                                          GrContext*,
-                                                          const GrCaps&,
-                                                          GrTexture* textures[]) {
-    PMConversion pmConv = static_cast<PMConversion>(random->nextULessThan(kPMConversionCnt));
+GrFragmentProcessor* GrConfigConversionEffect::TestCreate(GrProcessorTestData* d) {
+    PMConversion pmConv = static_cast<PMConversion>(d->fRandom->nextULessThan(kPMConversionCnt));
     bool swapRB;
     if (kNone_PMConversion == pmConv) {
         swapRB = true;
     } else {
-        swapRB = random->nextBool();
+        swapRB = d->fRandom->nextBool();
     }
     return SkNEW_ARGS(GrConfigConversionEffect,
-                                      (textures[GrProcessorUnitTest::kSkiaPMTextureIdx],
+                                      (d->fTextures[GrProcessorUnitTest::kSkiaPMTextureIdx],
                                        swapRB,
                                        pmConv,
-                                       GrTest::TestMatrix(random)));
+                                       GrTest::TestMatrix(d->fRandom)));
 }
 
 ///////////////////////////////////////////////////////////////////////////////
diff --git a/src/gpu/effects/GrConstColorProcessor.cpp b/src/gpu/effects/GrConstColorProcessor.cpp
index e80e06a..964e85c 100644
--- a/src/gpu/effects/GrConstColorProcessor.cpp
+++ b/src/gpu/effects/GrConstColorProcessor.cpp
@@ -105,18 +105,15 @@
 
 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrConstColorProcessor);
 
-GrFragmentProcessor* GrConstColorProcessor::TestCreate(SkRandom* random,
-                                                       GrContext*,
-                                                       const GrCaps&,
-                                                       GrTexture*[]) {
+GrFragmentProcessor* GrConstColorProcessor::TestCreate(GrProcessorTestData* d) {
     GrColor color;
-    int colorPicker = random->nextULessThan(3);
+    int colorPicker = d->fRandom->nextULessThan(3);
     switch (colorPicker) {
         case 0: {
-            uint32_t a = random->nextULessThan(0x100);
-            uint32_t r = random->nextULessThan(a+1);
-            uint32_t g = random->nextULessThan(a+1);
-            uint32_t b = random->nextULessThan(a+1);
+            uint32_t a = d->fRandom->nextULessThan(0x100);
+            uint32_t r = d->fRandom->nextULessThan(a+1);
+            uint32_t g = d->fRandom->nextULessThan(a+1);
+            uint32_t b = d->fRandom->nextULessThan(a+1);
             color = GrColorPackRGBA(r, g, b, a);
             break;
         }
@@ -124,10 +121,10 @@
             color = 0;
             break;
         case 2:
-            color = random->nextULessThan(0x100);
+            color = d->fRandom->nextULessThan(0x100);
             color = color | (color << 8) | (color << 16) | (color << 24);
             break;
     }
-    InputMode mode = static_cast<InputMode>(random->nextULessThan(kInputModeCnt));
+    InputMode mode = static_cast<InputMode>(d->fRandom->nextULessThan(kInputModeCnt));
     return GrConstColorProcessor::Create(color, mode);
 }
diff --git a/src/gpu/effects/GrConvexPolyEffect.cpp b/src/gpu/effects/GrConvexPolyEffect.cpp
index c42ac53..a3d032f 100644
--- a/src/gpu/effects/GrConvexPolyEffect.cpp
+++ b/src/gpu/effects/GrConvexPolyEffect.cpp
@@ -60,18 +60,15 @@
 
 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 @@
 
 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;
diff --git a/src/gpu/effects/GrConvolutionEffect.cpp b/src/gpu/effects/GrConvolutionEffect.cpp
index 0dfc3bf..9f3c6c1 100644
--- a/src/gpu/effects/GrConvolutionEffect.cpp
+++ b/src/gpu/effects/GrConvolutionEffect.cpp
@@ -224,25 +224,22 @@
 
 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,
diff --git a/src/gpu/effects/GrCoverageSetOpXP.cpp b/src/gpu/effects/GrCoverageSetOpXP.cpp
index c732098..d7f4347 100644
--- a/src/gpu/effects/GrCoverageSetOpXP.cpp
+++ b/src/gpu/effects/GrCoverageSetOpXP.cpp
@@ -245,12 +245,9 @@
 
 GR_DEFINE_XP_FACTORY_TEST(GrCoverageSetOpXPFactory);
 
-GrXPFactory* GrCoverageSetOpXPFactory::TestCreate(SkRandom* random,
-                                                  GrContext*,
-                                                  const GrCaps&,
-                                                  GrTexture*[]) {
-    SkRegion::Op regionOp = SkRegion::Op(random->nextULessThan(SkRegion::kLastOp + 1));
-    bool invertCoverage = random->nextBool();
+GrXPFactory* GrCoverageSetOpXPFactory::TestCreate(GrProcessorTestData* d) {
+    SkRegion::Op regionOp = SkRegion::Op(d->fRandom->nextULessThan(SkRegion::kLastOp + 1));
+    bool invertCoverage = d->fRandom->nextBool();
     return GrCoverageSetOpXPFactory::Create(regionOp, invertCoverage);
 }
 
diff --git a/src/gpu/effects/GrCustomXfermode.cpp b/src/gpu/effects/GrCustomXfermode.cpp
index 94d50f6..c1ff3af 100644
--- a/src/gpu/effects/GrCustomXfermode.cpp
+++ b/src/gpu/effects/GrCustomXfermode.cpp
@@ -509,15 +509,11 @@
 }
 
 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrCustomXferFP);
-GrFragmentProcessor* GrCustomXferFP::TestCreate(SkRandom* rand,
-                                                GrContext*,
-                                                const GrCaps&,
-                                                GrTexture* textures[]) {
-    int mode = rand->nextRangeU(SkXfermode::kLastCoeffMode + 1, SkXfermode::kLastSeparableMode);
+GrFragmentProcessor* GrCustomXferFP::TestCreate(GrProcessorTestData* d) {
+    int mode = d->fRandom->nextRangeU(SkXfermode::kLastCoeffMode + 1, SkXfermode::kLastSeparableMode);
 
-    GrShaderDataManager shaderDataManager;
-    return SkNEW_ARGS(GrCustomXferFP, (&shaderDataManager, static_cast<SkXfermode::Mode>(mode),
-            textures[0]));
+    return SkNEW_ARGS(GrCustomXferFP, (d->fShaderDataManager, static_cast<SkXfermode::Mode>(mode),
+                                       d->fTextures[0]));
 }
 
 ///////////////////////////////////////////////////////////////////////////////
@@ -817,11 +813,9 @@
 }
 
 GR_DEFINE_XP_FACTORY_TEST(GrCustomXPFactory);
-GrXPFactory* GrCustomXPFactory::TestCreate(SkRandom* rand,
-                                           GrContext*,
-                                           const GrCaps&,
-                                           GrTexture*[]) {
-    int mode = rand->nextRangeU(SkXfermode::kLastCoeffMode + 1, SkXfermode::kLastSeparableMode);
+GrXPFactory* GrCustomXPFactory::TestCreate(GrProcessorTestData* d) {
+    int mode = d->fRandom->nextRangeU(SkXfermode::kLastCoeffMode + 1,
+                                      SkXfermode::kLastSeparableMode);
 
     return SkNEW_ARGS(GrCustomXPFactory, (static_cast<SkXfermode::Mode>(mode)));
 }
diff --git a/src/gpu/effects/GrDashingEffect.cpp b/src/gpu/effects/GrDashingEffect.cpp
index 063bfd1..26a2506 100644
--- a/src/gpu/effects/GrDashingEffect.cpp
+++ b/src/gpu/effects/GrDashingEffect.cpp
@@ -957,14 +957,11 @@
 
 GR_DEFINE_GEOMETRY_PROCESSOR_TEST(DashingCircleEffect);
 
-GrGeometryProcessor* DashingCircleEffect::TestCreate(SkRandom* random,
-                                                     GrContext*,
-                                                     const GrCaps& caps,
-                                                     GrTexture*[]) {
-    DashAAMode aaMode = static_cast<DashAAMode>(random->nextULessThan(kDashAAModeCount));
-    return DashingCircleEffect::Create(GrRandomColor(random),
-                                      aaMode, GrTest::TestMatrix(random),
-                                      random->nextBool());
+GrGeometryProcessor* DashingCircleEffect::TestCreate(GrProcessorTestData* d) {
+    DashAAMode aaMode = static_cast<DashAAMode>(d->fRandom->nextULessThan(kDashAAModeCount));
+    return DashingCircleEffect::Create(GrRandomColor(d->fRandom),
+                                      aaMode, GrTest::TestMatrix(d->fRandom),
+                                      d->fRandom->nextBool());
 }
 
 //////////////////////////////////////////////////////////////////////////////
@@ -1195,13 +1192,11 @@
 
 GR_DEFINE_GEOMETRY_PROCESSOR_TEST(DashingLineEffect);
 
-GrGeometryProcessor* DashingLineEffect::TestCreate(SkRandom* random,
-                                                   GrContext*,
-                                                   const GrCaps& caps,
-                                                   GrTexture*[]) {
-    DashAAMode aaMode = static_cast<DashAAMode>(random->nextULessThan(kDashAAModeCount));
-    return DashingLineEffect::Create(GrRandomColor(random),
-                                     aaMode, GrTest::TestMatrix(random), random->nextBool());
+GrGeometryProcessor* DashingLineEffect::TestCreate(GrProcessorTestData* d) {
+    DashAAMode aaMode = static_cast<DashAAMode>(d->fRandom->nextULessThan(kDashAAModeCount));
+    return DashingLineEffect::Create(GrRandomColor(d->fRandom),
+                                     aaMode, GrTest::TestMatrix(d->fRandom),
+                                     d->fRandom->nextBool());
 }
 
 //////////////////////////////////////////////////////////////////////////////
diff --git a/src/gpu/effects/GrDisableColorXP.cpp b/src/gpu/effects/GrDisableColorXP.cpp
index e3f588a..31d5849 100644
--- a/src/gpu/effects/GrDisableColorXP.cpp
+++ b/src/gpu/effects/GrDisableColorXP.cpp
@@ -108,10 +108,7 @@
 
 GR_DEFINE_XP_FACTORY_TEST(GrDisableColorXPFactory);
 
-GrXPFactory* GrDisableColorXPFactory::TestCreate(SkRandom* random,
-                                                  GrContext*,
-                                                  const GrCaps&,
-                                                  GrTexture*[]) {
+GrXPFactory* GrDisableColorXPFactory::TestCreate(GrProcessorTestData*) {
     return GrDisableColorXPFactory::Create();
 }
 
diff --git a/src/gpu/effects/GrDistanceFieldGeoProc.cpp b/src/gpu/effects/GrDistanceFieldGeoProc.cpp
index fa05275..393a99d 100755
--- a/src/gpu/effects/GrDistanceFieldGeoProc.cpp
+++ b/src/gpu/effects/GrDistanceFieldGeoProc.cpp
@@ -239,33 +239,30 @@
 
 GR_DEFINE_GEOMETRY_PROCESSOR_TEST(GrDistanceFieldA8TextGeoProc);
 
-GrGeometryProcessor* GrDistanceFieldA8TextGeoProc::TestCreate(SkRandom* random,
-                                                              GrContext*,
-                                                              const GrCaps&,
-                                                              GrTexture* textures[]) {
-    int texIdx = random->nextBool() ? GrProcessorUnitTest::kSkiaPMTextureIdx :
-                                      GrProcessorUnitTest::kAlphaTextureIdx;
+GrGeometryProcessor* GrDistanceFieldA8TextGeoProc::TestCreate(GrProcessorTestData* d) {
+    int texIdx = d->fRandom->nextBool() ? GrProcessorUnitTest::kSkiaPMTextureIdx :
+                                          GrProcessorUnitTest::kAlphaTextureIdx;
     static const SkShader::TileMode kTileModes[] = {
         SkShader::kClamp_TileMode,
         SkShader::kRepeat_TileMode,
         SkShader::kMirror_TileMode,
     };
     SkShader::TileMode tileModes[] = {
-        kTileModes[random->nextULessThan(SK_ARRAY_COUNT(kTileModes))],
-        kTileModes[random->nextULessThan(SK_ARRAY_COUNT(kTileModes))],
+        kTileModes[d->fRandom->nextULessThan(SK_ARRAY_COUNT(kTileModes))],
+        kTileModes[d->fRandom->nextULessThan(SK_ARRAY_COUNT(kTileModes))],
     };
-    GrTextureParams params(tileModes, random->nextBool() ? GrTextureParams::kBilerp_FilterMode :
+    GrTextureParams params(tileModes, d->fRandom->nextBool() ? GrTextureParams::kBilerp_FilterMode :
                                                            GrTextureParams::kNone_FilterMode);
 
-    return GrDistanceFieldA8TextGeoProc::Create(GrRandomColor(random),
-                                                GrTest::TestMatrix(random),
-                                                textures[texIdx], params,
+    return GrDistanceFieldA8TextGeoProc::Create(GrRandomColor(d->fRandom),
+                                                GrTest::TestMatrix(d->fRandom),
+                                                d->fTextures[texIdx], params,
 #ifdef SK_GAMMA_APPLY_TO_A8
-                                                random->nextF(),
+                                                d->fRandom->nextF(),
 #endif
-                                                random->nextBool() ?
+                                                d->fRandom->nextBool() ?
                                                     kSimilarity_DistanceFieldEffectFlag : 0,
-                                                random->nextBool());
+                                                    d->fRandom->nextBool());
 }
 
 ///////////////////////////////////////////////////////////////////////////////
@@ -465,31 +462,28 @@
 
 GR_DEFINE_GEOMETRY_PROCESSOR_TEST(GrDistanceFieldPathGeoProc);
 
-GrGeometryProcessor* GrDistanceFieldPathGeoProc::TestCreate(SkRandom* random,
-                                                            GrContext*,
-                                                            const GrCaps&,
-                                                            GrTexture* textures[]) {
-    int texIdx = random->nextBool() ? GrProcessorUnitTest::kSkiaPMTextureIdx 
-                                    : GrProcessorUnitTest::kAlphaTextureIdx;
+GrGeometryProcessor* GrDistanceFieldPathGeoProc::TestCreate(GrProcessorTestData* d) {
+    int texIdx = d->fRandom->nextBool() ? GrProcessorUnitTest::kSkiaPMTextureIdx
+                                        : GrProcessorUnitTest::kAlphaTextureIdx;
     static const SkShader::TileMode kTileModes[] = {
         SkShader::kClamp_TileMode,
         SkShader::kRepeat_TileMode,
         SkShader::kMirror_TileMode,
     };
     SkShader::TileMode tileModes[] = {
-        kTileModes[random->nextULessThan(SK_ARRAY_COUNT(kTileModes))],
-        kTileModes[random->nextULessThan(SK_ARRAY_COUNT(kTileModes))],
+        kTileModes[d->fRandom->nextULessThan(SK_ARRAY_COUNT(kTileModes))],
+        kTileModes[d->fRandom->nextULessThan(SK_ARRAY_COUNT(kTileModes))],
     };
-    GrTextureParams params(tileModes, random->nextBool() ? GrTextureParams::kBilerp_FilterMode 
-                                                         : GrTextureParams::kNone_FilterMode);
+    GrTextureParams params(tileModes, d->fRandom->nextBool() ? GrTextureParams::kBilerp_FilterMode
+                                                             : GrTextureParams::kNone_FilterMode);
 
-    return GrDistanceFieldPathGeoProc::Create(GrRandomColor(random),
-                                              GrTest::TestMatrix(random),
-                                              textures[texIdx],
+    return GrDistanceFieldPathGeoProc::Create(GrRandomColor(d->fRandom),
+                                              GrTest::TestMatrix(d->fRandom),
+                                              d->fTextures[texIdx],
                                               params,
-                                              random->nextBool() ?
+                                              d->fRandom->nextBool() ?
                                                       kSimilarity_DistanceFieldEffectFlag : 0,
-                                              random->nextBool());
+                                                      d->fRandom->nextBool());
 }
 
 ///////////////////////////////////////////////////////////////////////////////
@@ -725,31 +719,28 @@
 
 GR_DEFINE_GEOMETRY_PROCESSOR_TEST(GrDistanceFieldLCDTextGeoProc);
 
-GrGeometryProcessor* GrDistanceFieldLCDTextGeoProc::TestCreate(SkRandom* random,
-                                                                 GrContext*,
-                                                                 const GrCaps&,
-                                                                 GrTexture* textures[]) {
-    int texIdx = random->nextBool() ? GrProcessorUnitTest::kSkiaPMTextureIdx :
-                                      GrProcessorUnitTest::kAlphaTextureIdx;
+GrGeometryProcessor* GrDistanceFieldLCDTextGeoProc::TestCreate(GrProcessorTestData* d) {
+    int texIdx = d->fRandom->nextBool() ? GrProcessorUnitTest::kSkiaPMTextureIdx :
+                                          GrProcessorUnitTest::kAlphaTextureIdx;
     static const SkShader::TileMode kTileModes[] = {
         SkShader::kClamp_TileMode,
         SkShader::kRepeat_TileMode,
         SkShader::kMirror_TileMode,
     };
     SkShader::TileMode tileModes[] = {
-        kTileModes[random->nextULessThan(SK_ARRAY_COUNT(kTileModes))],
-        kTileModes[random->nextULessThan(SK_ARRAY_COUNT(kTileModes))],
+        kTileModes[d->fRandom->nextULessThan(SK_ARRAY_COUNT(kTileModes))],
+        kTileModes[d->fRandom->nextULessThan(SK_ARRAY_COUNT(kTileModes))],
     };
-    GrTextureParams params(tileModes, random->nextBool() ? GrTextureParams::kBilerp_FilterMode :
+    GrTextureParams params(tileModes, d->fRandom->nextBool() ? GrTextureParams::kBilerp_FilterMode :
                            GrTextureParams::kNone_FilterMode);
     DistanceAdjust wa = { 0.0f, 0.1f, -0.1f };
     uint32_t flags = kUseLCD_DistanceFieldEffectFlag;
-    flags |= random->nextBool() ? kUniformScale_DistanceFieldEffectMask : 0;
-    flags |= random->nextBool() ? kBGR_DistanceFieldEffectFlag : 0;
-    return GrDistanceFieldLCDTextGeoProc::Create(GrRandomColor(random),
-                                                 GrTest::TestMatrix(random),
-                                                 textures[texIdx], params,
+    flags |= d->fRandom->nextBool() ? kUniformScale_DistanceFieldEffectMask : 0;
+    flags |= d->fRandom->nextBool() ? kBGR_DistanceFieldEffectFlag : 0;
+    return GrDistanceFieldLCDTextGeoProc::Create(GrRandomColor(d->fRandom),
+                                                 GrTest::TestMatrix(d->fRandom),
+                                                 d->fTextures[texIdx], params,
                                                  wa,
                                                  flags,
-                                                 random->nextBool());
+                                                 d->fRandom->nextBool());
 }
diff --git a/src/gpu/effects/GrDitherEffect.cpp b/src/gpu/effects/GrDitherEffect.cpp
index 0c25232..eb8466b 100644
--- a/src/gpu/effects/GrDitherEffect.cpp
+++ b/src/gpu/effects/GrDitherEffect.cpp
@@ -53,10 +53,7 @@
 
 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(DitherEffect);
 
-GrFragmentProcessor* DitherEffect::TestCreate(SkRandom*,
-                                              GrContext*,
-                                              const GrCaps&,
-                                              GrTexture*[]) {
+GrFragmentProcessor* DitherEffect::TestCreate(GrProcessorTestData*) {
     return DitherEffect::Create();
 }
 
diff --git a/src/gpu/effects/GrMatrixConvolutionEffect.cpp b/src/gpu/effects/GrMatrixConvolutionEffect.cpp
index 93876ad..0dd83b4 100644
--- a/src/gpu/effects/GrMatrixConvolutionEffect.cpp
+++ b/src/gpu/effects/GrMatrixConvolutionEffect.cpp
@@ -236,30 +236,28 @@
 
 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrMatrixConvolutionEffect);
 
-GrFragmentProcessor* GrMatrixConvolutionEffect::TestCreate(SkRandom* random,
-                                                           GrContext* context,
-                                                           const GrCaps&,
-                                                           GrTexture* textures[]) {
-    int texIdx = random->nextBool() ? GrProcessorUnitTest::kSkiaPMTextureIdx :
-                                      GrProcessorUnitTest::kAlphaTextureIdx;
-    int width = random->nextRangeU(1, MAX_KERNEL_SIZE);
-    int height = random->nextRangeU(1, MAX_KERNEL_SIZE / width);
+GrFragmentProcessor* GrMatrixConvolutionEffect::TestCreate(GrProcessorTestData* d) {
+    int texIdx = d->fRandom->nextBool() ? GrProcessorUnitTest::kSkiaPMTextureIdx :
+                                          GrProcessorUnitTest::kAlphaTextureIdx;
+    int width = d->fRandom->nextRangeU(1, MAX_KERNEL_SIZE);
+    int height = d->fRandom->nextRangeU(1, MAX_KERNEL_SIZE / width);
     SkISize kernelSize = SkISize::Make(width, height);
     SkAutoTDeleteArray<SkScalar> kernel(new SkScalar[width * height]);
     for (int i = 0; i < width * height; i++) {
-        kernel.get()[i] = random->nextSScalar1();
+        kernel.get()[i] = d->fRandom->nextSScalar1();
     }
-    SkScalar gain = random->nextSScalar1();
-    SkScalar bias = random->nextSScalar1();
-    SkIPoint kernelOffset = SkIPoint::Make(random->nextRangeU(0, kernelSize.width()),
-                                           random->nextRangeU(0, kernelSize.height()));
-    SkIRect bounds = SkIRect::MakeXYWH(random->nextRangeU(0, textures[texIdx]->width()),
-                                       random->nextRangeU(0, textures[texIdx]->height()),
-                                       random->nextRangeU(0, textures[texIdx]->width()),
-                                       random->nextRangeU(0, textures[texIdx]->height()));
-    GrTextureDomain::Mode tileMode = static_cast<GrTextureDomain::Mode>(random->nextRangeU(0, 2));
-    bool convolveAlpha = random->nextBool();
-    return GrMatrixConvolutionEffect::Create(textures[texIdx],
+    SkScalar gain = d->fRandom->nextSScalar1();
+    SkScalar bias = d->fRandom->nextSScalar1();
+    SkIPoint kernelOffset = SkIPoint::Make(d->fRandom->nextRangeU(0, kernelSize.width()),
+                                           d->fRandom->nextRangeU(0, kernelSize.height()));
+    SkIRect bounds = SkIRect::MakeXYWH(d->fRandom->nextRangeU(0, d->fTextures[texIdx]->width()),
+                                       d->fRandom->nextRangeU(0, d->fTextures[texIdx]->height()),
+                                       d->fRandom->nextRangeU(0, d->fTextures[texIdx]->width()),
+                                       d->fRandom->nextRangeU(0, d->fTextures[texIdx]->height()));
+    GrTextureDomain::Mode tileMode =
+            static_cast<GrTextureDomain::Mode>(d->fRandom->nextRangeU(0, 2));
+    bool convolveAlpha = d->fRandom->nextBool();
+    return GrMatrixConvolutionEffect::Create(d->fTextures[texIdx],
                                              bounds,
                                              kernelSize,
                                              kernel.get(),
diff --git a/src/gpu/effects/GrOvalEffect.cpp b/src/gpu/effects/GrOvalEffect.cpp
index 7b9fd0a..1b6df12 100644
--- a/src/gpu/effects/GrOvalEffect.cpp
+++ b/src/gpu/effects/GrOvalEffect.cpp
@@ -75,17 +75,14 @@
 
 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 @@
 
 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);
 }
diff --git a/src/gpu/effects/GrPorterDuffXferProcessor.cpp b/src/gpu/effects/GrPorterDuffXferProcessor.cpp
index 6fc3c93..b6b57ae 100644
--- a/src/gpu/effects/GrPorterDuffXferProcessor.cpp
+++ b/src/gpu/effects/GrPorterDuffXferProcessor.cpp
@@ -808,11 +808,8 @@
 
 GR_DEFINE_XP_FACTORY_TEST(GrPorterDuffXPFactory);
 
-GrXPFactory* GrPorterDuffXPFactory::TestCreate(SkRandom* random,
-                                               GrContext*,
-                                               const GrCaps&,
-                                               GrTexture*[]) {
-    SkXfermode::Mode mode = SkXfermode::Mode(random->nextULessThan(SkXfermode::kLastCoeffMode));
+GrXPFactory* GrPorterDuffXPFactory::TestCreate(GrProcessorTestData* d) {
+    SkXfermode::Mode mode = SkXfermode::Mode(d->fRandom->nextULessThan(SkXfermode::kLastCoeffMode));
     return GrPorterDuffXPFactory::Create(mode);
 }
 
diff --git a/src/gpu/effects/GrRRectEffect.cpp b/src/gpu/effects/GrRRectEffect.cpp
index 0db9c13..a31e89c 100644
--- a/src/gpu/effects/GrRRectEffect.cpp
+++ b/src/gpu/effects/GrRRectEffect.cpp
@@ -107,19 +107,16 @@
 
 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(CircularRRectEffect);
 
-GrFragmentProcessor* CircularRRectEffect::TestCreate(SkRandom* random,
-                                                     GrContext*,
-                                                     const GrCaps& caps,
-                                                     GrTexture*[]) {
-    SkScalar w = random->nextRangeScalar(20.f, 1000.f);
-    SkScalar h = random->nextRangeScalar(20.f, 1000.f);
-    SkScalar r = random->nextRangeF(kRadiusMin, 9.f);
+GrFragmentProcessor* CircularRRectEffect::TestCreate(GrProcessorTestData* d) {
+    SkScalar w = d->fRandom->nextRangeScalar(20.f, 1000.f);
+    SkScalar h = d->fRandom->nextRangeScalar(20.f, 1000.f);
+    SkScalar r = d->fRandom->nextRangeF(kRadiusMin, 9.f);
     SkRRect rrect;
     rrect.setRectXY(SkRect::MakeWH(w, h), r, r);
     GrFragmentProcessor* fp;
     do {
         GrPrimitiveEdgeType et =
-                (GrPrimitiveEdgeType)random->nextULessThan(kGrProcessorEdgeTypeCnt);
+                (GrPrimitiveEdgeType)d->fRandom->nextULessThan(kGrProcessorEdgeTypeCnt);
         fp = GrRRectEffect::Create(et, rrect);
     } while (NULL == fp);
     return fp;
@@ -444,24 +441,21 @@
 
 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(EllipticalRRectEffect);
 
-GrFragmentProcessor* EllipticalRRectEffect::TestCreate(SkRandom* random,
-                                                       GrContext*,
-                                                       const GrCaps& caps,
-                                                       GrTexture*[]) {
-    SkScalar w = random->nextRangeScalar(20.f, 1000.f);
-    SkScalar h = random->nextRangeScalar(20.f, 1000.f);
+GrFragmentProcessor* EllipticalRRectEffect::TestCreate(GrProcessorTestData* d) {
+    SkScalar w = d->fRandom->nextRangeScalar(20.f, 1000.f);
+    SkScalar h = d->fRandom->nextRangeScalar(20.f, 1000.f);
     SkVector r[4];
-    r[SkRRect::kUpperLeft_Corner].fX = random->nextRangeF(kRadiusMin, 9.f);
+    r[SkRRect::kUpperLeft_Corner].fX = d->fRandom->nextRangeF(kRadiusMin, 9.f);
     // ensure at least one corner really is elliptical
     do {
-        r[SkRRect::kUpperLeft_Corner].fY = random->nextRangeF(kRadiusMin, 9.f);
+        r[SkRRect::kUpperLeft_Corner].fY = d->fRandom->nextRangeF(kRadiusMin, 9.f);
     } while (r[SkRRect::kUpperLeft_Corner].fY == r[SkRRect::kUpperLeft_Corner].fX);
 
     SkRRect rrect;
-    if (random->nextBool()) {
+    if (d->fRandom->nextBool()) {
         // half the time create a four-radii rrect.
-        r[SkRRect::kLowerRight_Corner].fX = random->nextRangeF(kRadiusMin, 9.f);
-        r[SkRRect::kLowerRight_Corner].fY = random->nextRangeF(kRadiusMin, 9.f);
+        r[SkRRect::kLowerRight_Corner].fX = d->fRandom->nextRangeF(kRadiusMin, 9.f);
+        r[SkRRect::kLowerRight_Corner].fY = d->fRandom->nextRangeF(kRadiusMin, 9.f);
 
         r[SkRRect::kUpperRight_Corner].fX = r[SkRRect::kLowerRight_Corner].fX;
         r[SkRRect::kUpperRight_Corner].fY = r[SkRRect::kUpperLeft_Corner].fY;
@@ -476,7 +470,8 @@
     }
     GrFragmentProcessor* fp;
     do {
-        GrPrimitiveEdgeType et = (GrPrimitiveEdgeType)random->nextULessThan(kGrProcessorEdgeTypeCnt);
+        GrPrimitiveEdgeType et =
+                (GrPrimitiveEdgeType)d->fRandom->nextULessThan(kGrProcessorEdgeTypeCnt);
         fp = GrRRectEffect::Create(et, rrect);
     } while (NULL == fp);
     return fp;
diff --git a/src/gpu/effects/GrSimpleTextureEffect.cpp b/src/gpu/effects/GrSimpleTextureEffect.cpp
index 370b2ce..0f6f403 100644
--- a/src/gpu/effects/GrSimpleTextureEffect.cpp
+++ b/src/gpu/effects/GrSimpleTextureEffect.cpp
@@ -55,30 +55,27 @@
 
 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrSimpleTextureEffect);
 
-GrFragmentProcessor* GrSimpleTextureEffect::TestCreate(SkRandom* random,
-                                                       GrContext*,
-                                                       const GrCaps&,
-                                                       GrTexture* textures[]) {
-    int texIdx = random->nextBool() ? GrProcessorUnitTest::kSkiaPMTextureIdx :
-                                      GrProcessorUnitTest::kAlphaTextureIdx;
+GrFragmentProcessor* GrSimpleTextureEffect::TestCreate(GrProcessorTestData* d) {
+    int texIdx = d->fRandom->nextBool() ? GrProcessorUnitTest::kSkiaPMTextureIdx :
+                                          GrProcessorUnitTest::kAlphaTextureIdx;
     static const SkShader::TileMode kTileModes[] = {
         SkShader::kClamp_TileMode,
         SkShader::kRepeat_TileMode,
         SkShader::kMirror_TileMode,
     };
     SkShader::TileMode tileModes[] = {
-        kTileModes[random->nextULessThan(SK_ARRAY_COUNT(kTileModes))],
-        kTileModes[random->nextULessThan(SK_ARRAY_COUNT(kTileModes))],
+        kTileModes[d->fRandom->nextULessThan(SK_ARRAY_COUNT(kTileModes))],
+        kTileModes[d->fRandom->nextULessThan(SK_ARRAY_COUNT(kTileModes))],
     };
-    GrTextureParams params(tileModes, random->nextBool() ? GrTextureParams::kBilerp_FilterMode :
-                                                           GrTextureParams::kNone_FilterMode);
+    GrTextureParams params(tileModes, d->fRandom->nextBool() ? GrTextureParams::kBilerp_FilterMode :
+                                                               GrTextureParams::kNone_FilterMode);
 
     static const GrCoordSet kCoordSets[] = {
         kLocal_GrCoordSet,
         kDevice_GrCoordSet
     };
-    GrCoordSet coordSet = kCoordSets[random->nextULessThan(SK_ARRAY_COUNT(kCoordSets))];
+    GrCoordSet coordSet = kCoordSets[d->fRandom->nextULessThan(SK_ARRAY_COUNT(kCoordSets))];
 
-    const SkMatrix& matrix = GrTest::TestMatrix(random);
-    return GrSimpleTextureEffect::Create(textures[texIdx], matrix, coordSet);
+    const SkMatrix& matrix = GrTest::TestMatrix(d->fRandom);
+    return GrSimpleTextureEffect::Create(d->fTextures[texIdx], matrix, coordSet);
 }
diff --git a/src/gpu/effects/GrTextureDomain.cpp b/src/gpu/effects/GrTextureDomain.cpp
index 7ac3a18..31f51aa 100644
--- a/src/gpu/effects/GrTextureDomain.cpp
+++ b/src/gpu/effects/GrTextureDomain.cpp
@@ -286,23 +286,20 @@
 
 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrTextureDomainEffect);
 
-GrFragmentProcessor* GrTextureDomainEffect::TestCreate(SkRandom* random,
-                                                       GrContext*,
-                                                       const GrCaps&,
-                                                       GrTexture* textures[]) {
-    int texIdx = random->nextBool() ? GrProcessorUnitTest::kSkiaPMTextureIdx :
-                                      GrProcessorUnitTest::kAlphaTextureIdx;
+GrFragmentProcessor* GrTextureDomainEffect::TestCreate(GrProcessorTestData* d) {
+    int texIdx = d->fRandom->nextBool() ? GrProcessorUnitTest::kSkiaPMTextureIdx :
+                                          GrProcessorUnitTest::kAlphaTextureIdx;
     SkRect domain;
-    domain.fLeft = random->nextUScalar1();
-    domain.fRight = random->nextRangeScalar(domain.fLeft, SK_Scalar1);
-    domain.fTop = random->nextUScalar1();
-    domain.fBottom = random->nextRangeScalar(domain.fTop, SK_Scalar1);
+    domain.fLeft = d->fRandom->nextUScalar1();
+    domain.fRight = d->fRandom->nextRangeScalar(domain.fLeft, SK_Scalar1);
+    domain.fTop = d->fRandom->nextUScalar1();
+    domain.fBottom = d->fRandom->nextRangeScalar(domain.fTop, SK_Scalar1);
     GrTextureDomain::Mode mode =
-        (GrTextureDomain::Mode) random->nextULessThan(GrTextureDomain::kModeCount);
-    const SkMatrix& matrix = GrTest::TestMatrix(random);
-    bool bilerp = mode != GrTextureDomain::kRepeat_Mode ? random->nextBool() : false;
-    GrCoordSet coords = random->nextBool() ? kLocal_GrCoordSet : kDevice_GrCoordSet;
-    return GrTextureDomainEffect::Create(textures[texIdx],
+        (GrTextureDomain::Mode) d->fRandom->nextULessThan(GrTextureDomain::kModeCount);
+    const SkMatrix& matrix = GrTest::TestMatrix(d->fRandom);
+    bool bilerp = mode != GrTextureDomain::kRepeat_Mode ? d->fRandom->nextBool() : false;
+    GrCoordSet coords = d->fRandom->nextBool() ? kLocal_GrCoordSet : kDevice_GrCoordSet;
+    return GrTextureDomainEffect::Create(d->fTextures[texIdx],
                                          matrix,
                                          domain,
                                          mode,