crbug_691386.cpp 816 B

12345678910111213141516171819202122232425262728
  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. #include "gm/gm.h"
  8. #include "include/core/SkCanvas.h"
  9. #include "include/core/SkPaint.h"
  10. #include "include/core/SkPath.h"
  11. #include "include/core/SkString.h"
  12. #include "include/utils/SkParsePath.h"
  13. DEF_SIMPLE_GM_CAN_FAIL(crbug_691386, canvas, errorMsg, 256, 256) {
  14. SkPath path;
  15. if (!SkParsePath::FromSVGString("M -1 0 A 1 1 0 0 0 1 0 Z", &path)) {
  16. *errorMsg = "Failed to parse path.";
  17. return skiagm::DrawResult::kFail;
  18. }
  19. SkPaint p;
  20. p.setStyle(SkPaint::kStroke_Style);
  21. p.setStrokeWidth(0.025f);
  22. canvas->scale(96.0f, 96.0f);
  23. canvas->translate(1.25f, 1.25f);
  24. canvas->drawPath(path, p);
  25. return skiagm::DrawResult::kOk;
  26. }