blob: 62572ce49dcef216ec4b8c6a96ba6056a3895fe2 [file] [log] [blame]
Herb Derbydf33fef2017-08-14 14:58:14 -04001/*
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 Derbydf33fef2017-08-14 14:58:14 -04009#include "SkColor.h"
Mike Reed1be1f8d2018-03-14 13:01:17 -040010#include "SkMaskFilter.h"
Herb Derbydf33fef2017-08-14 14:58:14 -040011
12// GM to check the behavior from chrome bug:745290
13DEF_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 Reed1be1f8d2018-03-14 13:01:17 -040020 paint.setMaskFilter(SkMaskFilter::MakeBlur(kNormal_SkBlurStyle, sigma));
Herb Derbydf33fef2017-08-14 14:58:14 -040021 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}