2 * Copyright 2020 Google LLC
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
9 #include "include/core/SkCanvas.h"
10 #include "include/core/SkPaint.h"
11 #include "include/core/SkRRect.h"
13 DEF_SIMPLE_GM_BG(crbug_1139750, canvas, 50, 50, SK_ColorWHITE) {
14 // Draw a round-rect with a (slightly) non-square scale. This forces the GPU backend to use
15 // the elliptical round-rect op. We set the stroke width to exactly double the radii, which
16 // makes the inner radii exactly zero. The shader uses the inverse inner radii to compute the
17 // coverage ramp, so this would end up producing infinity, and the geometry would disappear.
20 p.setStyle(SkPaint::kStroke_Style);
23 SkRect r = SkRect::MakeXYWH(1, 1, 19, 19);
24 SkRRect rr = SkRRect::MakeRectXY(r, 1, 1);
26 canvas->translate(10, 10);
27 canvas->scale(1.47619f, 1.52381f);
28 canvas->drawRRect(rr, p);