Flutter Engine
The Flutter Engine
Canvas_saveLayer_3.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.
4REG_FIDDLE(Canvas_saveLayer_3, 256, 256, false, 3) {
5void draw(SkCanvas* canvas) {
6 canvas->drawImage(image, 0, 0);
9 paint.setBlendMode(SkBlendMode::kPlus);
11 rec.fPaint = &paint;
12 canvas->saveLayer(rec);
13 paint.setBlendMode(SkBlendMode::kClear);
14 canvas->drawCircle(128, 128, 96, paint);
15 canvas->restore();
16}
17} // END FIDDLE
REG_FIDDLE(Canvas_saveLayer_3, 256, 256, false, 3)
@ kPlus
r = min(s + d, 1)
@ kClear
r = 0
static void draw(SkCanvas *canvas, SkRect &target, int x, int y)
Definition: aaclip.cpp:27
int saveLayer(const SkRect *bounds, const SkPaint *paint)
Definition: SkCanvas.cpp:496
void restore()
Definition: SkCanvas.cpp:461
@ kInitWithPrevious_SaveLayerFlag
initializes with previous contents
Definition: SkCanvas.h:672
void drawImage(const SkImage *image, SkScalar left, SkScalar top)
Definition: SkCanvas.h:1528
void drawCircle(SkScalar cx, SkScalar cy, SkScalar radius, const SkPaint &paint)
Definition: SkCanvas.cpp:2707
const Paint & paint
Definition: color_source.cc:38
sk_sp< const SkImage > image
Definition: SkRecords.h:269
const SkPaint * fPaint
Definition: SkCanvas.h:743
SaveLayerFlags fSaveLayerFlags
Definition: SkCanvas.h:763