Currently, the coverage of quad primitives if defined by the intersection of the local rect and local clip rect.
The coordinate space of the pattern is affected by the bounds of the local rect, sometimes partially overriden by a stretch size parameter.
Edges that are not anti-aliased are snapped to the pixel grid to simplify a bunch of things in indirect rendering strategies. To make this work without introducing cracks we have to round both the local rect and the local clip rect which slightly offsets and stretches the pattern.
To avoid affecting the pattern coordinate space, this patch changes the representation.
We now have a single coverage rect which represents the intersection of the local rect and local clip rect. This rect can be modified without changing the pattern position and size.
In addition, a pattern rect controls the position and size of the pattern. Snapping this rect would change the look of the pattern so it's probably never a good idea to do so.
With this representatoin, the stretch size parameter is entirely redundant so it could be removed in the future.
It also lets us naturaly express offsets in repeated pattern (currently we have a hacky way of tweaking the local rect and local clip rect to achieve that).
This patch only does this at quad prepare/shader level but I plan to move this representation all the way to the display list.
Differential Revision: https://phabricator.services.mozilla.com/D308509