Flutter Engine
The Flutter Engine
third_party
skia
gm
blurtextsmallradii.cpp
Go to the documentation of this file.
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/gm.h
"
9
#include "
include/core/SkBlurTypes.h
"
10
#include "
include/core/SkCanvas.h
"
11
#include "
include/core/SkColor.h
"
12
#include "
include/core/SkFont.h
"
13
#include "
include/core/SkMaskFilter.h
"
14
#include "
include/core/SkPaint.h
"
15
#include "
tools/fonts/FontToolUtils.h
"
16
17
// GM to check the behavior from chrome bug:745290
18
DEF_SIMPLE_GM
(blurSmallRadii, canvas, 100, 100) {
19
double
sigmas[] = {0.5, 0.75, 1.0, 1.5, 2.5};
20
SkPaint
paint
;
21
SkFont
font
=
ToolUtils::DefaultPortableFont
();
22
23
for
(
auto
sigma : sigmas) {
24
paint
.setColor(
SK_ColorBLACK
);
25
paint
.setAntiAlias(
true
);
26
paint
.setMaskFilter(
SkMaskFilter::MakeBlur
(
kNormal_SkBlurStyle
, sigma));
27
canvas->drawString(
"Guest"
, 20, 10,
font
,
paint
);
28
29
paint
.setMaskFilter(
nullptr
);
30
paint
.setColor(
SK_ColorWHITE
);
31
canvas->drawString(
"Guest"
, 20, 10,
font
,
paint
);
32
canvas->translate(0, 20);
33
}
34
}
FontToolUtils.h
SkBlurTypes.h
kNormal_SkBlurStyle
@ kNormal_SkBlurStyle
fuzzy inside and outside
Definition:
SkBlurTypes.h:12
SkCanvas.h
SkColor.h
SK_ColorBLACK
constexpr SkColor SK_ColorBLACK
Definition:
SkColor.h:103
SK_ColorWHITE
constexpr SkColor SK_ColorWHITE
Definition:
SkColor.h:122
SkFont.h
SkMaskFilter.h
SkPaint.h
DEF_SIMPLE_GM
DEF_SIMPLE_GM(blurSmallRadii, canvas, 100, 100)
Definition:
blurtextsmallradii.cpp:18
SkFont
Definition:
SkFont.h:35
SkMaskFilter::MakeBlur
static sk_sp< SkMaskFilter > MakeBlur(SkBlurStyle style, SkScalar sigma, bool respectCTM=true)
Definition:
SkBlurMaskFilterImpl.cpp:535
SkPaint
Definition:
SkPaint.h:44
paint
const Paint & paint
Definition:
color_source.cc:38
gm.h
ToolUtils::DefaultPortableFont
SkFont DefaultPortableFont()
Definition:
FontToolUtils.cpp:202
gen_test_font.font
font
Font Metadata and Metrics.
Definition:
gen_test_font.py:26
Generated on Sun Jun 23 2024 21:55:58 for Flutter Engine by
1.9.4