Add support for textScaleX.

This will not look great because we render fonts using bitmaps, not
paths.

Change-Id: I01b87b81bfbdbfa28460a5d5309d38e2a65e77c4
diff --git a/libs/hwui/OpenGLRenderer.cpp b/libs/hwui/OpenGLRenderer.cpp
index 3440687..49d49da 100644
--- a/libs/hwui/OpenGLRenderer.cpp
+++ b/libs/hwui/OpenGLRenderer.cpp
@@ -575,6 +575,14 @@
         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 @@
     glDisableVertexAttribArray(mCurrentProgram->getAttrib("texCoords"));
 
     drawTextDecorations(text, bytesCount, length, x, y, paint);
+
+    if (applyScaleX) {
+        restore();
+    }
 }
 
 void OpenGLRenderer::drawPath(SkPath* path, SkPaint* paint) {
diff --git a/tests/HwAccelerationTest/AndroidManifest.xml b/tests/HwAccelerationTest/AndroidManifest.xml
index 3ac8c5e..564f13e 100644
--- a/tests/HwAccelerationTest/AndroidManifest.xml
+++ b/tests/HwAccelerationTest/AndroidManifest.xml
@@ -119,8 +119,7 @@
         <activity
                 android:name="TextActivity"
                 android:label="_Text"
-                android:theme="@android:style/Theme.NoTitleBar"
-        android:hardwareAccelerated="true">
+                android:theme="@android:style/Theme.NoTitleBar">
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
                 <category android:name="android.intent.category.LAUNCHER" />