skia2/gm/crbug_1113794.cpp
Mike Reed 2ac6ce8e6e Simplify common case for recttorect
Change-Id: I70e295a677b8cac3d578e3cd57472c833af03877
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/354336
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
2021-01-15 18:37:46 +00:00

31 lines
869 B
C++

/*
* Copyright 2020 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include "gm/gm.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkPaint.h"
#include "include/core/SkPath.h"
#include "include/effects/SkDashPathEffect.h"
DEF_SIMPLE_GM(crbug_1113794, canvas, 600, 200) {
SkPath path = SkPath::Line({50.f, 80.f}, {50.f, 20.f});
SkPaint paint;
paint.setColor(SK_ColorBLACK);
paint.setAntiAlias(true);
paint.setStrokeWidth(0.25f);
paint.setStyle(SkPaint::kStroke_Style);
static constexpr SkScalar kDash[2] = {10.f, 10.f};
paint.setPathEffect(SkDashPathEffect::Make(kDash, 2, 0.f));
SkMatrix viewBox = SkMatrix::RectToRect(SkRect::MakeWH(100, 100), SkRect::MakeWH(600, 200));
canvas->concat(viewBox);
canvas->drawPath(path, paint);
}