Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1707)

Unified Diff: tests/GLProgramsTest.cpp

Issue 674543004: OptState owns program descriptor (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« src/gpu/gl/GrGpuGL.h ('K') | « src/gpu/gl/builders/GrGLShaderBuilder.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/GLProgramsTest.cpp
diff --git a/tests/GLProgramsTest.cpp b/tests/GLProgramsTest.cpp
index 1ec6a7310e79b5b5f87d1e3e2044c739c9551672..4fb0e30b3753b798a0e1d739774f3fe973e0ced6 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;
« src/gpu/gl/GrGpuGL.h ('K') | « src/gpu/gl/builders/GrGLShaderBuilder.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698