1 // Copyright 2020 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(backdrop_blur_with_rrect_clip, 512, 512, false, 3) {
5 void draw(SkCanvas* canvas) {
6 const SkRect r = SkRect::MakeXYWH(128, 128, 256, 256);
7 const SkRRect rr = SkRRect::MakeRectXY(r, 128, 128);
9 canvas->drawImage(image, 0, 0);
12 canvas->clipRRect(rr, true);
14 sk_sp<SkImageFilter> filter = SkImageFilters::Blur(10, 10, nullptr);
16 p.setImageFilter(std::move(filter));
18 SkCanvas::SaveLayerRec slr(&r, &p, SkCanvas::kInitWithPrevious_SaveLayerFlag);
19 canvas->saveLayer(slr);
20 canvas->drawColor(0x40FFFFFF);