cfe1264d74
The "pointy vertex" test was only considering the distance from the next (outgoing) edge to the previous point. It must also consider the distance from the previous (incoming) edge to the next point. If either are less than a quarter pixel, the vertex is considered pointy and should be removed. (884166) Also (887103), when an interior region was completely removed due to boundary simplification, it would leave a degenerate edge consisting of the same vertex. So avoid introducing a join edge when prev == next. Bug: 884166, 887103 Change-Id: I7f1d5b98e418d8f2a1c11643259d3cd74d08f286 Reviewed-on: https://skia-review.googlesource.com/157220 Commit-Queue: Stephen White <senorblanco@chromium.org> Reviewed-by: Robert Phillips <robertphillips@google.com>
29 lines
663 B
C++
29 lines
663 B
C++
/*
|
|
* Copyright 2018 Google Inc.
|
|
*
|
|
* Use of this source code is governed by a BSD-style license that can be
|
|
* found in the LICENSE file.
|
|
*/
|
|
|
|
#include "gm.h"
|
|
#include "SkCanvas.h"
|
|
#include "SkPath.h"
|
|
|
|
DEF_SIMPLE_GM(crbug_884166, canvas, 300, 300) {
|
|
SkPaint paint;
|
|
|
|
paint.setAntiAlias(true);
|
|
paint.setStyle(SkPaint::kFill_Style);
|
|
|
|
SkPath path;
|
|
path.moveTo(153.25, 280.75);
|
|
path.lineTo(161.75, 281.75);
|
|
path.lineTo(164.25, 282.00);
|
|
path.lineTo( 0.00, 276.00);
|
|
path.lineTo(161.50, 0.00);
|
|
path.lineTo(286.25, 231.25);
|
|
path.lineTo(163.75, 282.00);
|
|
path.lineTo(150.00, 280.00);
|
|
canvas->drawPath(path, paint);
|
|
}
|