Index: gm/drawatlas.cpp |
diff --git a/gm/drawatlas.cpp b/gm/drawatlas.cpp |
index a906cbedeba9f2a97f80dbbbeb92321afb7ce91a..d8b77774940bab93144856c7d7ec34d41b93933f 100644 |
--- a/gm/drawatlas.cpp |
+++ b/gm/drawatlas.cpp |
@@ -100,3 +100,33 @@ private: |
typedef GM INHERITED; |
}; |
DEF_GM( return new DrawAtlasGM; ) |
+ |
+/////////////////////////////////////////////////////////////////////////////////////////////////// |
+ |
+DEF_SIMPLE_GM(drawTextRSXform, canvas, 1000, 1000) { |
+ const char text[] = "ABCDFGHJKLMNOPQRSTUVWXYZ"; |
+ const int N = sizeof(text) - 1; |
+ SkRSXform xform[N]; |
+ |
+ canvas->translate(0, 30); |
+ |
+ SkScalar x = 20; |
+ SkScalar dx = 20; |
+ SkScalar rad = 0; |
+ SkScalar drad = 2 * SK_ScalarPI / N; |
+ for (int i = 0; i < N; ++i) { |
+ xform[i].fSCos = SkScalarCos(rad); |
+ xform[i].fSSin = SkScalarSin(rad); |
+ xform[i].fTx = x; |
+ xform[i].fTy = 0; |
+ x += dx; |
+ rad += drad; |
+ } |
+ |
+ SkPaint paint; |
+ paint.setAntiAlias(true); |
+ paint.setTextSize(20); |
+ canvas->drawTextRSXform(text, N, xform, paint); |
+} |
+ |
+ |