2017-08-14 18:58:14 +00:00
|
|
|
/*
|
|
|
|
* Copyright 2017 Google Inc.
|
|
|
|
*
|
|
|
|
* Use of this source code is governed by a BSD-style license that can be
|
|
|
|
* found in the LICENSE file.
|
|
|
|
*/
|
|
|
|
|
2019-04-23 17:05:21 +00:00
|
|
|
#include "gm/gm.h"
|
2019-05-01 14:59:30 +00:00
|
|
|
#include "include/core/SkBlurTypes.h"
|
|
|
|
#include "include/core/SkCanvas.h"
|
2019-04-23 17:05:21 +00:00
|
|
|
#include "include/core/SkColor.h"
|
|
|
|
#include "include/core/SkFont.h"
|
|
|
|
#include "include/core/SkMaskFilter.h"
|
2019-05-01 14:59:30 +00:00
|
|
|
#include "include/core/SkPaint.h"
|
2017-08-14 18:58:14 +00:00
|
|
|
|
|
|
|
// GM to check the behavior from chrome bug:745290
|
|
|
|
DEF_SIMPLE_GM(blurSmallRadii, canvas, 100, 100) {
|
|
|
|
double sigmas[] = {0.5, 0.75, 1.0, 1.5, 2.5};
|
|
|
|
SkPaint paint;
|
|
|
|
|
|
|
|
for (auto sigma : sigmas) {
|
|
|
|
paint.setColor(SK_ColorBLACK);
|
|
|
|
paint.setAntiAlias(true);
|
2018-03-14 17:01:17 +00:00
|
|
|
paint.setMaskFilter(SkMaskFilter::MakeBlur(kNormal_SkBlurStyle, sigma));
|
2019-01-07 14:31:58 +00:00
|
|
|
canvas->drawString("Guest", 20, 10, SkFont(), paint);
|
2017-08-14 18:58:14 +00:00
|
|
|
|
|
|
|
paint.setMaskFilter(nullptr);
|
|
|
|
paint.setColor(SK_ColorWHITE);
|
2019-01-07 14:31:58 +00:00
|
|
|
canvas->drawString("Guest", 20, 10, SkFont(), paint);
|
2017-08-14 18:58:14 +00:00
|
|
|
canvas->translate(0, 20);
|
|
|
|
}
|
|
|
|
}
|