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 "SkBlurMask.h" | 9 #include "SkBlurMask.h" |
10 #include "SkBlurDrawLooper.h" | 10 #include "SkBlurDrawLooper.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 path.addArc(rect, SkIntToScalar(280), SkIntToScalar(350)); | 28 path.addArc(rect, SkIntToScalar(280), SkIntToScalar(350)); |
29 | 29 |
30 paint.setAntiAlias(true); | 30 paint.setAntiAlias(true); |
31 paint.setStyle(SkPaint::kStroke_Style); | 31 paint.setStyle(SkPaint::kStroke_Style); |
32 paint.setColor(0xFFFF0000); | 32 paint.setColor(0xFFFF0000); |
33 paint.setTextSize(0.085f); | 33 paint.setTextSize(0.085f); |
34 paint.setStrokeWidth(.005f); | 34 paint.setStrokeWidth(.005f); |
35 | 35 |
36 canvas->drawPath(path, paint); | 36 canvas->drawPath(path, paint); |
37 | 37 |
38 paint.setLooper(new SkBlurDrawLooper(SK_ColorBLACK, | 38 paint.setLooper(SkBlurDrawLooper::Create(SK_ColorBLACK, |
39 SkBlurMask::ConvertRadiusToSigma(0.002f
), | 39 SkBlurMask::ConvertRadiusToSigma(0.
002f), |
40 0.0f, | 40 0.0f, |
41 0.0f))->unref(); | 41 0.0f))->unref(); |
42 | 42 |
43 const char* text = "DRAWING STROKED TEXT WITH A BLUR ON A PATH"; | 43 const char* text = "DRAWING STROKED TEXT WITH A BLUR ON A PATH"; |
44 size_t len = strlen(text); | 44 size_t len = strlen(text); |
45 | 45 |
46 canvas->drawTextOnPathHV(text, len, path, 0, | 46 canvas->drawTextOnPathHV(text, len, path, 0, |
47 -0.025f, paint); | 47 -0.025f, paint); |
48 canvas->restore(); | 48 canvas->restore(); |
49 } | 49 } |
50 | 50 |
51 static void textPathMatrix(SkCanvas* canvas) { | 51 static void textPathMatrix(SkCanvas* canvas) { |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 typedef SampleView INHERITED; | 166 typedef SampleView INHERITED; |
167 }; | 167 }; |
168 | 168 |
169 ////////////////////////////////////////////////////////////////////////////// | 169 ////////////////////////////////////////////////////////////////////////////// |
170 | 170 |
171 static SkView* MyFactory() { | 171 static SkView* MyFactory() { |
172 return new TextOnPathView; | 172 return new TextOnPathView; |
173 } | 173 } |
174 | 174 |
175 static SkViewRegister reg(MyFactory); | 175 static SkViewRegister reg(MyFactory); |
OLD | NEW |