Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(78)

Unified Diff: tests/GpuDrawPathTest.cpp

Issue 1454223002: Unit test for conic weight GrPath key collision (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: moar rebase Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/GpuDrawPathTest.cpp
diff --git a/tests/GpuDrawPathTest.cpp b/tests/GpuDrawPathTest.cpp
index 3702a7cc3b03ee45e2c4673efa7b73b43155a2bc..ea3b3a7aed0f447bb00b701ac25776c840a95630 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698