If you want to convert a color SkImage with a grayscale / Alpha8 image into a single, new, SkImage where the alpha bits of the new image are specified by the pixels in the grayscale image, then something like this could work:
- Create a CPU surface and give it the same dimensions as the color image supplied.
- Get the SkCanvas from that surface.
- Initialize / fill it with SK_COLOR_TRANSPARENT (or whatever it is called)
- set the current matrix to identity (it probably starts out that way anyway)
- drawImage(the_color_image)
- drawImage(the_gray_image with blendmode SrcIn) (this would manipulate the alpha channel in the surface)
- grab an SkImage by calling SkSurface::makeImageSnapshot()
Now you will have a new image that contains a color image with an alpha channel derived by the alpha8 image. You can throw away the original color and alpha8 images and use this new image instead.
This is not nearly the fastest way to do that, but I think it would work.