OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BD-style license that can be | 4 * Use of this source code is governed by a BD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "gm.h" | 8 #include "gm.h" |
9 | 9 |
10 #include "SkBlurMask.h" | 10 #include "SkBlurMask.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 // setup up maskfilter | 25 // setup up maskfilter |
26 const SkScalar kSigma = SkBlurMask::ConvertRadiusToSigma(SkIntToScalar(4
0)); | 26 const SkScalar kSigma = SkBlurMask::ConvertRadiusToSigma(SkIntToScalar(4
0)); |
27 | 27 |
28 SkPaint blurPaint(paint); | 28 SkPaint blurPaint(paint); |
29 blurPaint.setMaskFilter(SkBlurMaskFilter::Make(kNormal_SkBlurStyle, kSig
ma)); | 29 blurPaint.setMaskFilter(SkBlurMaskFilter::Make(kNormal_SkBlurStyle, kSig
ma)); |
30 | 30 |
31 SkTextBlobBuilder builder; | 31 SkTextBlobBuilder builder; |
32 | 32 |
33 sk_tool_utils::add_to_text_blob(&builder, text, paint, 0, 0); | 33 sk_tool_utils::add_to_text_blob(&builder, text, paint, 0, 0); |
34 | 34 |
35 SkAutoTUnref<const SkTextBlob> blob(builder.build()); | 35 sk_sp<SkTextBlob> blob(builder.make()); |
36 canvas->drawTextBlob(blob.get(), 10, 200, blurPaint); | 36 canvas->drawTextBlob(blob, 10, 200, blurPaint); |
37 canvas->drawTextBlob(blob.get(), 10, 200, paint); | 37 canvas->drawTextBlob(blob, 10, 200, paint); |
38 | 38 |
39 size_t len = strlen(text); | 39 size_t len = strlen(text); |
40 canvas->drawText(text, len, 10, 500, blurPaint); | 40 canvas->drawText(text, len, 10, 500, blurPaint); |
41 canvas->drawText(text, len, 10, 500, paint); | 41 canvas->drawText(text, len, 10, 500, paint); |
42 } | 42 } |
OLD | NEW |