1 // Copyright 2019 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 // HASH=ac2fe555e2196e15863ea4ce74db3d54
5 REG_FIDDLE(Hard_Light, 256, 256, false, 3) {
draw(SkCanvas * canvas)6 void draw(SkCanvas* canvas) {
7     canvas->drawImage(image, 0, 0);
8     const SkColor colors[] = { 0xFFFFFFFF, 0x00000000 };
9     SkPaint paint;
10     paint.setBlendMode(SkBlendMode::kHardLight);
11     paint.setShader(SkGradientShader::MakeRadial({ 128, 128}, 100, colors,
12          nullptr, SK_ARRAY_COUNT(colors), SkTileMode::kClamp));
13     canvas->clipRect({0, 128, 256, 256});
14     canvas->drawPaint(paint);
15 }
16 }  // END FIDDLE
17