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

Unified Diff: src/gpu/gl/builders/GrGLProgramBuilder.cpp

Issue 582963002: Solo gp (Closed) Base URL: https://skia.googlesource.com/skia.git@no_peb
Patch Set: fix Created 6 years, 3 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/builders/GrGLProgramBuilder.cpp
diff --git a/src/gpu/gl/builders/GrGLProgramBuilder.cpp b/src/gpu/gl/builders/GrGLProgramBuilder.cpp
index a0dd555587f7a466f98bbfa48769443c1e6b8843..251bf68d119b70270408d9cb47efd73a514977ff 100644
--- a/src/gpu/gl/builders/GrGLProgramBuilder.cpp
+++ b/src/gpu/gl/builders/GrGLProgramBuilder.cpp
@@ -30,9 +30,9 @@ static const GrGLShaderVar::Precision kDefaultFragmentPrecision = GrGLShaderVar:
///////////////////////////////////////////////////////////////////////////////////////////////////
-bool GrGLProgramBuilder::genProgram(const GrEffectStage* geometryProcessor,
- const GrEffectStage* colorStages[],
- const GrEffectStage* coverageStages[]) {
+bool GrGLProgramBuilder::genProgram(const GrGeometryStage* geometryProcessor,
+ const GrFragmentStage* colorStages[],
+ const GrFragmentStage* coverageStages[]) {
const GrGLProgramDesc::KeyHeader& header = this->desc().getHeader();
fFS.emitCodeBeforeEffects();
@@ -84,13 +84,15 @@ bool GrGLProgramBuilder::genProgram(const GrEffectStage* geometryProcessor,
GrGLProgramBuilder::GrGLProgramBuilder(GrGpuGL* gpu,
const GrGLProgramDesc& desc)
- : fFragOnly(!desc.getHeader().fRequiresVertexShader &&
+ : fEffectEmitter(NULL)
+ , fFragOnly(!desc.getHeader().fRequiresVertexShader &&
gpu->glCaps().pathRenderingSupport() &&
gpu->glPathRendering()->texturingMode() == GrGLPathRendering::FixedFunction_TexturingMode)
, fTexCoordSetCnt(0)
, fProgramID(0)
, fFS(this, desc)
, fSeparableVaryingInfos(kVarsPerBlock)
+ , fGrProcessorEmitter(this)
, fDesc(desc)
, fGpu(gpu)
, fUniforms(kVarsPerBlock) {
@@ -159,7 +161,7 @@ void GrGLProgramBuilder::appendUniformDecls(ShaderVisibility visibility,
}
}
-void GrGLProgramBuilder::createAndEmitEffects(const GrEffectStage* effectStages[],
+void GrGLProgramBuilder::createAndEmitEffects(const GrFragmentStage* effectStages[],
int effectCnt,
const GrGLProgramDesc::EffectKeyProvider& keyProvider,
GrGLSLExpr4* fsInOutColor) {
@@ -169,6 +171,8 @@ void GrGLProgramBuilder::createAndEmitEffects(const GrEffectStage* effectStages[
GrGLSLExpr4 outColor;
for (int e = 0; e < effectCnt; ++e) {
+ fGrProcessorEmitter.set(effectStages[e]->getFragmentProcessor());
+ fEffectEmitter = &fGrProcessorEmitter;
// calls into the subclass to emit the actual effect into the program effect object
this->emitEffect(*effectStages[e], e, keyProvider, &inColor, &outColor);
effectEmitted = true;
@@ -179,12 +183,12 @@ void GrGLProgramBuilder::createAndEmitEffects(const GrEffectStage* effectStages[
}
}
-void GrGLProgramBuilder::emitEffect(const GrEffectStage& effectStage,
+void GrGLProgramBuilder::emitEffect(const GrProcessorStage& effectStage,
int effectIndex,
const GrGLProgramDesc::EffectKeyProvider& keyProvider,
GrGLSLExpr4* inColor,
GrGLSLExpr4* outColor) {
- SkASSERT(effectStage.getEffect());
+ SkASSERT(effectStage.getProcessor());
CodeStage::AutoStageRestore csar(&fCodeStage, &effectStage);
if (inColor->isZeros()) {
@@ -208,8 +212,8 @@ void GrGLProgramBuilder::emitEffect(const GrEffectStage& effectStage,
*inColor = *outColor;
}
-void GrGLProgramBuilder::emitSamplers(const GrEffect& effect,
- GrGLEffect::TextureSamplerArray* outSamplers) {
+void GrGLProgramBuilder::emitSamplers(const GrProcessor& effect,
+ GrGLProcessor::TextureSamplerArray* outSamplers) {
SkTArray<GrGLProgramEffects::Sampler, true>& samplers =
this->getProgramEffects()->addSamplers();
int numTextures = effect.numTextures();
@@ -220,7 +224,7 @@ void GrGLProgramBuilder::emitSamplers(const GrEffect& effect,
samplers[t].fUniform = this->addUniform(GrGLProgramBuilder::kFragment_Visibility,
kSampler2D_GrSLType,
name.c_str());
- SkNEW_APPEND_TO_TARRAY(outSamplers, GrGLEffect::TextureSampler,
+ SkNEW_APPEND_TO_TARRAY(outSamplers, GrGLProcessor::TextureSampler,
(samplers[t].fUniform, effect.textureAccess(t)));
}
}

Powered by Google App Engine
This is Rietveld 408576698