Bug 1642629 - Only track per-item rects in batches if a per-batch approximation isn't good enough. r=kvark
Bug 1642629 - Only track per-item rects in batches if a per-batch approximation isn't good enough. r=kvark

Tested this on a few pages and it lets us avoid allocating per-item rects for roughly a quarter to a third of the batches. For batches that end up allocating per item rects we get to allocate fewer of them. It also further reduces the amount of times we need to test all item rects against intersections.

Differential Revision: https://phabricator.services.mozilla.com/D79479

[ghsync] From https://hg.mozilla.org/mozilla-central/rev/853d601fe2e18ff4a60a10c03255a9907a2bc56b

servo/webrender,servo/webrender,servo/webrender,servo/webrender,servo/webrender,servo/webrender