Avoid integer overflow in area calculation for SkRect::Subtract

Width*height could actually overflow on relatively reasonably sized
integer rects, so this restructures the computation to use relative
area (compared to A) instead of total area. The relations are the same
but it avoids the multiply.

Bug: chromium:1244411
Change-Id: I5bfcfba80835da07b9929f532fc3b40b330a1199
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/443876
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Auto-Submit: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
1 file changed