Reland "Don't reuse scratch textures when texsub image banned for FBO textures"

This is a reland of 2a88456c153f4a25da94c324adfe488629b357bc

Original change's description:
> Don't reuse scratch textures when texsub image banned for FBO textures
>
> If writePixels uses a scratch surface it will likely bind it to a FBO.
> If this workaround is in play that texture then becomes "poisoned" as
> a temp surface for a future writePixels(). However, our caching
> mechanism will still find it and we'll incur an extra recursion in
> writePixels to allocate a new texture that has never been bound to a
> FBO. This pattern can repeat itself with increasing recursion depth
> until the cache budget has been reached and we start purging the
> "poisoned" textures.
>
> Disallowing reuse of scratch textures avoids this issue.
>
> Bug: skia:11204
> Change-Id: I8002a673900a9a34e889c92e816781d4b7f84688
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/388696
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>

Bug: skia:11204
Change-Id: I0585497e0d0d09dd68cbef050a0bbb8f9a85c16d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/390058
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
1 file changed