| Index: tests/GLProgramsTest.cpp
|
| diff --git a/tests/GLProgramsTest.cpp b/tests/GLProgramsTest.cpp
|
| index c0de2a594d4fc557a3a81c9b7f6419197c135b86..953b5e07cbcc45e05dd07a25871f4bf316a3fcdc 100644
|
| --- a/tests/GLProgramsTest.cpp
|
| +++ b/tests/GLProgramsTest.cpp
|
| @@ -129,14 +129,19 @@
|
| ds->setXPFactory(xpf.get());
|
| }
|
|
|
| -static const GrGeometryProcessor* get_random_gp(GrContext* context,
|
| - const GrDrawTargetCaps& caps,
|
| - SkRandom* random,
|
| - GrTexture* dummyTextures[]) {
|
| - return GrProcessorTestFactory<GrGeometryProcessor>::CreateStage(random,
|
| - context,
|
| - caps,
|
| - dummyTextures);
|
| +static void set_random_gp(GrContext* context,
|
| + const GrDrawTargetCaps& caps,
|
| + GrDrawState* ds,
|
| + SkRandom* random,
|
| + GrTexture* dummyTextures[]) {
|
| + SkAutoTUnref<const GrGeometryProcessor> gp(
|
| + GrProcessorTestFactory<GrGeometryProcessor>::CreateStage(random,
|
| + context,
|
| + caps,
|
| + dummyTextures));
|
| + SkASSERT(gp);
|
| +
|
| + ds->setGeometryProcessor(gp);
|
| }
|
|
|
| static void set_random_color_coverage_stages(GrGpuGL* gpu,
|
| @@ -288,12 +293,8 @@
|
|
|
| // twiddle drawstate knobs randomly
|
| bool hasGeometryProcessor = !usePathRendering;
|
| - const GrGeometryProcessor* gp = NULL;
|
| - const GrPathProcessor* pathProc = NULL;
|
| if (hasGeometryProcessor) {
|
| - gp = get_random_gp(fContext, gpu->glCaps(), &random, dummyTextures);
|
| - } else {
|
| - pathProc = GrPathProcessor::Create(GrColor_WHITE);
|
| + set_random_gp(fContext, gpu->glCaps(), &ds, &random, dummyTextures);
|
| }
|
| set_random_color_coverage_stages(gpu,
|
| &ds,
|
| @@ -311,20 +312,19 @@
|
|
|
| GrDeviceCoordTexture dstCopy;
|
|
|
| - const GrPrimitiveProcessor* primProc;
|
| - if (hasGeometryProcessor) {
|
| - primProc = gp;
|
| - } else {
|
| - primProc = pathProc;
|
| - }
|
| - if (!this->setupDstReadIfNecessary(&ds, primProc, &dstCopy, NULL)) {
|
| + // TODO take color off the PP when its installed
|
| + GrColor color = ds.hasGeometryProcessor() ? ds.getGeometryProcessor()->getColor() :
|
| + GrColor_WHITE;
|
| + uint8_t coverage = ds.hasGeometryProcessor() ? ds.getGeometryProcessor()->getCoverage() :
|
| + 0xff;
|
| + if (!this->setupDstReadIfNecessary(&ds, color, coverage, &dstCopy, NULL)) {
|
| SkDebugf("Couldn't setup dst read texture");
|
| return false;
|
| }
|
|
|
| // create optimized draw state, setup readDst texture if required, and build a descriptor
|
| // and program. ODS creation can fail, so we have to check
|
| - GrOptDrawState ods(ds, gp, pathProc, *gpu->caps(), scissor, &dstCopy, drawType);
|
| + GrOptDrawState ods(ds, color, coverage, *gpu->caps(), scissor, &dstCopy, drawType);
|
| if (ods.mustSkip()) {
|
| continue;
|
| }
|
|
|