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"
9 #include "SkBlurMaskFilter.h"
10 #include "SkColor.h"
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);
20         paint.setMaskFilter(SkBlurMaskFilter::Make(kNormal_SkBlurStyle, sigma));
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 }
29