Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
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"
18
19// All we're looking for here is that we see a smooth gradient.
20DEF_SIMPLE_GM(radial_gradient_precision, canvas, 200, 200) {
21 SkPoint center = {1000, 1000};
22 SkScalar radius = 40;
24
25 SkPaint p;
26 p.setShader(SkGradientShader::MakeRadial(center, radius,
27 colors, nullptr, std::size(colors),
29 canvas->drawPaint(p);
30}
uint32_t SkColor
Definition SkColor.h:37
constexpr SkColor SK_ColorBLACK
Definition SkColor.h:103
constexpr SkColor SK_ColorGREEN
Definition SkColor.h:131
static SkScalar center(float pos0, float pos1)
static sk_sp< SkShader > MakeRadial(const SkPoint &center, SkScalar radius, const SkColor colors[], const SkScalar pos[], int count, SkTileMode mode, uint32_t flags=0, const SkMatrix *localMatrix=nullptr)
float SkScalar
Definition extension.cpp:12
#define DEF_SIMPLE_GM(NAME, CANVAS, W, H)
Definition gm.h:50