[canvaskit] Add test for MakeImageSnapshot using WebGL surface

This test shows how to turn a SkPicture into a portable
SkImage, even if that SkPicture has an SkImage that is
backed by a LazyImageFromTextureSource.

Without the extra readPixels call, the result of
makeImageSnapshot() will have SkImages backed by textures
belonging to the temporary WebGLCanvasSurface and
not be portable.

Change-Id: I0c597e6a6b30622780e01ab3fc809324c0a5340d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/566557
Reviewed-by: Greg Daniel <egdaniel@google.com>
2 files changed