Make more gl::Program methods const.
BUG=angleproject:1123
Change-Id: Ib48c523538322871a0deec7ba6497c8797967ef1
Reviewed-on: https://chromium-review.googlesource.com/303305
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Geoff Lang <geofflang@chromium.org>
diff --git a/src/libANGLE/Program.cpp b/src/libANGLE/Program.cpp
index 48a8853..47bc368 100644
--- a/src/libANGLE/Program.cpp
+++ b/src/libANGLE/Program.cpp
@@ -209,7 +209,7 @@
return logString.empty() ? 0 : logString.length() + 1;
}
-void InfoLog::getLog(GLsizei bufSize, GLsizei *length, char *infoLog)
+void InfoLog::getLog(GLsizei bufSize, GLsizei *length, char *infoLog) const
{
size_t index = 0;
@@ -571,7 +571,7 @@
mLinked = false;
}
-bool Program::isLinked()
+bool Program::isLinked() const
{
return mLinked;
}
@@ -861,12 +861,12 @@
return static_cast<int>(mInfoLog.getLength());
}
-void Program::getInfoLog(GLsizei bufSize, GLsizei *length, char *infoLog)
+void Program::getInfoLog(GLsizei bufSize, GLsizei *length, char *infoLog) const
{
return mInfoLog.getLog(bufSize, length, infoLog);
}
-void Program::getAttachedShaders(GLsizei maxCount, GLsizei *count, GLuint *shaders)
+void Program::getAttachedShaders(GLsizei maxCount, GLsizei *count, GLuint *shaders) const
{
int total = 0;
@@ -896,7 +896,7 @@
}
}
-GLuint Program::getAttributeLocation(const std::string &name)
+GLuint Program::getAttributeLocation(const std::string &name) const
{
for (const sh::Attribute &attribute : mData.mAttributes)
{
@@ -970,7 +970,7 @@
*type = attrib.type;
}
-GLint Program::getActiveAttributeCount()
+GLint Program::getActiveAttributeCount() const
{
if (!mLinked)
{
@@ -987,7 +987,7 @@
return count;
}
-GLint Program::getActiveAttributeMaxLength()
+GLint Program::getActiveAttributeMaxLength() const
{
if (!mLinked)
{
@@ -1022,7 +1022,12 @@
return -1;
}
-void Program::getActiveUniform(GLuint index, GLsizei bufsize, GLsizei *length, GLint *size, GLenum *type, GLchar *name)
+void Program::getActiveUniform(GLuint index,
+ GLsizei bufsize,
+ GLsizei *length,
+ GLint *size,
+ GLenum *type,
+ GLchar *name) const
{
if (mLinked)
{
@@ -1067,7 +1072,7 @@
}
}
-GLint Program::getActiveUniformCount()
+GLint Program::getActiveUniformCount() const
{
if (mLinked)
{
@@ -1079,7 +1084,7 @@
}
}
-GLint Program::getActiveUniformMaxLength()
+GLint Program::getActiveUniformMaxLength() const
{
size_t maxLength = 0;
@@ -1271,17 +1276,17 @@
mProgram->setUniformMatrix4x3fv(location, count, transpose, v);
}
-void Program::getUniformfv(GLint location, GLfloat *v)
+void Program::getUniformfv(GLint location, GLfloat *v) const
{
getUniformInternal(location, v);
}
-void Program::getUniformiv(GLint location, GLint *v)
+void Program::getUniformiv(GLint location, GLint *v) const
{
getUniformInternal(location, v);
}
-void Program::getUniformuiv(GLint location, GLuint *v)
+void Program::getUniformuiv(GLint location, GLuint *v) const
{
getUniformInternal(location, v);
}
@@ -1391,7 +1396,7 @@
return mValidated;
}
-GLuint Program::getActiveUniformBlockCount()
+GLuint Program::getActiveUniformBlockCount() const
{
return static_cast<GLuint>(mData.mUniformBlocks.size());
}
@@ -1459,7 +1464,7 @@
}
}
-GLint Program::getActiveUniformBlockMaxLength()
+GLint Program::getActiveUniformBlockMaxLength() const
{
int maxLength = 0;
@@ -1484,7 +1489,7 @@
return maxLength;
}
-GLuint Program::getUniformBlockIndex(const std::string &name)
+GLuint Program::getUniformBlockIndex(const std::string &name) const
{
size_t subscript = GL_INVALID_INDEX;
std::string baseName = gl::ParseUniformName(name, &subscript);