aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authorGravatar joshualitt <joshualitt@chromium.org>2014-10-28 17:59:26 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2014-10-28 17:59:26 -0700
commit79f8faeea2692d2948c0f634e956d1e7fc8333e0 (patch)
treea4de457cd96b8b8ada35fa277e79fd7fb47f2e4b /tests
parent7a5693178414e133426f99b45d703ee2b0078af4 (diff)
OptState owns program descriptor
Diffstat (limited to 'tests')
-rw-r--r--tests/GLProgramsTest.cpp28
1 files changed, 10 insertions, 18 deletions
diff --git a/tests/GLProgramsTest.cpp b/tests/GLProgramsTest.cpp
index 24d6203e35..c9e840e9c1 100644
--- a/tests/GLProgramsTest.cpp
+++ b/tests/GLProgramsTest.cpp
@@ -447,32 +447,24 @@ bool GrGpuGL::programUnitTest(int maxStages) {
set_random_blend_func(this, &random);
set_random_stencil(this, &random);
+ GrDeviceCoordTexture dstCopy;
+
+ if (!this->setupDstReadIfNecessary(&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
SkAutoTUnref<GrOptDrawState> ods(GrOptDrawState::Create(this->getDrawState(),
- *this->caps(),
+ this,
+ &dstCopy,
drawType));
if (!ods.get()) {
ds->reset();
continue;
}
- GrGLProgramDesc desc;
- GrDeviceCoordTexture dstCopy;
-
- if (!this->setupDstReadIfNecessary(&dstCopy, NULL)) {
- SkDebugf("Couldn't setup dst read texture");
- return false;
- }
- if (!GrGLProgramDesc::Build(*ods,
- drawType,
- this,
- dstCopy.texture() ? &dstCopy : NULL,
- &desc)) {
- SkDebugf("Failed to generate GL program descriptor");
- return false;
- }
- SkAutoTUnref<GrGLProgram> program(
- GrGLProgramBuilder::CreateProgram(*ods, desc, drawType, this));
+ SkAutoTUnref<GrGLProgram> program(GrGLProgramBuilder::CreateProgram(*ods, drawType, this));
if (NULL == program.get()) {
SkDebugf("Failed to create program!");
return false;