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

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: 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
Index: src/gpu/gl/GrGLShaderBuilder.h
diff --git a/src/gpu/gl/GrGLShaderBuilder.h b/src/gpu/gl/GrGLShaderBuilder.h
index b67846a621e05b5feb9e0cf26d2a1c64e78a42be..8d8d5b5aa55a12184a2cffe7ec24fe45182d2cb3 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);

Powered by Google App Engine
This is Rietveld 408576698