summaryrefslogtreecommitdiff
path: root/libs/hwui/Program.cpp
diff options
context:
space:
mode:
author Romain Guy <romainguy@google.com> 2011-12-12 20:36:22 -0800
committer Android (Google) Code Review <android-gerrit@google.com> 2011-12-12 20:36:22 -0800
commit5009f65c9a676b64869e638e08ec0294e20d7e6e (patch)
tree80ae684575c89499e1ce173e16ea0ffcac5e7749 /libs/hwui/Program.cpp
parent4dbfa44a2164724914b451ab1d6d0af8c0e9d1be (diff)
parentf3a910b423db7ad79cf61518bdd9278c048ad0d8 (diff)
Merge "Optimize state changes"
Diffstat (limited to 'libs/hwui/Program.cpp')
-rw-r--r--libs/hwui/Program.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/libs/hwui/Program.cpp b/libs/hwui/Program.cpp
index cb2a5fd2267e..cbea843acf04 100644
--- a/libs/hwui/Program.cpp
+++ b/libs/hwui/Program.cpp
@@ -26,7 +26,7 @@ namespace uirenderer {
///////////////////////////////////////////////////////////////////////////////
// TODO: Program instance should be created from a factory method
-Program::Program(const char* vertex, const char* fragment) {
+Program::Program(const ProgramDescription& description, const char* vertex, const char* fragment) {
mInitialized = false;
mHasColorUniform = false;
mUse = false;
@@ -43,6 +43,12 @@ Program::Program(const char* vertex, const char* fragment) {
glAttachShader(mProgramId, mFragmentShader);
position = bindAttrib("position", kBindingPosition);
+ if (description.hasTexture || description.hasExternalTexture) {
+ texCoords = bindAttrib("texCoords", kBindingTexCoords);
+ } else {
+ texCoords = -1;
+ }
+
glLinkProgram(mProgramId);
GLint status;