summaryrefslogtreecommitdiff
path: root/libs/hwui/OpenGLRenderer.cpp
diff options
context:
space:
mode:
author Romain Guy <romainguy@google.com> 2012-01-17 17:39:26 -0800
committer Romain Guy <romainguy@google.com> 2012-01-17 17:39:26 -0800
commiteb9a5367e8f0e970db8509ffb2584f5376bc62ed (patch)
treeb1edb8a663363a150fa25545f035372defbe7b70 /libs/hwui/OpenGLRenderer.cpp
parentd1d4bb70704e8f37d0823837eacdae21ebe0ed05 (diff)
First pass at implementing Canvas.drawPosText() in GL
Change-Id: Ia3ac347e95d57eb86c63045156c8dbc0572b03cb
Diffstat (limited to 'libs/hwui/OpenGLRenderer.cpp')
-rw-r--r--libs/hwui/OpenGLRenderer.cpp14
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());