Fix text-as-path with skshader on gpu

Review URL: http://codereview.appspot.com/4576057/



git-svn-id: http://skia.googlecode.com/svn/trunk@1575 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/samplecode/SampleShaderText.cpp b/samplecode/SampleShaderText.cpp
index 2748b55..dedf04d 100644
--- a/samplecode/SampleShaderText.cpp
+++ b/samplecode/SampleShaderText.cpp
@@ -118,7 +118,7 @@
     virtual void onDrawContent(SkCanvas* canvas) {
         const char text[] = "Shaded Text";
         const int textLen = SK_ARRAY_COUNT(text) - 1;
-        static int pointSize = 48;
+        static int pointSize = 36;
 
         int w = pointSize * textLen;
         int h = pointSize;
@@ -166,17 +166,29 @@
         canvas->save();
         canvas->translate(SkIntToScalar(20), SkIntToScalar(10));
 
+        SkPath path;
+        path.arcTo(SkRect::MakeXYWH(-40, 15, 300, 90), 
+                   SK_Scalar1 * 225,  SK_Scalar1 * 90, false);
+        path.close();
+
         static const int testsPerCol = 8;
         static const int rowHeight = 60;
         static const int colWidth = 300;
         canvas->save();
         for (size_t s = 0; s < SK_ARRAY_COUNT(shaders); s++) {
             canvas->save();
-            canvas->translate(SkIntToScalar((s / testsPerCol) * colWidth),
-                              SkIntToScalar((s % testsPerCol) * rowHeight));
+            int i = 2*s;
+            canvas->translate(SkIntToScalar((i / testsPerCol) * colWidth),
+                              SkIntToScalar((i % testsPerCol) * rowHeight));
             paint.setShader(shaders[s])->unref();
             canvas->drawText(text, textLen, 0, textBase, paint);
             canvas->restore();
+            canvas->save();
+            ++i;
+            canvas->translate(SkIntToScalar((i / testsPerCol) * colWidth),
+                              SkIntToScalar((i % testsPerCol) * rowHeight));
+            canvas->drawTextOnPath(text, textLen, path, NULL, paint);
+            canvas->restore();
         }
         canvas->restore();