Hal Canary | 385468f | 2017-02-13 11:03:23 -0500 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2017 Google Inc. |
| 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license that can be |
| 5 | * found in the LICENSE file. |
| 6 | */ |
| 7 | |
Mike Klein | c0bd9f9 | 2019-04-23 12:05:21 -0500 | [diff] [blame] | 8 | #include "gm/gm.h" |
Ben Wagner | 7fde8e1 | 2019-05-01 17:28:53 -0400 | [diff] [blame] | 9 | #include "include/core/SkCanvas.h" |
| 10 | #include "include/core/SkPaint.h" |
| 11 | #include "include/core/SkPath.h" |
| 12 | #include "include/core/SkString.h" |
Mike Klein | c0bd9f9 | 2019-04-23 12:05:21 -0500 | [diff] [blame] | 13 | #include "include/utils/SkParsePath.h" |
Hal Canary | 385468f | 2017-02-13 11:03:23 -0500 | [diff] [blame] | 14 | |
Chris Dalton | 50e24d7 | 2019-02-07 16:20:09 -0700 | [diff] [blame] | 15 | DEF_SIMPLE_GM_CAN_FAIL(crbug_691386, canvas, errorMsg, 256, 256) { |
Hal Canary | 385468f | 2017-02-13 11:03:23 -0500 | [diff] [blame] | 16 | SkPath path; |
| 17 | if (!SkParsePath::FromSVGString("M -1 0 A 1 1 0 0 0 1 0 Z", &path)) { |
Chris Dalton | 50e24d7 | 2019-02-07 16:20:09 -0700 | [diff] [blame] | 18 | *errorMsg = "Failed to parse path."; |
| 19 | return skiagm::DrawResult::kFail; |
Hal Canary | 385468f | 2017-02-13 11:03:23 -0500 | [diff] [blame] | 20 | } |
| 21 | SkPaint p; |
| 22 | p.setStyle(SkPaint::kStroke_Style); |
| 23 | p.setStrokeWidth(0.025f); |
| 24 | canvas->scale(96.0f, 96.0f); |
| 25 | canvas->translate(1.25f, 1.25f); |
| 26 | canvas->drawPath(path, p); |
Chris Dalton | 50e24d7 | 2019-02-07 16:20:09 -0700 | [diff] [blame] | 27 | return skiagm::DrawResult::kOk; |
Hal Canary | 385468f | 2017-02-13 11:03:23 -0500 | [diff] [blame] | 28 | } |