Remove GrGLProgram::CachedData, make GrGLProgram represent the program

Review URL: http://codereview.appspot.com/6409043/



git-svn-id: http://skia.googlecode.com/svn/trunk@4627 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/gpu/gl/GrGpuGL_unittest.cpp b/src/gpu/gl/GrGpuGL_unittest.cpp
index 004013a..9dd3e77 100644
--- a/src/gpu/gl/GrGpuGL_unittest.cpp
+++ b/src/gpu/gl/GrGpuGL_unittest.cpp
@@ -231,8 +231,6 @@
         StageDesc::kSmearAlpha_InConfigFlag,
         StageDesc::kSmearRed_InConfigFlag,
     };
-    GrGLProgram program;
-    ProgramDesc& pdesc = program.fProgramDesc;
 
     static const int NUM_TESTS = 512;
 
@@ -247,6 +245,7 @@
         }
 #endif
 
+        ProgramDesc pdesc;
         pdesc.fVertexLayout = 0;
         pdesc.fEmitsPointSize = random.nextF() > .5f;
         pdesc.fColorInput = random_int(&random, ProgramDesc::kColorInputCnt);
@@ -317,14 +316,15 @@
                 }
             }
         }
-        CachedData cachedData;
         GR_STATIC_ASSERT(sizeof(customStages) ==
                          GrDrawState::kNumStages * sizeof(GrCustomStage*));
         GrCustomStage** stages = reinterpret_cast<GrCustomStage**>(&customStages);
-        if (!program.genProgram(this->glContextInfo(), stages, &cachedData)) {
+        SkAutoTUnref<GrGLProgram> program(SkNEW(GrGLProgram));
+
+        if (!program->genProgram(this->glContextInfo(), pdesc, stages)) {
             return false;
         }
-        DeleteProgram(this->glInterface(), &cachedData);
+        DeleteProgram(this->glInterface(), program);
     }
     return true;
 }