Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Soft_Light.cpp
Go to the documentation of this file.
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.
4// HASH=ac93f30dff13f8a8bb31398de370863b
5REG_FIDDLE(Soft_Light, 256, 256, false, 3) {
6void draw(SkCanvas* canvas) {
7 const SkColor colors[] = { 0xFFFFFFFF, 0x3FFFFFFF };
9 paint.setBlendMode(SkBlendMode::kSoftLight);
10 paint.setShader(SkGradientShader::MakeRadial({ 128, 128}, 100, colors,
11 nullptr, std::size(colors), SkTileMode::kClamp));
12 canvas->drawImage(image, 0, 0);
13 canvas->drawCircle(128, 128, 100, paint);
14}
15} // END FIDDLE
@ kSoftLight
lighten or darken, depending on source
uint32_t SkColor
Definition SkColor.h:37
static void draw(SkCanvas *canvas, SkRect &target, int x, int y)
Definition aaclip.cpp:27
void drawImage(const SkImage *image, SkScalar left, SkScalar top)
Definition SkCanvas.h:1528
void drawCircle(SkScalar cx, SkScalar cy, SkScalar radius, const SkPaint &paint)
static sk_sp< SkShader > MakeRadial(const SkPoint &center, SkScalar radius, const SkColor colors[], const SkScalar pos[], int count, SkTileMode mode, uint32_t flags=0, const SkMatrix *localMatrix=nullptr)
const Paint & paint
sk_sp< SkImage > image
Definition examples.cpp:29
#define REG_FIDDLE(NAME, W, H, TEXT, I)
Definition examples.h:60