skia/skia/e4012ccf0df0440055dbfedac25cdd4a9dccf37d [graphite] Consolidate upload code around UploadSource
The two UploadInstance factories were nearly identical, accounting
for some assumptions around subrects vs. full rects and adding an
identity TextureFormatXferFn that can run over compressed data.
This makes UploadInstance created from an UploadSource, and makes
UploadSource the arbiter of whether or not a transfer is valid
(no more passing around duplicate parameters).
UploadSource is also now the sole handler of the upload-on-host
code path, and it no longer magically happens when appending to
any UploadList. There are distinct times when upload-on-host makes
sense and others where we really do want the task to be in the graph
and the Recording.
This also patches up a race condition that could have happened in
Graphite-Vulkan by requiring that the TextureProxy be uniquely
held and shareability of the resource won't have it aliased to
other proxies. Technically this was low risk anyways since we
require that the image layout of the texture be unknown, which
really only happens if we haven't used the texture yet for anything.
Bug: b/333909822
Change-Id: I4a32c7034775ad96fd43cc4dc2839e0a59c03bab
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/1221678
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Nicolette Prevost <nicolettep@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
16 files changed