*/
int height() const { return fBottom - fTop; }
+ SkISize size() const { return SkISize::Make(this->width(), this->height()); }
+
/**
* Since the center of an integer rect may fall on a factional value, this
* method is defined to return (right + left) >> 1.
}
}
+// 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);
test_regressions();
test_nearly_integral(reporter);
test_really_a_rect(reporter);
+ test_crbug_422693(reporter);
}