OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 #include "SampleCode.h" | 8 #include "SampleCode.h" |
9 #include "SkBlurDrawLooper.h" | 9 #include "SkBlurDrawLooper.h" |
10 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 path.addArc(rect, SkIntToScalar(280), SkIntToScalar(350)); | 27 path.addArc(rect, SkIntToScalar(280), SkIntToScalar(350)); |
28 | 28 |
29 paint.setAntiAlias(true); | 29 paint.setAntiAlias(true); |
30 paint.setStyle(SkPaint::kStroke_Style); | 30 paint.setStyle(SkPaint::kStroke_Style); |
31 paint.setColor(0xFFFF0000); | 31 paint.setColor(0xFFFF0000); |
32 paint.setTextSize(SkFloatToScalar(0.085f)); | 32 paint.setTextSize(SkFloatToScalar(0.085f)); |
33 paint.setStrokeWidth(SkFloatToScalar(.005f)); | 33 paint.setStrokeWidth(SkFloatToScalar(.005f)); |
34 | 34 |
35 canvas->drawPath(path, paint); | 35 canvas->drawPath(path, paint); |
36 | 36 |
37 paint.setLooper(new SkBlurDrawLooper(SkFloatToScalar(0.002f), | 37 paint.setLooper(new SkBlurDrawLooper(SK_ColorBLACK, |
38 SkFloatToScalar(0.0f), | 38 SkFloatToScalar(0.5011f), |
39 SkFloatToScalar(0.0f), | 39 SkFloatToScalar(0.0f), |
40 (SkColor)0xFF000000))->unref(); | 40 SkFloatToScalar(0.0f)))->unref(); |
41 | 41 |
42 const char* text = "DRAWING STROKED TEXT WITH A BLUR ON A PATH"; | 42 const char* text = "DRAWING STROKED TEXT WITH A BLUR ON A PATH"; |
43 size_t len = strlen(text); | 43 size_t len = strlen(text); |
44 | 44 |
45 canvas->drawTextOnPathHV(text, len, path, 0, | 45 canvas->drawTextOnPathHV(text, len, path, 0, |
46 SkFloatToScalar(-0.025f), paint); | 46 SkFloatToScalar(-0.025f), paint); |
47 canvas->restore(); | 47 canvas->restore(); |
48 } | 48 } |
49 | 49 |
50 static void textPathMatrix(SkCanvas* canvas) { | 50 static void textPathMatrix(SkCanvas* canvas) { |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 typedef SampleView INHERITED; | 165 typedef SampleView INHERITED; |
166 }; | 166 }; |
167 | 167 |
168 ////////////////////////////////////////////////////////////////////////////// | 168 ////////////////////////////////////////////////////////////////////////////// |
169 | 169 |
170 static SkView* MyFactory() { | 170 static SkView* MyFactory() { |
171 return new TextOnPathView; | 171 return new TextOnPathView; |
172 } | 172 } |
173 | 173 |
174 static SkViewRegister reg(MyFactory); | 174 static SkViewRegister reg(MyFactory); |
OLD | NEW |