Some fixes for Flutter memory issues.

Now that we're using GrBuffers for uploads, we need to match the size
of the upload buffer a little better to avoid wasting memory, so this
switches to a using either a power-of-two size, or the midpoint between
two powers-of-two.

Also, the mechanism of adding the staging buffers to the current
command buffer was not being invoked when calling submit for a cross-
context texture. Switching to submitToGpu() should handle this.

Change-Id: I8e0e5ae7e4dd00b5969d5e5554e3a2bff5758e81
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/310339
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
3 files changed