aboutsummaryrefslogtreecommitdiffhomepage
path: root/xcode/hostapp/test.cpp
diff options
context:
space:
mode:
authorGravatar reed@android.com <reed@android.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2008-12-23 01:27:39 +0000
committerGravatar reed@android.com <reed@android.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2008-12-23 01:27:39 +0000
commit76aa34bf8e6f25ff7bd59b63e63ebb754d09105e (patch)
tree9c6344b12de8539c2279ed79d11c49e550d694e4 /xcode/hostapp/test.cpp
parent4df53b0597bf23fe3653f08eaeb381ad8896877b (diff)
add text to hostapp sample
rename duplicate of SkSVGPath.cpp git-svn-id: http://skia.googlecode.com/svn/trunk@45 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'xcode/hostapp/test.cpp')
-rw-r--r--xcode/hostapp/test.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/xcode/hostapp/test.cpp b/xcode/hostapp/test.cpp
index 67f833261f..4f66a826bf 100644
--- a/xcode/hostapp/test.cpp
+++ b/xcode/hostapp/test.cpp
@@ -13,6 +13,17 @@ static void sampleDraw(SkCanvas* canvas) {
canvas->drawCircle(SkIntToScalar(100), SkIntToScalar(100),
SkIntToScalar(90), paint);
+
+ const char text[] = "fry42";
+ const size_t len = strlen(text);
+
+ paint.setColor(SK_ColorWHITE);
+ paint.setTextSize(SkIntToScalar(50));
+ canvas->drawText(text, len, SkIntToScalar(100), SkIntToScalar(50), paint);
+ paint.setTextAlign(SkPaint::kCenter_Align);
+ canvas->drawText(text, len, SkIntToScalar(100), SkIntToScalar(100), paint);
+ paint.setTextAlign(SkPaint::kRight_Align);
+ canvas->drawText(text, len, SkIntToScalar(100), SkIntToScalar(150), paint);
}
static CGImageRef gImage;