blob: 00586b508a58346dac78f26276e20f070369f7d5 [file] [log] [blame]
Brian Salomon8a97f562019-04-18 14:07:27 -04001/*
2 * Copyright 2019 Google LLC
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 Kleinc0bd9f92019-04-23 12:05:21 -05008#include "gm/gm.h"
9#include "include/core/SkCanvas.h"
10#include "include/core/SkPaint.h"
Mike Kleinc0bd9f92019-04-23 12:05:21 -050011#include "include/core/SkRRect.h"
Ben Wagner7fde8e12019-05-01 17:28:53 -040012#include "include/core/SkRect.h"
Brian Salomon8a97f562019-04-18 14:07:27 -040013
14// Exposed a bug in ellipse rendering where the radii were wrong under 90 degree rotation.
15DEF_SIMPLE_GM(crbug_946965, canvas, 75, 150) {
16 SkPaint paint;
17 paint.setAntiAlias(true);
18 canvas->translate(25, 80);
19 canvas->rotate(90.f);
20 canvas->scale(1.5, 1);
21 SkRRect rrect = SkRRect::MakeRectXY(SkRect::MakeLTRB(-20, -5, 20, 5), 10, 10);
22 canvas->drawRRect(rrect, paint);
23 canvas->translate(0, -20);
24 paint.setStrokeWidth(3.f);
25 paint.setStyle(SkPaint::kStroke_Style);
26 canvas->drawRRect(rrect, paint);
27}