skia2/gm/crbug_946965.cpp
Brian Salomon 8a97f56c06 Swap x/y radii for EllipticalRRectOp depending on matrix.
Bug: chromium:946965
Change-Id: Ia85e07d7fc76aa9e0b0a8fe0daf3ab80d517cbd9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/209167
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-04-18 19:56:00 +00:00

28 lines
781 B
C++

/*
* Copyright 2019 Google LLC
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include "SkCanvas.h"
#include "SkPaint.h"
#include "SkPath.h"
#include "SkRRect.h"
#include "gm.h"
// Exposed a bug in ellipse rendering where the radii were wrong under 90 degree rotation.
DEF_SIMPLE_GM(crbug_946965, canvas, 75, 150) {
SkPaint paint;
paint.setAntiAlias(true);
canvas->translate(25, 80);
canvas->rotate(90.f);
canvas->scale(1.5, 1);
SkRRect rrect = SkRRect::MakeRectXY(SkRect::MakeLTRB(-20, -5, 20, 5), 10, 10);
canvas->drawRRect(rrect, paint);
canvas->translate(0, -20);
paint.setStrokeWidth(3.f);
paint.setStyle(SkPaint::kStroke_Style);
canvas->drawRRect(rrect, paint);
}