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

Unified Diff: tests/GLProgramsTest.cpp

Issue 12531015: Adds local coords to GrEffect system. (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/GrGLShaderBuilder.cpp ('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 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;
}
}
« no previous file with comments | « src/gpu/gl/GrGLShaderBuilder.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698