skia/skia/c1ebe9f9e5afe77dd89e949b6b44a76bbe9b5983 [graphite] Test format transfers with unknown-alpha swizzle handling
This CL updates the unit tests to apply the same rgb1 swizzle to the
texture's read swizzle that is done when wrapping textures that are to
be interpreted as an unknown alpha type. This exposes the
TextureFormatXferFn to some more swizzle combinations so its gray and
alpha handling had to be updated.
It updates the CPU colortype/alphatype handling to match the
combinations that can appear when dealing with a valid SkBitmap. It was
getting tricky from a testing POV to have the CPU data also behave as if
"unknown alpha" was forced to opaque when nothing in the raster backend
actually does that.
This CL also updates the compare_pixels() function to be able to ignore
the alpha channel. Ignoring alpha occurs for CPU->GPU transfers when the
final read swizzle has A=1, since the actual transferred values don't
matter.
This also updates the value generation of input pixel data to be inject
"padding"/junk bits into a masked out alpha channel. This doesn't come
up currently, but as more optimizations are landed to detect more
identity conversions, this will be important. It makes it easier to
verify that the actual transfer either overrides them or carries them
forwards unmodified because it can assume the read swizzle handles it.
Bug: 509890794
Change-Id: If1dcca63790b6b589aeafff3a0ae26acaca165a0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/1342676
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Thomas Smith <thomsmit@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2 files changed