aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/gl/GrGLProgramEffects.cpp
diff options
context:
space:
mode:
authorGravatar joshualitt <joshualitt@chromium.org>2014-09-15 11:41:13 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2014-09-15 11:41:14 -0700
commit249af15fb82833d2274850c589812b6e69df0033 (patch)
treeee8ef724d051c484f8b41a5e28a3256a9cfc438c /src/gpu/gl/GrGLProgramEffects.cpp
parentc90e0149ec530075cae7bf51072a16628311855e (diff)
BUG=skia:
R=bsalomon@google.com, egdaniel@google.com, jvanverth@google.com, robertphillips@google.com Author: joshualitt@chromium.org Review URL: https://codereview.chromium.org/543623004
Diffstat (limited to 'src/gpu/gl/GrGLProgramEffects.cpp')
-rw-r--r--src/gpu/gl/GrGLProgramEffects.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/gpu/gl/GrGLProgramEffects.cpp b/src/gpu/gl/GrGLProgramEffects.cpp
index 98e813835a..369ec10760 100644
--- a/src/gpu/gl/GrGLProgramEffects.cpp
+++ b/src/gpu/gl/GrGLProgramEffects.cpp
@@ -11,7 +11,7 @@
#include "gl/GrGLEffect.h"
#include "gl/GrGLPathRendering.h"
#include "gl/builders/GrGLProgramBuilder.h"
-#include "gl/GrGLVertexEffect.h"
+#include "gl/GrGLGeometryProcessor.h"
#include "gl/GrGpuGL.h"
typedef GrGLProgramEffects::TransformedCoords TransformedCoords;
@@ -123,7 +123,7 @@ bool GrGLProgramEffects::GenEffectMetaKey(const GrDrawEffect& drawEffect, const
uint32_t textureKey = GrGLProgramEffects::GenTextureKey(drawEffect, caps);
uint32_t transformKey = GrGLProgramEffects::GenTransformKey(drawEffect);
- uint32_t attribKey = GrGLProgramEffects::GenAttribKey(drawEffect);
+ uint32_t attribKey = GrGLProgramEffects::GenAttribKey(drawEffect.castEffect<GrEffect>());
uint32_t classID = drawEffect.effect()->getFactory().effectClassID();
// Currently we allow 16 bits for each of the above portions of the meta-key. Fail if they
@@ -139,14 +139,14 @@ bool GrGLProgramEffects::GenEffectMetaKey(const GrDrawEffect& drawEffect, const
return true;
}
-uint32_t GrGLProgramEffects::GenAttribKey(const GrDrawEffect& drawEffect) {
+uint32_t GrGLProgramEffects::GenAttribKey(const GrEffect& effect) {
uint32_t key = 0;
- int numAttributes = drawEffect.getVertexAttribIndexCount();
+
+ const GrEffect::VertexAttribArray& vars = effect.getVertexAttribs();
+ int numAttributes = vars.count();
SkASSERT(numAttributes <= 2);
- const int* attributeIndices = drawEffect.getVertexAttribIndices();
for (int a = 0; a < numAttributes; ++a) {
- uint32_t value = attributeIndices[a] << 3 * a;
- SkASSERT(0 == (value & key)); // keys for each attribute ought not to overlap
+ uint32_t value = 1 << a;
key |= value;
}
return key;
@@ -279,7 +279,7 @@ void GrGLVertexProgramEffects::emitEffect(GrGLFullProgramBuilder* builder,
vsBuilder->codeAppend(openBrace.c_str());
if (glEffect->isVertexEffect()) {
- GrGLVertexEffect* vertexEffect = static_cast<GrGLVertexEffect*>(glEffect);
+ GrGLGeometryProcessor* vertexEffect = static_cast<GrGLGeometryProcessor*>(glEffect);
vertexEffect->emitCode(builder, drawEffect, key, outColor, inColor, coords, samplers);
} else {
glEffect->emitCode(builder, drawEffect, key, outColor, inColor, coords, samplers);
@@ -478,7 +478,7 @@ void GrGLPathTexGenProgramEffects::emitEffect(GrGLFragmentOnlyProgramBuilder* bu
SkSTArray<2, TransformedCoords> coords(effect->numTransforms());
SkSTArray<4, TextureSampler> samplers(effect->numTextures());
- SkASSERT(0 == stage.getVertexAttribIndexCount());
+ SkASSERT(0 == effect->getVertexAttribs().count());
this->setupPathTexGen(builder, drawEffect, &coords);
this->emitSamplers(builder, effect, &samplers);