add store(PixelFormat,...)

Add store(PixelFormat,...) to mirror earlier load/gather.
Use store() in SkVMBlitter to let us to write to any format
supported by SkColorType_to_PixelFormat().

This means we can read and write all the same formats now.  There's a
note on the SkColorType enum about some SkColorTypes being read-only,
but I've taken that to be descriptive and not proscriptive.

It's worth paying attention to grayscale.  Gray PixelFormats hold the
same bit size and shift for each of r,g,b so load/gather just naturally
unpack the same value into each channel.  When we want to store gray we
need to dot r,g,b together, here back into the red channel to
accommodate future gray-alpha.

Change-Id: I81ad252a35e2534d2d8c6123354b1d19c7018898
Commit-Queue: Mike Klein <>
Reviewed-by: Mike Reed <>
3 files changed