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