1 // Copyright 2020 Google LLC.
2 // Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
3 #include "tools/fiddle/examples.h"
4 REG_FIDDLE(skpaint_compose_shader, 256, 256, false, 0) {
5 // skpaint_compose_shader
draw(SkCanvas * canvas)6 void draw(SkCanvas* canvas) {
7 SkColor colors[2] = {SK_ColorBLUE, SK_ColorYELLOW};
8 SkPaint paint;
9 paint.setShader(SkShaders::Blend(
10 SkBlendMode::kDifference,
11 SkGradientShader::MakeRadial(SkPoint::Make(128.0f, 128.0f), 180.0f, colors, nullptr,
12 2, SkTileMode::kClamp, 0, nullptr),
13 SkPerlinNoiseShader::MakeTurbulence(0.025f, 0.025f, 2, 0.0f, nullptr)));
14 canvas->drawPaint(paint);
15 }
16 } // END FIDDLE
17