From 58627cb8eb559670b86f06225eb87e6c1c5e8504 Mon Sep 17 00:00:00 2001 From: Cary Clark Date: Tue, 10 Apr 2018 09:16:41 -0400 Subject: one more path is rect bug Add a check to see that the close path generated line is horizontal or vertical when determining that path is a rect. Also change several tests to defer their initialization to reduce debugging interference. R=brianosman@google.com,robertphillips@google.com Bug: 824145,skia:7792 Change-Id: I4a081ee4ffd3558b499a7a1aede2d6232059715e Reviewed-on: https://skia-review.googlesource.com/120081 Reviewed-by: Brian Osman Commit-Queue: Cary Clark --- gm/shapes.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'gm') diff --git a/gm/shapes.cpp b/gm/shapes.cpp index c746a493df..0b01390796 100644 --- a/gm/shapes.cpp +++ b/gm/shapes.cpp @@ -19,6 +19,15 @@ namespace skiagm { class ShapesGM : public GM { protected: ShapesGM(const char* name, bool antialias) : fName(name), fAntialias(antialias) { + if (!antialias) { + fName.append("_bw"); + } + } + + SkString onShortName() override final { return fName; } + SkISize onISize() override { return SkISize::Make(500, 500); } + + void onOnceBeforeDraw() override { fShapes.push_back().setOval(SkRect::MakeXYWH(-5, 25, 200, 100)); fRotations.push_back(21); @@ -50,15 +59,6 @@ protected: fShapes.push_back().setRectRadii(SkRect::MakeXYWH(180, -30, 80, 60), radii2); fRotations.push_back(295); - if (!antialias) { - fName.append("_bw"); - } - } - - SkString onShortName() override final { return fName; } - SkISize onISize() override { return SkISize::Make(500, 500); } - - void onOnceBeforeDraw() override { fPaint.setAntiAlias(fAntialias); } -- cgit v1.2.3