diff options
| author | 2011-12-13 22:11:45 -0800 | |
|---|---|---|
| committer | 2011-12-13 22:11:45 -0800 | |
| commit | 926d55eb40b9042c200f154fdf0c7c7969e0e359 (patch) | |
| tree | 87acda1b9855c4e173339fbb093041274dacc55e /libs/hwui/Program.cpp | |
| parent | 476f15c0de4dea1388076c7482eefd154cc3ad3d (diff) | |
| parent | 2d4fd364843d3efc6e6ee59ccc5beb513a86d789 (diff) | |
Merge "Reduce the number of active texture changes"
Diffstat (limited to 'libs/hwui/Program.cpp')
| -rw-r--r-- | libs/hwui/Program.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libs/hwui/Program.cpp b/libs/hwui/Program.cpp index cbea843acf04..701314d3c0b8 100644 --- a/libs/hwui/Program.cpp +++ b/libs/hwui/Program.cpp @@ -29,6 +29,7 @@ namespace uirenderer { Program::Program(const ProgramDescription& description, const char* vertex, const char* fragment) { mInitialized = false; mHasColorUniform = false; + mHasSampler = false; mUse = false; // No need to cache compiled shaders, rely instead on Android's @@ -176,6 +177,10 @@ void Program::setColor(const float r, const float g, const float b, const float void Program::use() { glUseProgram(mProgramId); + if (texCoords >= 0 && !mHasSampler) { + glUniform1i(getUniform("sampler"), 0); + mHasSampler = true; + } mUse = true; } |