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

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

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/GrGLProgram.cpp ('k') | src/gpu/gl/GrGLShaderBuilder.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/GrGLShaderBuilder.h
diff --git a/src/gpu/gl/GrGLShaderBuilder.h b/src/gpu/gl/GrGLShaderBuilder.h
index b67846a621e05b5feb9e0cf26d2a1c64e78a42be..e56f459ee4d9f3e0acbeec59817aeec0eefc09a8 100644
--- a/src/gpu/gl/GrGLShaderBuilder.h
+++ b/src/gpu/gl/GrGLShaderBuilder.h
@@ -33,8 +33,7 @@ public:
class TextureSampler {
public:
TextureSampler()
- : fConfigComponentMask(0)
- , fSamplerUniform(GrGLUniformManager::kInvalidUniformHandle) {
+ : fConfigComponentMask(0) {
// we will memcpy the first 4 bytes from passed in swizzle. This ensures the string is
// terminated.
fSwizzle[4] = '\0';
@@ -44,7 +43,7 @@ public:
TextureSampler& operator= (const TextureSampler& other) {
GrAssert(0 == fConfigComponentMask);
- GrAssert(GrGLUniformManager::kInvalidUniformHandle == fSamplerUniform);
+ GrAssert(!fSamplerUniform.isValid());
fConfigComponentMask = other.fConfigComponentMask;
fSamplerUniform = other.fSamplerUniform;
@@ -67,7 +66,7 @@ public:
int idx) {
GrAssert(!this->isInitialized());
GrAssert(0 != configComponentMask);
- GrAssert(GrGLUniformManager::kInvalidUniformHandle == fSamplerUniform);
+ GrAssert(!fSamplerUniform.isValid());
GrAssert(NULL != builder);
SkString name;
@@ -75,7 +74,7 @@ public:
fSamplerUniform = builder->addUniform(GrGLShaderBuilder::kFragment_ShaderType,
kSampler2D_GrSLType,
name.c_str());
- GrAssert(GrGLUniformManager::kInvalidUniformHandle != fSamplerUniform);
+ GrAssert(fSamplerUniform.isValid());
fConfigComponentMask = configComponentMask;
memcpy(fSwizzle, swizzle, 4);
@@ -228,7 +227,9 @@ public:
int arrayCount,
const char** outName = NULL);
- const GrGLShaderVar& getUniformVariable(GrGLUniformManager::UniformHandle) const;
+ const GrGLShaderVar& getUniformVariable(GrGLUniformManager::UniformHandle u) const {
+ return fUniformManager.getBuilderUniform(fUniforms, u).fVariable;
+ }
/**
* Shortcut for getUniformVariable(u).c_str()
« no previous file with comments | « src/gpu/gl/GrGLProgram.cpp ('k') | src/gpu/gl/GrGLShaderBuilder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698