Index: tests/GLProgramsTest.cpp |
=================================================================== |
--- tests/GLProgramsTest.cpp (revision 8241) |
+++ tests/GLProgramsTest.cpp (working copy) |
@@ -15,6 +15,7 @@ |
#include "gl/GrGpuGL.h" |
#include "GrBackendEffectFactory.h" |
#include "GrContextFactory.h" |
+#include "GrDrawEffect.h" |
#include "effects/GrConfigConversionEffect.h" |
#include "SkRandom.h" |
@@ -57,16 +58,18 @@ |
fDualSrcOutput = kNone_DualSrcOutput; |
} |
- bool useOnce = false; |
+ // use separate tex coords? |
+ if (random->nextBool()) { |
+ fAttribBindings |= GrDrawState::kLocalCoords_AttribBindingsBit; |
+ } |
+ |
for (int s = 0; s < GrDrawState::kNumStages; ++s) { |
if (NULL != stages[s].getEffect()) { |
const GrBackendEffectFactory& factory = (*stages[s].getEffect())->getFactory(); |
- fEffectKeys[s] = factory.glEffectKey(stages[s], gpu->glCaps()); |
- // use separate tex coords? |
- if (!useOnce && random->nextBool()) { |
- fAttribBindings |= GrDrawState::ExplicitTexCoordAttribBindingsBit(s); |
- useOnce = true; |
- } |
+ bool explicitLocalCoords = (fAttribBindings & |
+ GrDrawState::kLocalCoords_AttribBindingsBit); |
+ GrDrawEffect drawEffect(stages[s], explicitLocalCoords); |
+ fEffectKeys[s] = factory.glEffectKey(drawEffect, gpu->glCaps()); |
} |
} |
@@ -85,8 +88,8 @@ |
fEdgeAttributeIndex = attributeIndex; |
++attributeIndex; |
} |
- if (GrDrawState::AttributesBindExplicitTexCoords(fAttribBindings)) { |
- fTexCoordAttributeIndex = attributeIndex; |
+ if (fAttribBindings & GrDrawState::kLocalCoords_AttribBindingsBit) { |
+ fLocalCoordsAttributeIndex = attributeIndex; |
++attributeIndex; |
} |
} |