diff options
| author | 2010-08-20 18:42:54 -0700 | |
|---|---|---|
| committer | 2010-08-20 18:42:54 -0700 | |
| commit | 582ac3fa1ec77cba90381f82c5ca118c91a21002 (patch) | |
| tree | ebb825c364b2a1bed7c86bfa52293329f4b72c35 /libs/hwui/OpenGLRenderer.cpp | |
| parent | a6937f7a11ec5c1c3cde4fdb9a5daba040a5f8d0 (diff) | |
| parent | a80d32f7b69aa37026ab99e4ade1ad86dae76a81 (diff) | |
Merge "Add support for textScaleX."
Diffstat (limited to 'libs/hwui/OpenGLRenderer.cpp')
| -rw-r--r-- | libs/hwui/OpenGLRenderer.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/libs/hwui/OpenGLRenderer.cpp b/libs/hwui/OpenGLRenderer.cpp index 344068751e05..49d49da44f44 100644 --- a/libs/hwui/OpenGLRenderer.cpp +++ b/libs/hwui/OpenGLRenderer.cpp @@ -575,6 +575,14 @@ void OpenGLRenderer::drawText(const char* text, int bytesCount, int count, return; } + float scaleX = paint->getTextScaleX(); + bool applyScaleX = scaleX < 0.9999f || scaleX > 1.0001f; + if (applyScaleX) { + save(0); + translate(x - (x * scaleX), 0.0f); + scale(scaleX, 1.0f); + } + float length = -1.0f; switch (paint->getTextAlign()) { case SkPaint::kCenter_Align: @@ -626,6 +634,10 @@ void OpenGLRenderer::drawText(const char* text, int bytesCount, int count, glDisableVertexAttribArray(mCurrentProgram->getAttrib("texCoords")); drawTextDecorations(text, bytesCount, length, x, y, paint); + + if (applyScaleX) { + restore(); + } } void OpenGLRenderer::drawPath(SkPath* path, SkPaint* paint) { |