summaryrefslogtreecommitdiff
path: root/libs/hwui/Program.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libs/hwui/Program.cpp')
-rw-r--r--libs/hwui/Program.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/libs/hwui/Program.cpp b/libs/hwui/Program.cpp
index 3b5e5da0ad18..609b28a4f361 100644
--- a/libs/hwui/Program.cpp
+++ b/libs/hwui/Program.cpp
@@ -146,6 +146,16 @@ void DrawColorProgram::set(const mat4& projectionMatrix, const mat4& modelViewMa
glUniformMatrix4fv(transform, 1, GL_FALSE, &t.data[0]);
}
+void DrawColorProgram::use() {
+ Program::use();
+ glEnableVertexAttribArray(position);
+}
+
+void DrawColorProgram::remove() {
+ Program::remove();
+ glDisableVertexAttribArray(position);
+}
+
///////////////////////////////////////////////////////////////////////////////
// Draw texture
///////////////////////////////////////////////////////////////////////////////
@@ -156,5 +166,17 @@ DrawTextureProgram::DrawTextureProgram():
sampler = addUniform("sampler");
}
+void DrawTextureProgram::use() {
+ DrawColorProgram::use();
+ glActiveTexture(GL_TEXTURE0);
+ glUniform1i(sampler, 0);
+ glEnableVertexAttribArray(texCoords);
+}
+
+void DrawTextureProgram::remove() {
+ DrawColorProgram::remove();
+ glDisableVertexAttribArray(texCoords);
+}
+
}; // namespace uirenderer
}; // namespace android