Fix quickReject's handling of AA ramp geometry
By having quickReject round out the window-space geometry bounds, we
prevent the AA perimeter (which falls outside the local bounds passed
in) from drawing outside the clip.
Change-Id: I8ee36be9039a9c47906815ee2f0dbaa5eb910b82
diff --git a/libs/hwui/Rect.h b/libs/hwui/Rect.h
index 7531769..7605307 100644
--- a/libs/hwui/Rect.h
+++ b/libs/hwui/Rect.h
@@ -170,6 +170,20 @@
bottom += delta;
}
+ /**
+ * Similar to snapToPixelBoundaries, but used for AA geometry with a ramp perimeter.
+ *
+ * We inset the data by a fudge factor of slightly over 1/16 (similar to when drawing non-AA
+ * lines) before rounding out so that insignificant amounts of ramp geometry (esp. from rounding
+ * errors) are ignored.
+ */
+ void snapOutToPixelBoundaries() {
+ left = floorf(left + 0.065f);
+ top = floorf(top + 0.065f);
+ right = ceilf(right - 0.065f);
+ bottom = ceilf(bottom - 0.065f);
+ }
+
void snapToPixelBoundaries() {
left = floorf(left + 0.5f);
top = floorf(top + 0.5f);