Check for scratch textures in GrResourceProvider.

Restores scratch pool checks that were accidentally removed here:
https://skia.googlesource.com/skia/+/a90382fcf6759d4e13c20cf542ab5440ffd4f02d

Also enables checking scratch pool for mip-mapped textures, which was not
previously done.

Consolidates level prep and write-pixels code.

Bug: chromium:1005237
Change-Id: I6f23ce15299290ca5b666f910dc5fc85541ec316
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/243038
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
3 files changed