Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
third_party
skia
gm
radial_gradient_precision.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/SkCanvas.h
"
10
#include "
include/core/SkColor.h
"
11
#include "
include/core/SkPaint.h
"
12
#include "
include/core/SkPoint.h
"
13
#include "
include/core/SkScalar.h
"
14
#include "
include/core/SkShader.h
"
15
#include "
include/core/SkTileMode.h
"
16
#include "
include/core/SkTypes.h
"
17
#include "
include/effects/SkGradientShader.h
"
18
19
// All we're looking for here is that we see a smooth gradient.
20
DEF_SIMPLE_GM
(radial_gradient_precision, canvas, 200, 200) {
21
SkPoint
center
= {1000, 1000};
22
SkScalar
radius = 40;
23
SkColor
colors[] = {
SK_ColorBLACK
,
SK_ColorGREEN
};
24
25
SkPaint
p;
26
p.setShader(
SkGradientShader::MakeRadial
(
center
, radius,
27
colors,
nullptr
, std::size(colors),
28
SkTileMode::kRepeat
));
29
canvas->drawPaint(p);
30
}
SkCanvas.h
SkColor.h
SkColor
uint32_t SkColor
Definition
SkColor.h:37
SK_ColorBLACK
constexpr SkColor SK_ColorBLACK
Definition
SkColor.h:103
SK_ColorGREEN
constexpr SkColor SK_ColorGREEN
Definition
SkColor.h:131
SkGradientShader.h
SkPaint.h
SkPoint.h
SkScalar.h
SkShader.h
SkTileMode.h
SkTileMode::kRepeat
@ kRepeat
SkTypes.h
center
static SkScalar center(float pos0, float pos1)
Definition
TouchGesture.cpp:193
SkGradientShader::MakeRadial
static sk_sp< SkShader > MakeRadial(const SkPoint ¢er, SkScalar radius, const SkColor colors[], const SkScalar pos[], int count, SkTileMode mode, uint32_t flags=0, const SkMatrix *localMatrix=nullptr)
Definition
SkRadialGradient.cpp:122
SkPaint
Definition
SkPaint.h:44
SkScalar
float SkScalar
Definition
extension.cpp:12
gm.h
DEF_SIMPLE_GM
#define DEF_SIMPLE_GM(NAME, CANVAS, W, H)
Definition
gm.h:50
SkPoint
Definition
SkPoint_impl.h:163
Generated on Fri Apr 26 2024 06:16:08 for Flutter Engine by
1.9.8