libui: Convert Allocator and Mapper to gralloc1

Converts GraphicBufferAllocator and GraphicBufferMapper to speak
gralloc 1.0 (via the C++ shim and optionally the 1On0 adapter) instead
of gralloc 0.x.

Bug: 28401203
Change-Id: Ie1649f0ee72801579be2c2d3c47177b52962a825
diff --git a/include/ui/GraphicBufferMapper.h b/include/ui/GraphicBufferMapper.h
index 6099548..a25809c 100644
--- a/include/ui/GraphicBufferMapper.h
+++ b/include/ui/GraphicBufferMapper.h
@@ -20,13 +20,10 @@
 #include <stdint.h>
 #include <sys/types.h>
 
+#include <ui/Gralloc1.h>
+
 #include <utils/Singleton.h>
 
-#include <hardware/gralloc.h>
-
-
-struct gralloc_module_t;
-
 namespace android {
 
 // ---------------------------------------------------------------------------
@@ -39,6 +36,7 @@
     static inline GraphicBufferMapper& get() { return getInstance(); }
 
     status_t registerBuffer(buffer_handle_t handle);
+    status_t registerBuffer(const GraphicBuffer* buffer);
 
     status_t unregisterBuffer(buffer_handle_t handle);
 
@@ -59,13 +57,13 @@
 
     status_t unlockAsync(buffer_handle_t handle, int *fenceFd);
 
-    // dumps information about the mapping of this handle
-    void dump(buffer_handle_t handle);
-
 private:
     friend class Singleton<GraphicBufferMapper>;
+
     GraphicBufferMapper();
-    gralloc_module_t const *mAllocMod;
+
+    std::unique_ptr<Gralloc1::Loader> mLoader;
+    std::unique_ptr<Gralloc1::Device> mDevice;
 };
 
 // ---------------------------------------------------------------------------