Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
third_party
skia
gm
crbug_1073670.cpp
Go to the documentation of this file.
1
/*
2
* Copyright 2020 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/SkCanvas.h
"
10
#include "
include/core/SkFont.h
"
11
#include "
include/core/SkPaint.h
"
12
#include "
include/core/SkPath.h
"
13
#include "
include/effects/SkGradientShader.h
"
14
#include "
tools/fonts/FontToolUtils.h
"
15
16
DEF_SIMPLE_GM
(crbug_1073670, canvas, 250, 250) {
17
SkPoint
pts[] = {{0, 0}, {0, 250}};
18
SkColor
colors[] = {0xFFFF0000, 0xFF0000FF};
19
auto
sh =
SkGradientShader::MakeLinear
(pts, colors,
nullptr
, 2,
SkTileMode::kClamp
);
20
SkPaint
p;
21
p.setShader(sh);
22
23
SkFont
f =
ToolUtils::DefaultPortableFont
();
24
f.setSize(325);
25
f.setEdging(
SkFont::Edging::kAntiAlias
);
26
27
canvas->drawString(
"Gradient"
, 10, 250, f, p);
28
}
FontToolUtils.h
SkCanvas.h
SkColor
uint32_t SkColor
Definition
SkColor.h:37
SkFont.h
SkGradientShader.h
SkPaint.h
SkPath.h
SkTileMode::kClamp
@ kClamp
SkFont
Definition
SkFont.h:35
SkFont::Edging::kAntiAlias
@ kAntiAlias
may have transparent pixels on glyph edges
SkGradientShader::MakeLinear
static sk_sp< SkShader > MakeLinear(const SkPoint pts[2], const SkColor colors[], const SkScalar pos[], int count, SkTileMode mode, uint32_t flags=0, const SkMatrix *localMatrix=nullptr)
Definition
SkLinearGradient.cpp:131
SkPaint
Definition
SkPaint.h:44
gm.h
DEF_SIMPLE_GM
#define DEF_SIMPLE_GM(NAME, CANVAS, W, H)
Definition
gm.h:50
ToolUtils::DefaultPortableFont
SkFont DefaultPortableFont()
Definition
FontToolUtils.cpp:202
SkPoint
Definition
SkPoint_impl.h:163
Generated on Fri Apr 26 2024 06:16:01 for Flutter Engine by
1.9.8