Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
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"
10#include "include/core/SkFont.h"
12#include "include/core/SkPath.h"
15
16DEF_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
24 f.setSize(325);
25 f.setEdging(SkFont::Edging::kAntiAlias);
26
27 canvas->drawString("Gradient", 10, 250, f, p);
28}
uint32_t SkColor
Definition SkColor.h:37
@ kAntiAlias
may have transparent pixels on glyph edges
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)
#define DEF_SIMPLE_GM(NAME, CANVAS, W, H)
Definition gm.h:50
SkFont DefaultPortableFont()