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

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

Issue 22340010: Refactor GrGLUniformManager::UniformHandle to initialize itself by default (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: description Created 7 years, 4 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/GrGLUniformHandle.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 36eb6d5169ebd23a3eb7104f801ab8bb102ac9c9..5ed8f0da09c5bd90fed30f10a117f45a55d3048b 100644
--- a/src/gpu/gl/GrGLShaderBuilder.cpp
+++ b/src/gpu/gl/GrGLShaderBuilder.cpp
@@ -110,9 +110,6 @@ GrGLShaderBuilder::GrGLShaderBuilder(const GrGLContextInfo& ctxInfo,
, fUsesGS(false)
#endif
, fSetupFragPosition(false)
- , fRTHeightUniform(GrGLUniformManager::kInvalidUniformHandle)
- , fDstCopyTopLeftUniform (GrGLUniformManager::kInvalidUniformHandle)
- , fDstCopyScaleUniform (GrGLUniformManager::kInvalidUniformHandle)
, fTopLeftFragPosRead(kTopLeftFragPosRead_FragPosKey == desc.getHeader().fFragPosKey) {
const GrGLProgramDesc::KeyHeader& header = desc.getHeader();
@@ -391,7 +388,7 @@ GrGLUniformManager::UniformHandle GrGLShaderBuilder::addUniformArray(uint32_t vi
GrAssert(0 != visibility);
BuilderUniform& uni = fUniforms.push_back();
- UniformHandle h = index_to_handle(fUniforms.count() - 1);
+ UniformHandle h = GrGLUniformManager::UniformHandle::CreateFromUniformIndex(fUniforms.count() - 1);
GR_DEBUGCODE(UniformHandle h2 =)
fUniformManager.appendUniform(type, count);
// We expect the uniform manager to initially have no uniforms and that all uniforms are added
@@ -418,10 +415,6 @@ GrGLUniformManager::UniformHandle GrGLShaderBuilder::addUniformArray(uint32_t vi
return h;
}
-const GrGLShaderVar& GrGLShaderBuilder::getUniformVariable(UniformHandle u) const {
- return fUniforms[handle_to_index(u)].fVariable;
-}
-
bool GrGLShaderBuilder::addAttribute(GrSLType type,
const char* name) {
for (int i = 0; i < fVSAttrs.count(); ++i) {
@@ -512,7 +505,7 @@ const char* GrGLShaderBuilder::fragmentPosition() {
// temporarily change the stage index because we're inserting non-stage code.
CodeStage::AutoStageRestore csar(&fCodeStage, NULL);
- GrAssert(GrGLUniformManager::kInvalidUniformHandle == fRTHeightUniform);
+ GrAssert(!fRTHeightUniform.isValid());
const char* rtHeightName;
fRTHeightUniform = this->addUniform(kFragment_ShaderType,
@@ -524,7 +517,7 @@ const char* GrGLShaderBuilder::fragmentPosition() {
kCoordName, rtHeightName);
fSetupFragPosition = true;
}
- GrAssert(GrGLUniformManager::kInvalidUniformHandle != fRTHeightUniform);
+ GrAssert(fRTHeightUniform.isValid());
return kCoordName;
}
}
« no previous file with comments | « src/gpu/gl/GrGLShaderBuilder.h ('k') | src/gpu/gl/GrGLUniformHandle.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698