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

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

Issue 302663006: Incremental refactoring of GrGLProgram and GrGLShaderBuilder (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: rebase Created 6 years, 7 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.h ('k') | src/gpu/gl/GrGLUniformManager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/GrGLShaderBuilder.cpp
diff --git a/src/gpu/gl/GrGLShaderBuilder.cpp b/src/gpu/gl/GrGLShaderBuilder.cpp
index 52644f82b8c959d88a978fab89c9c77c70e42f3d..79cb52fc8abc67763a07a9ee468397c9a6669be7 100644
--- a/src/gpu/gl/GrGLShaderBuilder.cpp
+++ b/src/gpu/gl/GrGLShaderBuilder.cpp
@@ -90,7 +90,7 @@ static const char kDstCopyColorName[] = "_dstColor";
///////////////////////////////////////////////////////////////////////////////
bool GrGLShaderBuilder::GenProgram(GrGpuGL* gpu,
- GrGLUniformManager& uman,
+ GrGLUniformManager* uman,
const GrGLProgramDesc& desc,
const GrEffectStage* inColorStages[],
const GrEffectStage* inCoverageStages[],
@@ -174,12 +174,12 @@ bool GrGLShaderBuilder::genProgram(const GrEffectStage* colorStages[],
return false;
}
- output->fUniformHandles.fRTHeightUni = this->getRTHeightUniform();
- output->fUniformHandles.fDstCopyTopLeftUni = this->getDstCopyTopLeftUniform();
- output->fUniformHandles.fDstCopyScaleUni = this->getDstCopyScaleUniform();
- output->fUniformHandles.fColorUni = this->getColorUniform();
- output->fUniformHandles.fCoverageUni = this->getCoverageUniform();
- output->fUniformHandles.fDstCopySamplerUni = this->getDstCopySamplerUniform();
+ output->fUniformHandles.fRTHeightUni = fRTHeightUniform;
+ output->fUniformHandles.fColorUni = fColorUniform;
+ output->fUniformHandles.fCoverageUni = fCoverageUniform;
+ output->fUniformHandles.fDstCopyTopLeftUni = fDstCopyTopLeftUniform;
+ output->fUniformHandles.fDstCopyScaleUni = fDstCopyScaleUniform;
+ output->fUniformHandles.fDstCopySamplerUni = fDstCopySamplerUniform;
return true;
}
@@ -187,11 +187,11 @@ bool GrGLShaderBuilder::genProgram(const GrEffectStage* colorStages[],
//////////////////////////////////////////////////////////////////////////////
GrGLShaderBuilder::GrGLShaderBuilder(GrGpuGL* gpu,
- GrGLUniformManager& uniformManager,
+ GrGLUniformManager* uniformManager,
const GrGLProgramDesc& desc)
: fDesc(desc)
, fGpu(gpu)
- , fUniformManager(uniformManager)
+ , fUniformManager(SkRef(uniformManager))
, fFSFeaturesAddedMask(0)
, fFSInputs(kVarsPerBlock)
, fFSOutputs(kMaxFSOutputs)
@@ -453,7 +453,7 @@ GrGLUniformManager::UniformHandle GrGLShaderBuilder::addUniformArray(uint32_t vi
BuilderUniform& uni = fUniforms.push_back();
UniformHandle h = GrGLUniformManager::UniformHandle::CreateFromUniformIndex(fUniforms.count() - 1);
SkDEBUGCODE(UniformHandle h2 =)
- fUniformManager.appendUniform(type, count);
+ fUniformManager->appendUniform(type, count);
// We expect the uniform manager to initially have no uniforms and that all uniforms are added
// by this function. Therefore, the handles should match.
SkASSERT(h2 == h);
@@ -682,8 +682,8 @@ bool GrGLShaderBuilder::finish(GrGLuint* outProgramId) {
}
this->bindProgramLocations(programId);
- if (fUniformManager.isUsingBindUniform()) {
- fUniformManager.getUniformLocations(programId, fUniforms);
+ if (fUniformManager->isUsingBindUniform()) {
+ fUniformManager->getUniformLocations(programId, fUniforms);
}
GL_CALL(LinkProgram(programId));
@@ -716,8 +716,8 @@ bool GrGLShaderBuilder::finish(GrGLuint* outProgramId) {
}
}
- if (!fUniformManager.isUsingBindUniform()) {
- fUniformManager.getUniformLocations(programId, fUniforms);
+ if (!fUniformManager->isUsingBindUniform()) {
+ fUniformManager->getUniformLocations(programId, fUniforms);
}
for (int i = 0; i < shadersToDelete.count(); ++i) {
@@ -830,7 +830,7 @@ const GrGLContextInfo& GrGLShaderBuilder::ctxInfo() const {
////////////////////////////////////////////////////////////////////////////////
GrGLFullShaderBuilder::GrGLFullShaderBuilder(GrGpuGL* gpu,
- GrGLUniformManager& uniformManager,
+ GrGLUniformManager* uniformManager,
const GrGLProgramDesc& desc)
: INHERITED(gpu, uniformManager, desc)
, fVSAttrs(kVarsPerBlock)
@@ -1070,7 +1070,7 @@ void GrGLFullShaderBuilder::bindProgramLocations(GrGLuint programId) const {
////////////////////////////////////////////////////////////////////////////////
GrGLFragmentOnlyShaderBuilder::GrGLFragmentOnlyShaderBuilder(GrGpuGL* gpu,
- GrGLUniformManager& uniformManager,
+ GrGLUniformManager* uniformManager,
const GrGLProgramDesc& desc)
: INHERITED(gpu, uniformManager, desc)
, fNumTexCoordSets(0) {
« no previous file with comments | « src/gpu/gl/GrGLShaderBuilder.h ('k') | src/gpu/gl/GrGLUniformManager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698