| 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 19 matching lines...) Expand all Loading... |
| 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(SkFloatToScalar(0.002f), |
| 38 SkFloatToScalar(0.0f), | 38 SkFloatToScalar(0.0f), |
| 39 SkFloatToScalar(0.0f), | 39 SkFloatToScalar(0.0f), |
| 40 (SkColor)0xFF000000))->unref(); | 40 (SkColor)0xFF000000, |
| 41 SkBlurDrawLooper::kNone_BlurFlag))->un
ref(); |
| 41 | 42 |
| 42 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"; |
| 43 size_t len = strlen(text); | 44 size_t len = strlen(text); |
| 44 | 45 |
| 45 canvas->drawTextOnPathHV(text, len, path, 0, | 46 canvas->drawTextOnPathHV(text, len, path, 0, |
| 46 SkFloatToScalar(-0.025f), paint); | 47 SkFloatToScalar(-0.025f), paint); |
| 47 canvas->restore(); | 48 canvas->restore(); |
| 48 } | 49 } |
| 49 | 50 |
| 50 static void textPathMatrix(SkCanvas* canvas) { | 51 static void textPathMatrix(SkCanvas* canvas) { |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 typedef SampleView INHERITED; | 166 typedef SampleView INHERITED; |
| 166 }; | 167 }; |
| 167 | 168 |
| 168 ////////////////////////////////////////////////////////////////////////////// | 169 ////////////////////////////////////////////////////////////////////////////// |
| 169 | 170 |
| 170 static SkView* MyFactory() { | 171 static SkView* MyFactory() { |
| 171 return new TextOnPathView; | 172 return new TextOnPathView; |
| 172 } | 173 } |
| 173 | 174 |
| 174 static SkViewRegister reg(MyFactory); | 175 static SkViewRegister reg(MyFactory); |
| OLD | NEW |