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

Unified Diff: tests/GLProgramsTest.cpp

Issue 13327008: Fix GLPrograms test. (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 9 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
« no previous file with comments | « src/gpu/gl/GrGLProgramDesc.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
===================================================================
--- tests/GLProgramsTest.cpp (revision 8449)
+++ tests/GLProgramsTest.cpp (working copy)
@@ -23,6 +23,7 @@
void GrGLProgramDesc::setRandom(SkMWCRandom* random,
const GrGpuGL* gpu,
+ const GrTexture* dstTexture,
const GrEffectStage stages[GrDrawState::kNumStages]) {
fAttribBindings = 0;
fEmitsPointSize = random->nextBool();
@@ -52,6 +53,7 @@
fAttribBindings |= GrDrawState::kLocalCoords_AttribBindingsBit;
}
+ bool dstRead = false;
for (int s = 0; s < GrDrawState::kNumStages; ++s) {
if (NULL != stages[s].getEffect()) {
const GrBackendEffectFactory& factory = (*stages[s].getEffect())->getFactory();
@@ -59,9 +61,16 @@
GrDrawState::kLocalCoords_AttribBindingsBit);
GrDrawEffect drawEffect(stages[s], explicitLocalCoords);
fEffectKeys[s] = factory.glEffectKey(drawEffect, gpu->glCaps());
+ if ((*stages[s].getEffect())->willReadDst()) {
+ dstRead = true;
+ }
}
}
+ if (dstRead) {
+ this->fDstRead = GrGLShaderBuilder::KeyForDstRead(dstTexture, gpu->glCaps());
+ }
+
int attributeIndex = 0;
fPositionAttributeIndex = attributeIndex;
++attributeIndex;
@@ -111,10 +120,10 @@
int currAttribIndex = GrDrawState::kAttribIndexCount;
int attribIndices[2];
+ GrTexture* dummyTextures[] = {dummyTexture1.get(), dummyTexture2.get()};
for (int s = 0; s < maxStages; ++s) {
// enable the stage?
if (random.nextBool()) {
- GrTexture* dummyTextures[] = {dummyTexture1.get(), dummyTexture2.get()};
SkAutoTUnref<const GrEffectRef> effect(GrEffectTestFactory::CreateStage(
&random,
this->getContext(),
@@ -135,7 +144,8 @@
stages[s].setEffect(effect.get(), attribIndices[0], attribIndices[1]);
}
}
- pdesc.setRandom(&random, this, stages);
+ const GrTexture* dstTexture = random.nextBool() ? dummyTextures[0] : dummyTextures[1];
+ pdesc.setRandom(&random, this, dstTexture, stages);
const GrEffectStage* stagePtrs[GrDrawState::kNumStages];
for (int s = 0; s < GrDrawState::kNumStages; ++s) {
« no previous file with comments | « src/gpu/gl/GrGLProgramDesc.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698