Fix d3d backend texture uploads when used formats need swizzling.
This does a few things. First when we are trying to upload a color via
our updateBackendTexture API we use GrClearImage to fill out a cpu buffer
with that data. But we need to know how to swizzle this cpu data so that
it falls into the correct channels when we copy it to the GPU texture.
This requires adding a couple more color types to handle some of the odd
4444 cases which are swizzled differently and what seems every backend.
We then can get the correct swizzle for the GrClearImage call.
This change also fixes the DXGI_FORMAT_B4G4R4A4_UNORM read and write swizzles.
In follow on change I will update other APIs which use GrClearImage to make
sure they are using the correct GrColorType to represent their internal
formats memory layout.
Reviewed-by: Jim Van Verth <firstname.lastname@example.org>
Reviewed-by: Brian Salomon <email@example.com>
Commit-Queue: Greg Daniel <firstname.lastname@example.org>
6 files changed