Factory method for creating GrGLProgram
Review URL: http://codereview.appspot.com/6407049/
git-svn-id: http://skia.googlecode.com/svn/trunk@4646 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/gpu/gl/GrGpuGL_unittest.cpp b/src/gpu/gl/GrGpuGL_unittest.cpp
index 9dd3e77..e0aa5b5 100644
--- a/src/gpu/gl/GrGpuGL_unittest.cpp
+++ b/src/gpu/gl/GrGpuGL_unittest.cpp
@@ -319,12 +319,10 @@
GR_STATIC_ASSERT(sizeof(customStages) ==
GrDrawState::kNumStages * sizeof(GrCustomStage*));
GrCustomStage** stages = reinterpret_cast<GrCustomStage**>(&customStages);
- SkAutoTUnref<GrGLProgram> program(SkNEW(GrGLProgram));
-
- if (!program->genProgram(this->glContextInfo(), pdesc, stages)) {
+ SkAutoTUnref<GrGLProgram> program(GrGLProgram::Create(this->glContextInfo(), pdesc, stages));
+ if (NULL == program.get()) {
return false;
}
- DeleteProgram(this->glInterface(), program);
}
return true;
}