[graphite] Move rescale code to separate utility function.

This avoids unnecessary creation of a Device to handle this operation,
and is a step towards sharing this code with Ganesh if so desired.

Bug: b/290198076
Change-Id: I037e9a468bc0d6ef9d28565dc63cff40895b941f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/729804
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
5 files changed