[graphite] Compute largest valid UV inset rectangle for subsets.

With the current code, we will always inset by 1 for a UV subsampling
factor of 2, and 2 for a subsampling factor of 4. While this
guarantees that we won't sample outside of the subset, the resulting
rectangle can be smaller than it needs to be. In this CL we
compute the largest valid insetted rectangle in UV space, and
intersect it with the default insetted rectangle, and use the result to
compute our inset values.

Bug: b/283271538
Change-Id: If6b6371c853a4aefc58b994e0e4e65b0f2047810
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/846938
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
1 file changed