diff options
author | fmalita <fmalita@chromium.org> | 2015-11-19 07:28:50 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-11-19 07:28:50 -0800 |
commit | 3b4444802f2aa6d4abc4407b76191c5f40675d1a (patch) | |
tree | 5d12561aa3bc9108390f6276f4a87e7b2052a4c4 /tests/GpuDrawPathTest.cpp | |
parent | c3c6194ba2b90fde57d8d0bc1d6302656f0dae27 (diff) |
Unit test for conic weight GrPath key collision
BUG=skia:4580
R=robertphillips@google.com,bsalomon@google.com
Review URL: https://codereview.chromium.org/1454223002
Diffstat (limited to 'tests/GpuDrawPathTest.cpp')
-rw-r--r-- | tests/GpuDrawPathTest.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/GpuDrawPathTest.cpp b/tests/GpuDrawPathTest.cpp index 3702a7cc3b..ea3b3a7aed 100644 --- a/tests/GpuDrawPathTest.cpp +++ b/tests/GpuDrawPathTest.cpp @@ -11,6 +11,8 @@ #include "GrContext.h" #include "GrContextFactory.h" +#include "GrPath.h" +#include "GrStrokeInfo.h" #include "SkBitmap.h" #include "SkCanvas.h" #include "SkColor.h" @@ -110,4 +112,25 @@ DEF_GPUTEST(GpuDrawPathSameRectOvals, reporter, factory) { test_drawSameRectOvals(reporter, surface->getCanvas()); } +DEF_TEST(GrPathKeys, reporter) { + // Keys should not ignore conic weights. + SkPath path1, path2; + path1.setIsVolatile(true); + path2.setIsVolatile(true); + SkPoint p0 = SkPoint::Make(100, 0); + SkPoint p1 = SkPoint::Make(100, 100); + + path1.conicTo(p0, p1, .5f); + path2.conicTo(p0, p1, .7f); + + bool isVolatile; + GrUniqueKey key1, key2; + GrStrokeInfo stroke(SkStrokeRec::kFill_InitStyle); + GrPath::ComputeKey(path1, stroke, &key1, &isVolatile); + GrPath::ComputeKey(path2, stroke, &key2, &isVolatile); + + // https://bugs.chromium.org/p/skia/issues/detail?id=4580 + // REPORTER_ASSERT(reporter, key1 != key2); +} + #endif |