diff options
Diffstat (limited to 'libs/hwui/Program.cpp')
| -rw-r--r-- | libs/hwui/Program.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/libs/hwui/Program.cpp b/libs/hwui/Program.cpp index e6fd2dc..32713e9 100644 --- a/libs/hwui/Program.cpp +++ b/libs/hwui/Program.cpp @@ -46,7 +46,7 @@ Program::Program(const ProgramDescription& description, const char* vertex, cons glAttachShader(mProgramId, mVertexShader); glAttachShader(mProgramId, mFragmentShader); - position = bindAttrib("position", kBindingPosition); + bindAttrib("position", kBindingPosition); if (description.hasTexture || description.hasExternalTexture) { texCoords = bindAttrib("texCoords", kBindingTexCoords); } else { @@ -64,7 +64,7 @@ Program::Program(const ProgramDescription& description, const char* vertex, cons glGetProgramiv(mProgramId, GL_INFO_LOG_LENGTH, &infoLen); if (infoLen > 1) { GLchar log[infoLen]; - glGetProgramInfoLog(mProgramId, infoLen, 0, &log[0]); + glGetProgramInfoLog(mProgramId, infoLen, nullptr, &log[0]); ALOGE("%s", log); } LOG_ALWAYS_FATAL("Error while linking shaders"); @@ -135,7 +135,7 @@ GLuint Program::buildShader(const char* source, GLenum type) { ATRACE_NAME("Build GL Shader"); GLuint shader = glCreateShader(type); - glShaderSource(shader, 1, &source, 0); + glShaderSource(shader, 1, &source, nullptr); glCompileShader(shader); GLint status; @@ -145,7 +145,7 @@ GLuint Program::buildShader(const char* source, GLenum type) { // Some drivers return wrong values for GL_INFO_LOG_LENGTH // use a fixed size instead GLchar log[512]; - glGetShaderInfoLog(shader, sizeof(log), 0, &log[0]); + glGetShaderInfoLog(shader, sizeof(log), nullptr, &log[0]); LOG_ALWAYS_FATAL("Shader info log: %s", log); return 0; } @@ -177,12 +177,12 @@ void Program::set(const mat4& projectionMatrix, const mat4& modelViewMatrix, glUniformMatrix4fv(transform, 1, GL_FALSE, &t.data[0]); } -void Program::setColor(const float r, const float g, const float b, const float a) { +void Program::setColor(FloatColor color) { if (!mHasColorUniform) { mColorUniform = getUniform("color"); mHasColorUniform = true; } - glUniform4f(mColorUniform, r, g, b, a); + glUniform4f(mColorUniform, color.r, color.g, color.b, color.a); } void Program::use() { |
