Herb Derby | df33fef | 2017-08-14 14:58:14 -0400 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2017 Google Inc. |
| 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license that can be |
| 5 | * found in the LICENSE file. |
| 6 | */ |
| 7 | |
| 8 | #include "gm.h" |
Herb Derby | df33fef | 2017-08-14 14:58:14 -0400 | [diff] [blame] | 9 | #include "SkColor.h" |
Mike Reed | 1be1f8d | 2018-03-14 13:01:17 -0400 | [diff] [blame^] | 10 | #include "SkMaskFilter.h" |
Herb Derby | df33fef | 2017-08-14 14:58:14 -0400 | [diff] [blame] | 11 | |
| 12 | // GM to check the behavior from chrome bug:745290 |
| 13 | DEF_SIMPLE_GM(blurSmallRadii, canvas, 100, 100) { |
| 14 | double sigmas[] = {0.5, 0.75, 1.0, 1.5, 2.5}; |
| 15 | SkPaint paint; |
| 16 | |
| 17 | for (auto sigma : sigmas) { |
| 18 | paint.setColor(SK_ColorBLACK); |
| 19 | paint.setAntiAlias(true); |
Mike Reed | 1be1f8d | 2018-03-14 13:01:17 -0400 | [diff] [blame^] | 20 | paint.setMaskFilter(SkMaskFilter::MakeBlur(kNormal_SkBlurStyle, sigma)); |
Herb Derby | df33fef | 2017-08-14 14:58:14 -0400 | [diff] [blame] | 21 | canvas->drawString("Guest", 20, 10, paint); |
| 22 | |
| 23 | paint.setMaskFilter(nullptr); |
| 24 | paint.setColor(SK_ColorWHITE); |
| 25 | canvas->drawString("Guest", 20, 10, paint); |
| 26 | canvas->translate(0, 20); |
| 27 | } |
| 28 | } |