skia2/gm/crbug_691386.cpp
Chris Dalton d7a5a1d27e Add a central skiagm::GM::DrawFailureMessage for error messages
Bug: skia:8731
Change-Id: If73216bd427a1ce773fa41044a45c1bbd7ea08e9
Reviewed-on: https://skia-review.googlesource.com/c/189124
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2019-02-04 17:49:42 +00:00

24 lines
609 B
C++

/*
* Copyright 2017 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include "gm.h"
#include "SkParsePath.h"
DEF_SIMPLE_GM(crbug_691386, canvas, 256, 256) {
SkPath path;
if (!SkParsePath::FromSVGString("M -1 0 A 1 1 0 0 0 1 0 Z", &path)) {
skiagm::GM::DrawFailureMessage(canvas, "Failed to parse path.");
return;
}
SkPaint p;
p.setStyle(SkPaint::kStroke_Style);
p.setStrokeWidth(0.025f);
canvas->scale(96.0f, 96.0f);
canvas->translate(1.25f, 1.25f);
canvas->drawPath(path, p);
}