2 * Copyright 2014 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 class DRRectGM : public skiagm::GM {
19 SkString onShortName() SK_OVERRIDE {
20 return SkString("drrect");
23 SkISize onISize() SK_OVERRIDE {
24 return SkISize::Make(640, 480);
27 void onDraw(SkCanvas* canvas) SK_OVERRIDE {
29 paint.setAntiAlias(true);
32 // like squares/circles, to exercise fast-cases in GPU
33 SkRect r = { 0, 0, 100, 100 };
35 { 0, 0 }, { 30, 1 }, { 10, 40 }, { 40, 40 }
38 const SkScalar dx = r.width() + 16;
39 const SkScalar dy = r.height() + 16;
43 outers[2].setRectXY(r, 20, 20);
44 outers[3].setRectRadii(r, radii);
52 inners[3].setRectXY(r, 20, 20);
53 inners[4].setRectRadii(r, radii);
55 canvas->translate(16, 16);
56 for (size_t j = 0; j < SK_ARRAY_COUNT(inners); ++j) {
57 for (size_t i = 0; i < SK_ARRAY_COUNT(outers); ++i) {
59 canvas->translate(dx * j, dy * i);
60 canvas->drawDRRect(outers[i], inners[j], paint);
70 DEF_GM( return new DRRectGM; )