AHardwareBuffer-based GpuMemoryBuffer implementation

AHardwareBuffer support is included on Android O and up. The NDK
functions are included as of platform level 26, but Chromium currently
doesn't use this as the target level, so we have to use dynamic
loading to get the symbols at runtime.

This is encapsulated in gfx::AndroidHardwareBufferCompat which makes
it a bit easier to work with them across Android versions.

The implementation adds a new ANDROID_HARDWARE_BUFFER subtype to the
SharedMemoryHandle Android implementation in addition to the pre-existing
ashmem support, including IPC transport via a SocketPair. It uses one end
to write the native object using a NDK call, and the other end is a file
descriptor sendable via usual IPC methods from which the receiver can fetch
the object.

BUG=761432

Cq-Include-Trybots: master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel
Change-Id: I9edfa733ffccea21dd58a3940aa96cb6955c8f09
Reviewed-on: https://chromium-review.googlesource.com/680100
Commit-Queue: Klaus Weidner <klausw@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
Reviewed-by: Ken Rockot <rockot@chromium.org>
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Reviewed-by: David Reveman <reveman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#513710}

CrOS-Libchrome-Original-Commit: 3824a888dd6ed3014445573d0944508f10318b9a
8 files changed
tree: 5e4b4ae2e9c20e7dbbc3e1ea07d84d9881f48761
  1. base/
  2. build/
  3. components/
  4. dbus/
  5. device/
  6. ipc/
  7. mojo/
  8. testing/
  9. third_party/
  10. ui/