summaryrefslogtreecommitdiff
path: root/libs/hwui/OpenGLRenderer.cpp
diff options
context:
space:
mode:
author Romain Guy <romainguy@google.com> 2010-08-26 20:35:23 -0700
committer Romain Guy <romainguy@google.com> 2010-08-27 11:31:24 -0700
commitb45c0c9774bd19a9dbe77d149abae4e124b08bf6 (patch)
tree809e63c596802906242c982ed67f463481b57230 /libs/hwui/OpenGLRenderer.cpp
parentc70bd1921bbc4046d0caf84959e5f1c2d526769a (diff)
Apply gamma correction to font rendering.
Change-Id: I1b05f40e356221b2a5eb9400e67d77ecd98ed6c4
Diffstat (limited to 'libs/hwui/OpenGLRenderer.cpp')
-rw-r--r--libs/hwui/OpenGLRenderer.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/libs/hwui/OpenGLRenderer.cpp b/libs/hwui/OpenGLRenderer.cpp
index 033d8e2efd58..4ce30b0078a0 100644
--- a/libs/hwui/OpenGLRenderer.cpp
+++ b/libs/hwui/OpenGLRenderer.cpp
@@ -544,10 +544,12 @@ void OpenGLRenderer::drawText(const char* text, int bytesCount, int count,
const GLfloat g = a * ((color >> 8) & 0xFF) / 255.0f;
const GLfloat b = a * ((color ) & 0xFF) / 255.0f;
- mCaches.fontRenderer.setFont(paint, SkTypeface::UniqueID(paint->getTypeface()),
+ FontRenderer& fontRenderer = mCaches.fontRenderer.getFontRenderer(paint);
+ fontRenderer.setFont(paint, SkTypeface::UniqueID(paint->getTypeface()),
paint->getTextSize());
if (mHasShadow) {
glActiveTexture(gTextureUnits[0]);
+ mCaches.dropShadowCache.setFontRenderer(fontRenderer);
const ShadowTexture* shadow = mCaches.dropShadowCache.get(paint, text, bytesCount,
count, mShadowRadius);
const AutoTexture autoCleanup(shadow);
@@ -562,11 +564,11 @@ void OpenGLRenderer::drawText(const char* text, int bytesCount, int count,
GLuint textureUnit = 0;
glActiveTexture(gTextureUnits[textureUnit]);
- setupTextureAlpha8(mCaches.fontRenderer.getTexture(), 0, 0, textureUnit, x, y, r, g, b, a,
+ setupTextureAlpha8(fontRenderer.getTexture(), 0, 0, textureUnit, x, y, r, g, b, a,
mode, false, true);
const Rect& clip = mSnapshot->getLocalClip();
- mCaches.fontRenderer.renderText(paint, &clip, text, 0, bytesCount, count, x, y);
+ fontRenderer.renderText(paint, &clip, text, 0, bytesCount, count, x, y);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
glDisableVertexAttribArray(mCaches.currentProgram->getAttrib("texCoords"));