diff options
author | Romain Guy <romainguy@google.com> | 2010-07-22 13:08:20 -0700 |
---|---|---|
committer | Romain Guy <romainguy@google.com> | 2010-07-22 13:08:20 -0700 |
commit | 09147fbdc8206a0cac78bfe9083e7e15b3c5689c (patch) | |
tree | 16f155fd722b6fba13508a09c29b9e8ea5adfdd3 /libs/hwui/OpenGLRenderer.cpp | |
parent | 612f8da2bc994043f26a278a9b1c2b681eabc4c9 (diff) | |
download | frameworks_base-09147fbdc8206a0cac78bfe9083e7e15b3c5689c.zip frameworks_base-09147fbdc8206a0cac78bfe9083e7e15b3c5689c.tar.gz frameworks_base-09147fbdc8206a0cac78bfe9083e7e15b3c5689c.tar.bz2 |
Add support for text culling.
Change-Id: Ibf0adacdc5c64d40a8000b21d7cb0797d63efe29
Diffstat (limited to 'libs/hwui/OpenGLRenderer.cpp')
-rw-r--r-- | libs/hwui/OpenGLRenderer.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/libs/hwui/OpenGLRenderer.cpp b/libs/hwui/OpenGLRenderer.cpp index 8f04d92..58a3a69 100644 --- a/libs/hwui/OpenGLRenderer.cpp +++ b/libs/hwui/OpenGLRenderer.cpp @@ -530,11 +530,6 @@ void OpenGLRenderer::drawRect(float left, float top, float right, float bottom, } void OpenGLRenderer::drawText(const char* text, int count, float x, float y, SkPaint* paint) { - // TODO: Support paint's text alignments, proper clipping - if (quickReject(x, y, x + 1, y +1)) { - return; - } - int alpha; SkXfermode::Mode mode; getAlphaAndMode(paint, &alpha, &mode); @@ -556,8 +551,11 @@ void OpenGLRenderer::drawText(const char* text, int count, float x, float y, SkP // Always premultiplied glUniform4f(mDrawTextProgram->color, r, g, b, a); + // TODO: Implement scale properly + const Rect& clip = mSnapshot->getLocalClip(); + mFontRenderer.setFont(SkTypeface::UniqueID(paint->getTypeface()), paint->getTextSize()); - mFontRenderer.renderText(paint, text, count, 0, count, x, y); + mFontRenderer.renderText(paint, &clip, text, count, 0, count, x, y); glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); } |