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(Canvas_clipRect_2, 280, 192, false, 0) {
draw(SkCanvas * canvas)5 void draw(SkCanvas* canvas) {
6 SkPaint paint;
7 for (SkClipOp op: { SkClipOp::kIntersect, SkClipOp::kDifference } ) {
8 canvas->save();
9 canvas->clipRect(SkRect::MakeWH(90, 120), op, false);
10 canvas->drawCircle(100, 100, 60, paint);
11 canvas->restore();
12 canvas->translate(80, 0);
13 }
14 }
15 } // END FIDDLE
16