Debian Codegraph @

docs/examples/Hard_Light.cpp

raw
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 REG_FIDDLE(Hard_Light, 256, 256, false, 3) {
5 void draw(SkCanvas* canvas) {
6 canvas->drawImage(image, 0, 0);
7 const SkColor4f colors[] = { {1,1,1,1}, {0,0,0,0} };
8 SkPaint paint;
9 paint.setBlendMode(SkBlendMode::kHardLight);
10 paint.setShader(SkShaders::RadialGradient({ 128, 128}, 100,
11 {{colors, {}, SkTileMode::kClamp}, {}}));
12 canvas->clipRect({0, 128, 256, 256});
13 canvas->drawPaint(paint);
14 }
15 } // END FIDDLE