diff options
author | 2018-05-23 12:12:21 -0400 | |
---|---|---|
committer | 2018-05-23 16:54:32 +0000 | |
commit | ee43091c1b8ebf2f62918688494b0eb82ceedb38 (patch) | |
tree | fea93d4f7d455abea54ebd182fcbbe69e3ca3d19 /tests | |
parent | d7e22273e1e522eab57976e08b339b1532a8fd01 (diff) |
fix 0.499999f rounding case for triangles
Bug: skia:7994
Change-Id: I83bb309a2c8fb0bddaf78ba32c0a07537e483900
Reviewed-on: https://skia-review.googlesource.com/129648
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/PathTest.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/PathTest.cpp b/tests/PathTest.cpp index 9d8c18f997..45ebd45e31 100644 --- a/tests/PathTest.cpp +++ b/tests/PathTest.cpp @@ -5051,3 +5051,18 @@ DEF_TEST(Path_isRect, reporter) { compare.set(&points53[1], 4); REPORTER_ASSERT(reporter, rect == compare); } + +#include "SkVertices.h" +DEF_TEST(triangle_onehalf, reporter) { + auto surface(SkSurface::MakeRasterN32Premul(100, 100)); + + const SkPoint pts[] = { + { 0.499069244f, 9.63295173f }, + { 0.499402374f, 7.88207579f }, + { 10.2363272f, 0.49999997f } + }; + const SkColor colors[] = { SK_ColorBLACK, SK_ColorBLACK, SK_ColorBLACK }; + + auto v = SkVertices::MakeCopy(SkVertices::kTriangles_VertexMode, 3, pts, nullptr, colors); + surface->getCanvas()->drawVertices(v, SkBlendMode::kSrcOver, SkPaint()); +} |