1cb93a386Sopenharmony_ci// Copyright 2020 Google LLC.
2cb93a386Sopenharmony_ci// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
3cb93a386Sopenharmony_ci#include "tools/fiddle/examples.h"
4cb93a386Sopenharmony_ciREG_FIDDLE_SRGB(sweep_gradient_talk_4, 256, 256, false, 0, 0, false) {
5cb93a386Sopenharmony_civoid draw(SkCanvas* canvas) {
6cb93a386Sopenharmony_ci    SkColor colors[] = { 0xFF0000FF, 0xFF00FF00, 0xFFFF0000, 0xFF0000FF };
7cb93a386Sopenharmony_ci    float cx = 128, cy = 128;
8cb93a386Sopenharmony_ci    SkPaint paint;
9cb93a386Sopenharmony_ci    paint.setShader(SkGradientShader::MakeSweep(cx, cy, colors, nullptr, 4));
10cb93a386Sopenharmony_ci    paint.setAntiAlias(true);
11cb93a386Sopenharmony_ci
12cb93a386Sopenharmony_ci    canvas->drawPaint(paint);
13cb93a386Sopenharmony_ci}
14cb93a386Sopenharmony_ci}  // END FIDDLE
15