blob: 247802815449e16980071c2d3b4cfd40bf6dad75 [file] [log] [blame]
Brian Salomon3ac1f952018-09-07 13:47:49 -04001/*
2 * Copyright 2018 Google Inc.
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"
11#include "include/core/SkPath.h"
Brian Salomon3ac1f952018-09-07 13:47:49 -040012
13DEF_SIMPLE_GM(crbug_847759, canvas, 500, 500) {
14 // This path exposed an issue in GrAAHairlinePathRenderer. When converting from cubics to quads
15 // we produced quads where the previously vertical tangents at the left and right tips of the
16 // squashed oval-like path became slightly non-vertical. This caused a missed pixel of AA just
17 // outside each tip.
18 SkPath path;
19 path.moveTo(97,374.5f);
20 path.cubicTo(97,359.8644528f,155.8745488f,348,228.5f,348);
21 path.cubicTo(301.1254512f,348,360,359.8644528f,360,374.5f);
22 path.cubicTo(360,389.1355472f,301.1254512f,401,228.5f,401);
23 path.cubicTo(155.8745488f,401,97,389.1355472f,97,374.5f);
24 path.close();
25 SkPaint paint;
26 paint.setAntiAlias(true);
27 paint.setStrokeWidth(0);
28 paint.setStrokeMiter(1.5);
29 paint.setStyle(SkPaint::kStroke_Style);
30 canvas->translate(-80, -330);
31 canvas->drawPath(path, paint);
32}