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 "SkColor.h" 10 #include "SkFont.h" 11 #include "SkMaskFilter.h" 12 13 // GM to check the behavior from chrome bug:745290 14 DEF_SIMPLE_GM(blurSmallRadii, canvas, 100, 100) { 15 double sigmas[] = {0.5, 0.75, 1.0, 1.5, 2.5}; 16 SkPaint paint; 17 18 for (auto sigma : sigmas) { 19 paint.setColor(SK_ColorBLACK); 20 paint.setAntiAlias(true); 21 paint.setMaskFilter(SkMaskFilter::MakeBlur(kNormal_SkBlurStyle, sigma)); 22 canvas->drawString("Guest", 20, 10, SkFont(), paint); 23 24 paint.setMaskFilter(nullptr); 25 paint.setColor(SK_ColorWHITE); 26 canvas->drawString("Guest", 20, 10, SkFont(), paint); 27 canvas->translate(0, 20); 28 } 29 } 30