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(bug6495, 256, 256, false, 0) {
draw(SkCanvas * canvas)5 void draw(SkCanvas* canvas) {
6 SkPaint p;
7 p.setColor(SK_ColorRED);
8 p.setAntiAlias(true);
9 p.setStyle(SkPaint::kStroke_Style);
10 p.setStrokeWidth(10);
11
12 SkRect r = SkRect::MakeXYWH(20, 20, 100, 100);
13
14 canvas->rotate(90);
15 canvas->scale(1.0, -1.0);
16 canvas->drawOval(r, p);
17
18 p.setColor(SK_ColorGREEN);
19
20 canvas->save();
21 canvas->scale(1.0, 0.4999);
22 canvas->drawOval(r, p);
23 canvas->restore();
24
25 canvas->save();
26 canvas->scale(1.0, 0.5000);
27 canvas->drawOval(r, p);
28 canvas->restore();
29
30 canvas->save();
31 canvas->scale(1.0, 0.5001);
32 canvas->drawOval(r, p);
33 canvas->restore();
34 }
35 } // END FIDDLE
36