summaryrefslogtreecommitdiff
path: root/libs/hwui/OpenGLRenderer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libs/hwui/OpenGLRenderer.cpp')
-rw-r--r--libs/hwui/OpenGLRenderer.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/libs/hwui/OpenGLRenderer.cpp b/libs/hwui/OpenGLRenderer.cpp
index 1f5d13b8c594..cbfd77869c5d 100644
--- a/libs/hwui/OpenGLRenderer.cpp
+++ b/libs/hwui/OpenGLRenderer.cpp
@@ -1207,13 +1207,13 @@ void OpenGLRenderer::setupDrawSimpleMesh() {
void OpenGLRenderer::setupDrawTexture(GLuint texture) {
bindTexture(texture);
- glUniform1i(mCaches.currentProgram->getUniform("sampler"), mTextureUnit++);
+ mTextureUnit++;
mCaches.enableTexCoordsVertexArray();
}
void OpenGLRenderer::setupDrawExternalTexture(GLuint texture) {
bindExternalTexture(texture);
- glUniform1i(mCaches.currentProgram->getUniform("sampler"), mTextureUnit++);
+ mTextureUnit++;
mCaches.enableTexCoordsVertexArray();
}
@@ -2128,6 +2128,8 @@ void OpenGLRenderer::drawText(const char* text, int bytesCount, int count,
getAlphaAndMode(paint, &alpha, &mode);
if (mHasShadow) {
+ mCaches.activeTexture(0);
+
mCaches.dropShadowCache.setFontRenderer(fontRenderer);
const ShadowTexture* shadow = mCaches.dropShadowCache.get(
paint, text, bytesCount, count, mShadowRadius);
@@ -2142,7 +2144,6 @@ void OpenGLRenderer::drawText(const char* text, int bytesCount, int count,
shadowColor = 0xffffffff;
}
- mCaches.activeTexture(0);
setupDraw();
setupDrawWithTexture(true);
setupDrawAlpha8Color(shadowColor, shadowAlpha < 255 ? shadowAlpha : alpha);
@@ -2158,8 +2159,6 @@ void OpenGLRenderer::drawText(const char* text, int bytesCount, int count,
setupDrawMesh(NULL, (GLvoid*) gMeshTextureOffset);
glDrawArrays(GL_TRIANGLE_STRIP, 0, gMeshCount);
-
- finishDrawTexture();
}
if (paint->getAlpha() == 0 && paint->getXfermode() == NULL) {