[graphite] Expose Dawn async buffer mapping through Buffer class

Previously this was a hidden detail of DawnBuffer. onMap would trigger
an async mapping and then busy wait. Now Buffer has an async mapping
interface that the rest of Graphite uses.

For GPU->CPU xfers buffers can be attached to CommandBuffer. When  the
command buffer is submitted. These get asynchronously mapped after the
command buffer is submitted and the wrapping GpuWorkSubmission doesn't
consider the work finished until maps are done. Context uses this in
read pixels methods.

kXferCpuToGpu buffers are already pre-mapped on creation prior to this
change. After this change they are remapped asynchronously before being
added back to ResourceCache. Thus, all map() calls on them return
immediately as they are either pre-mapped or re-mapped before use.

In order to enable compute unit tests to examine buffers a tick
virtual is added to GraphiteTestContext to force async mappings to
eventually complete.

Bug: b/309019344
Change-Id: Id128c2ec7d8b3aff7ba0174afd1923384245c2d5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/780176
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <briansalomon@gmail.com>
34 files changed