blob: e51370d0148e2e794eea2c0f49a7ba485cf37050 [file] [log] [blame]
Mike Kleinfd35c742017-05-15 15:55:54 -04001/*
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
Mike Kleinc0bd9f92019-04-23 12:05:21 -05008#include "gm/gm.h"
9#include "include/effects/SkGradientShader.h"
Mike Kleinfd35c742017-05-15 15:55:54 -040010
11// All we're looking for here is that we see a smooth gradient.
12DEF_SIMPLE_GM(radial_gradient_precision, canvas, 200, 200) {
Mike Klein1b258182019-03-13 15:49:23 -050013 SkPoint center = {1000, 1000};
Mike Kleinfd35c742017-05-15 15:55:54 -040014 SkScalar radius = 40;
Mike Klein1b258182019-03-13 15:49:23 -050015 SkColor colors[] = {SK_ColorBLACK, SK_ColorGREEN};
Mike Kleinfd35c742017-05-15 15:55:54 -040016
17 SkPaint p;
18 p.setShader(SkGradientShader::MakeRadial(center, radius,
19 colors, nullptr, SK_ARRAY_COUNT(colors),
Mike Reedfae8fce2019-04-03 10:27:45 -040020 SkTileMode::kRepeat));
Mike Kleinfd35c742017-05-15 15:55:54 -040021 canvas->drawPaint(p);
22}