Add test for importing AHardwareBuffers in and out of Vulkan.

The general test creates an AHardwareBuffer. Imports into a backend to file with data.
And then imports it into another backend to read the HWB and draws it to a surface.
We then readback the pixels to make sure they match what we started with.

This version of the test tests all combinations of srcBackends (CPU, EGL, Vulkan) with the
dst backends (EGL, Vulkan).

Also cherry-picks in changes:
Add ctor to GrVkAlloc (
Add testing only helper to flush and sync gpu (

Bug: skia:
Change-Id: I732f371af7f48f5a590fd161021a69cbc6f2583c
Reviewed-by: Jim Van Verth <>
21 files changed