2 * Copyright 2013 Google Inc.
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
13 // This GM draws a lot of arcs in a 'Z' shape. It particularly exercises
14 // the 'drawArc' code near a singularly of its processing (i.e., near the
15 // edge of one of its underlying quads).
16 class ArcOfZorroGM : public GM {
19 this->setBGColor(0xFFCCCCCC);
24 SkString onShortName() SK_OVERRIDE {
25 return SkString("arcofzorro");
28 SkISize onISize() SK_OVERRIDE {
29 return SkISize::Make(1000, 1000);
32 void onDraw(SkCanvas* canvas) SK_OVERRIDE {
35 SkRect rect = SkRect::MakeXYWH(10, 10, 200, 200);
39 p.setStyle(SkPaint::kStroke_Style);
41 int xOffset = 0, yOffset = 0;
44 for (float arc = 134.0f; arc < 136.0f; arc += 0.01f) {
45 SkColor color = rand.nextU();
50 canvas->translate(SkIntToScalar(xOffset), SkIntToScalar(yOffset));
51 canvas->drawArc(rect, 0, arc, false, p);
80 //////////////////////////////////////////////////////////////////////////////
82 DEF_GM( return SkNEW(ArcOfZorroGM); )