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

Unified Diff: tests/AAClipTest.cpp

Issue 658753002: add tests for large cordinates bounds when building aaclip (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 2 months 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 | « include/core/SkRect.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/AAClipTest.cpp
diff --git a/tests/AAClipTest.cpp b/tests/AAClipTest.cpp
index 64e378455a751fb687757b2d75060940c59a2a08..605656514931b285db643b13847c37de699e0da2 100644
--- a/tests/AAClipTest.cpp
+++ b/tests/AAClipTest.cpp
@@ -421,6 +421,22 @@ static void test_regressions() {
}
}
+// Building aaclip meant aa-scan-convert a path into a huge clip.
+// the old algorithm sized the supersampler to the size of the clip, which overflowed
+// its internal 16bit coordinates. The fix was to intersect the clip+path_bounds before
+// sizing the supersampler.
+//
+// Before the fix, the following code would assert in debug builds.
+//
+static void test_crbug_422693(skiatest::Reporter* reporter) {
+#if 0
+ SkRasterClip rc(SkIRect::MakeLTRB(-25000, -25000, 25000, 25000));
+ SkPath path;
+ path.addCircle(50, 50, 50);
+ rc.op(path, rc.getBounds().size(), SkRegion::kIntersect_Op, true);
+#endif
+}
+
DEF_TEST(AAClip, reporter) {
test_empty(reporter);
test_path_bounds(reporter);
@@ -430,4 +446,5 @@ DEF_TEST(AAClip, reporter) {
test_regressions();
test_nearly_integral(reporter);
test_really_a_rect(reporter);
+ test_crbug_422693(reporter);
}
« no previous file with comments | « include/core/SkRect.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698