aboutsummaryrefslogtreecommitdiffhomepage
path: root/gm/thinconcavepaths.cpp
diff options
context:
space:
mode:
authorGravatar Stephen White <senorblanco@chromium.org>2017-01-12 17:15:50 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-01-13 18:49:11 +0000
commit930f69eef346b0ad4164752a074f3a45c6f46770 (patch)
tree966ba9d99fedfe369dc3b664ae8e2ea1af47bcb0 /gm/thinconcavepaths.cpp
parentcf5d6caff7a58f1c7ecc36d9a91ccdada5fc7b78 (diff)
Switch a bunch of tests to use DEF_SIMPLE_GM.
Should be no user- or test-visible changes. BUG=skia: Change-Id: I6499dc978a41fee344b847c118f84227271561c5 Reviewed-on: https://skia-review.googlesource.com/6906 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Stephan White <senorblanco@chromium.org>
Diffstat (limited to 'gm/thinconcavepaths.cpp')
-rw-r--r--gm/thinconcavepaths.cpp42
1 files changed, 10 insertions, 32 deletions
diff --git a/gm/thinconcavepaths.cpp b/gm/thinconcavepaths.cpp
index 6c81d7c272..0f4dd507bf 100644
--- a/gm/thinconcavepaths.cpp
+++ b/gm/thinconcavepaths.cpp
@@ -9,9 +9,6 @@
#include "SkCanvas.h"
#include "SkPath.h"
-#define WIDTH 400
-#define HEIGHT 400
-
namespace {
// Test thin stroked rect (stroked "by hand", not by stroking).
void draw_thin_stroked_rect(SkCanvas* canvas, const SkPaint& paint, SkScalar width) {
@@ -29,35 +26,16 @@ void draw_thin_stroked_rect(SkCanvas* canvas, const SkPaint& paint, SkScalar wid
};
-class ThinConcavePathsGM : public skiagm::GM {
-public:
- ThinConcavePathsGM() {}
-
-protected:
- SkString onShortName() override {
- return SkString("thinconcavepaths");
- }
-
- SkISize onISize() override {
- return SkISize::Make(WIDTH, HEIGHT);
- }
-
- void onDraw(SkCanvas* canvas) override {
- SkPaint paint;
+DEF_SIMPLE_GM(thinconcavepaths, canvas, 400, 400) {
+ SkPaint paint;
- paint.setAntiAlias(true);
- paint.setStyle(SkPaint::kFill_Style);
+ paint.setAntiAlias(true);
+ paint.setStyle(SkPaint::kFill_Style);
- canvas->save();
- for (SkScalar width = 1.0; width < 2.05; width += 0.25) {
- draw_thin_stroked_rect(canvas, paint, width);
- canvas->translate(0, 25);
- }
- canvas->restore();
+ canvas->save();
+ for (SkScalar width = 1.0; width < 2.05; width += 0.25) {
+ draw_thin_stroked_rect(canvas, paint, width);
+ canvas->translate(0, 25);
}
-
-private:
- typedef skiagm::GM INHERITED;
-};
-
-DEF_GM( return new ThinConcavePathsGM; )
+ canvas->restore();
+}