From eb9a5367e8f0e970db8509ffb2584f5376bc62ed Mon Sep 17 00:00:00 2001 From: Romain Guy Date: Tue, 17 Jan 2012 17:39:26 -0800 Subject: First pass at implementing Canvas.drawPosText() in GL Change-Id: Ia3ac347e95d57eb86c63045156c8dbc0572b03cb --- libs/hwui/OpenGLRenderer.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'libs/hwui/OpenGLRenderer.cpp') 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()); -- cgit v1.2.3-59-g8ed1b