diff options
| author | 2012-01-17 17:40:24 -0800 | |
|---|---|---|
| committer | 2012-01-17 17:40:24 -0800 | |
| commit | fb9ffe02609c9c4ffca64927e72bc935cfe87768 (patch) | |
| tree | 38229c7aba02f60e62caf345cfa75502d263e457 /libs/hwui/OpenGLRenderer.cpp | |
| parent | 1be4afecb752559092654c0e9f4ca302b6d04e9c (diff) | |
| parent | eb9a5367e8f0e970db8509ffb2584f5376bc62ed (diff) | |
Merge "First pass at implementing Canvas.drawPosText() in GL"
Diffstat (limited to 'libs/hwui/OpenGLRenderer.cpp')
| -rw-r--r-- | libs/hwui/OpenGLRenderer.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/libs/hwui/OpenGLRenderer.cpp b/libs/hwui/OpenGLRenderer.cpp index 12ed2054c3d3..6ec87f3da143 100644 --- a/libs/hwui/OpenGLRenderer.cpp +++ b/libs/hwui/OpenGLRenderer.cpp @@ -2082,6 +2082,17 @@ void OpenGLRenderer::drawRect(float left, float top, float right, float bottom, } } +void OpenGLRenderer::drawPosText(const char* text, int bytesCount, int count, + const float* positions, SkPaint* paint) { + if (text == NULL || count == 0) { + return; + } + if (mSnapshot->isIgnored()) return; + + // TODO: implement properly + drawText(text, bytesCount, count, 0, 0, paint); +} + void OpenGLRenderer::drawText(const char* text, int bytesCount, int count, float x, float y, SkPaint* paint, float length) { if (text == NULL || count == 0) { @@ -2120,10 +2131,11 @@ void OpenGLRenderer::drawText(const char* text, int bytesCount, int count, y = (int) floorf(y + mSnapshot->transform->getTranslateY() + 0.5f); } - FontRenderer& fontRenderer = mCaches.fontRenderer.getFontRenderer(paint); #if DEBUG_GLYPHS ALOGD("OpenGLRenderer drawText() with FontID=%d", SkTypeface::UniqueID(paint->getTypeface())); #endif + + FontRenderer& fontRenderer = mCaches.fontRenderer.getFontRenderer(paint); fontRenderer.setFont(paint, SkTypeface::UniqueID(paint->getTypeface()), paint->getTextSize()); |