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 // HASH=8c4499e322f10153dcd9b0b9806233b9
5 REG_FIDDLE(Canvas_clear, 256, 256, false, 0) {
draw(SkCanvas * canvas)6 void draw(SkCanvas* canvas) {
7 canvas->save();
8 canvas->clipRect(SkRect::MakeWH(256, 128));
9 canvas->clear(SkColorSetARGB(0x80, 0xFF, 0x00, 0x00));
10 canvas->restore();
11 canvas->save();
12 canvas->clipRect(SkRect::MakeWH(150, 192));
13 canvas->clear(SkColorSetARGB(0x80, 0x00, 0xFF, 0x00));
14 canvas->restore();
15 canvas->clipRect(SkRect::MakeWH(75, 256));
16 canvas->clear(SkColorSetARGB(0x80, 0x00, 0x00, 0xFF));
17 }
18 } // END FIDDLE
19