blob: a073407aafbf067f6ddd07914bc8f5fc2fb94309 [file] [log] [blame]
Herb Derby438775b2020-04-24 12:10:43 -04001/*
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"
Kevin Lubickbca43ec2023-10-30 10:11:22 -040014#include "tools/fonts/FontToolUtils.h"
Herb Derby438775b2020-04-24 12:10:43 -040015
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
Kevin Lubickbca43ec2023-10-30 10:11:22 -040023 SkFont f = ToolUtils::DefaultPortableFont();
Herb Derby438775b2020-04-24 12:10:43 -040024 f.setSize(325);
25 f.setEdging(SkFont::Edging::kAntiAlias);
26
27 canvas->drawString("Gradient", 10, 250, f, p);
28}