Debian Codegraph @

docs/examples/Soft_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(Soft_Light, 256, 256, false, 3) {
5 void draw(SkCanvas* canvas) {
6 const SkColor4f colors[] = { {1,1,1,1}, {1,1,1,0x3F/255.f} };
7 SkPaint paint;
8 paint.setBlendMode(SkBlendMode::kSoftLight);
9 paint.setShader(SkShaders::RadialGradient({ 128, 128}, 100,
10 {{colors, {}, SkTileMode::kClamp}, {}}));
11 canvas->drawImage(image, 0, 0);
12 canvas->drawCircle(128, 128, 100, paint);
13 }
14 } // END FIDDLE