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

Unified Diff: src/gpu/gl/GrGLProgramEffects.cpp

Issue 356513003: Step towards variable length effect keys. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: tweak comment Created 6 years, 5 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
Index: src/gpu/gl/GrGLProgramEffects.cpp
diff --git a/src/gpu/gl/GrGLProgramEffects.cpp b/src/gpu/gl/GrGLProgramEffects.cpp
index fd91f584c42558678f4b037288f6eb4b10dde666..65d14fde116dc65f29f20ab426048583aa326ba1 100644
--- a/src/gpu/gl/GrGLProgramEffects.cpp
+++ b/src/gpu/gl/GrGLProgramEffects.cpp
@@ -239,7 +239,7 @@ void GrGLVertexProgramEffects::emitEffect(GrGLFullShaderBuilder* builder,
SkSTArray<4, TextureSampler> samplers(effect->numTextures());
this->emitAttributes(builder, stage);
- this->emitTransforms(builder, effect, key, &coords);
+ this->emitTransforms(builder, drawEffect, &coords);
this->emitSamplers(builder, effect, &samplers);
GrGLEffect* glEffect = effect->getFactory().createGLInstance(drawEffect);
@@ -277,12 +277,11 @@ void GrGLVertexProgramEffects::emitAttributes(GrGLFullShaderBuilder* builder,
}
void GrGLVertexProgramEffects::emitTransforms(GrGLFullShaderBuilder* builder,
- const GrEffect* effect,
- EffectKey effectKey,
+ const GrDrawEffect& drawEffect,
TransformedCoordsArray* outCoords) {
SkTArray<Transform, true>& transforms = fTransforms.push_back();
- EffectKey totalKey = GrBackendEffectFactory::GetTransformKey(effectKey);
- int numTransforms = effect->numTransforms();
+ EffectKey totalKey = GenTransformKey(drawEffect);
+ int numTransforms = drawEffect.effect()->numTransforms();
transforms.push_back_n(numTransforms);
for (int t = 0; t < numTransforms; t++) {
GrSLType varyingType = kVoid_GrSLType;
@@ -398,7 +397,7 @@ void GrGLPathTexGenProgramEffects::emitEffect(GrGLFragmentOnlyShaderBuilder* bui
SkSTArray<4, TextureSampler> samplers(effect->numTextures());
SkASSERT(0 == stage.getVertexAttribIndexCount());
- this->setupPathTexGen(builder, effect, key, &coords);
+ this->setupPathTexGen(builder, drawEffect, &coords);
this->emitSamplers(builder, effect, &samplers);
GrGLEffect* glEffect = effect->getFactory().createGLInstance(drawEffect);
@@ -416,11 +415,10 @@ void GrGLPathTexGenProgramEffects::emitEffect(GrGLFragmentOnlyShaderBuilder* bui
}
void GrGLPathTexGenProgramEffects::setupPathTexGen(GrGLFragmentOnlyShaderBuilder* builder,
- const GrEffect* effect,
- EffectKey effectKey,
+ const GrDrawEffect& drawEffect,
TransformedCoordsArray* outCoords) {
- int numTransforms = effect->numTransforms();
- EffectKey totalKey = GrBackendEffectFactory::GetTransformKey(effectKey);
+ int numTransforms = drawEffect.effect()->numTransforms();
+ EffectKey totalKey = GenTransformKey(drawEffect);
int texCoordIndex = builder->addTexCoordSets(numTransforms);
SkNEW_APPEND_TO_TARRAY(&fTransforms, Transforms, (totalKey, texCoordIndex));
SkString name;

Powered by Google App Engine
This is Rietveld 408576698