aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authorGravatar Brian Salomon <bsalomon@google.com>2018-05-01 09:13:16 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-05-01 19:58:45 +0000
commit3fc6a185ca5de3fc25ec50726944afc525856863 (patch)
tree0f83ad41f0841a1e62b295470d864885628dbf47 /tests
parent91368c9b9b0c3071babb3352646f9795e0b828fd (diff)
Fix index overflow check for rewriting fans as triangles.
Not only could the old test cause int overflow, it was just wrong. Bug: skia:8085 Change-Id: Id6b81f4aa1b115f0dbfd2266aee8fab5d5d30aee Reviewed-on: https://skia-review.googlesource.com/124779 Reviewed-by: Chris Dalton <csmartdalton@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/VerticesTest.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/VerticesTest.cpp b/tests/VerticesTest.cpp
index 5bcb11f1d3..59d06472ac 100644
--- a/tests/VerticesTest.cpp
+++ b/tests/VerticesTest.cpp
@@ -91,13 +91,13 @@ DEF_TEST(Vertices, reporter) {
{
// This has the maximum number of vertices to be rewritten as indexed triangles without
// overflowing a 16bit index.
- SkVertices::Builder builder(SkVertices::kTriangleFan_VertexMode, 21847, 0,
+ SkVertices::Builder builder(SkVertices::kTriangleFan_VertexMode, SK_MaxU16 + 1, 0,
SkVertices::kHasColors_BuilderFlag);
REPORTER_ASSERT(reporter, builder.isValid());
}
{
// This has too many to be rewritten.
- SkVertices::Builder builder(SkVertices::kTriangleFan_VertexMode, 21848, 0,
+ SkVertices::Builder builder(SkVertices::kTriangleFan_VertexMode, SK_MaxU16 + 2, 0,
SkVertices::kHasColors_BuilderFlag);
REPORTER_ASSERT(reporter, !builder.isValid());
}