libui: use HIDLized gralloc-mapper

Test: builds and boots
Change-Id: If42bea782e6dda5cab31c270085d934879fcdb54
diff --git a/include/ui/GrallocMapper.h b/include/ui/GrallocMapper.h
index 509cb6e..f533dfb 100644
--- a/include/ui/GrallocMapper.h
+++ b/include/ui/GrallocMapper.h
@@ -32,98 +32,35 @@
 using hardware::graphics::common::V1_0::PixelFormat;
 using hardware::graphics::mapper::V2_0::FlexLayout;
 using hardware::graphics::mapper::V2_0::BackingStore;
-using hardware::graphics::mapper::V2_0::Device;
 using hardware::graphics::mapper::V2_0::IMapper;
 
 // Mapper is a wrapper to IMapper, a client-side graphics buffer mapper.
 class Mapper {
 public:
     Mapper();
-    ~Mapper();
 
     // this will be removed and Mapper will be always valid
     bool valid() const { return (mMapper != nullptr); }
 
-    Error retain(buffer_handle_t handle) const
-    {
-        return mMapper->retain(mDevice, handle);
-    }
-
+    Error retain(buffer_handle_t handle) const;
     void release(buffer_handle_t handle) const;
 
-    Error getDimensions(buffer_handle_t handle,
-            uint32_t* outWidth, uint32_t* outHeight) const
-    {
-        return mMapper->getDimensions(mDevice, handle, outWidth, outHeight);
-    }
-
-    Error getFormat(buffer_handle_t handle,
-            PixelFormat* outFormat) const
-    {
-        return mMapper->getFormat(mDevice, handle, outFormat);
-    }
-
-    Error getLayerCount(buffer_handle_t handle, uint32_t* outLayerCount) const
-    {
-        return mMapper->getLayerCount(mDevice, handle, outLayerCount);
-    }
-
-    Error getProducerUsageMask(buffer_handle_t handle,
-            uint64_t* outUsageMask) const
-    {
-        return mMapper->getProducerUsageMask(mDevice, handle, outUsageMask);
-    }
-
-    Error getConsumerUsageMask(buffer_handle_t handle,
-            uint64_t* outUsageMask) const
-    {
-        return mMapper->getConsumerUsageMask(mDevice, handle, outUsageMask);
-    }
-
-    Error getBackingStore(buffer_handle_t handle,
-            BackingStore* outStore) const
-    {
-        return mMapper->getBackingStore(mDevice, handle, outStore);
-    }
-
-    Error getStride(buffer_handle_t handle, uint32_t* outStride) const
-    {
-        return mMapper->getStride(mDevice, handle, outStride);
-    }
-
-    Error getNumFlexPlanes(buffer_handle_t handle,
-            uint32_t* outNumPlanes) const
-    {
-        return mMapper->getNumFlexPlanes(mDevice, handle, outNumPlanes);
-    }
+    Error getStride(buffer_handle_t handle, uint32_t* outStride) const;
 
     Error lock(buffer_handle_t handle,
             uint64_t producerUsageMask,
             uint64_t consumerUsageMask,
-            const Device::Rect& accessRegion,
-            int acquireFence, void** outData) const
-    {
-        return mMapper->lock(mDevice, handle,
-                producerUsageMask, consumerUsageMask,
-                &accessRegion, acquireFence, outData);
-    }
-
+            const IMapper::Rect& accessRegion,
+            int acquireFence, void** outData) const;
     Error lock(buffer_handle_t handle,
             uint64_t producerUsageMask,
             uint64_t consumerUsageMask,
-            const Device::Rect& accessRegion,
-            int acquireFence, FlexLayout* outFlexLayout) const
-    {
-        return mMapper->lockFlex(mDevice, handle,
-                producerUsageMask, consumerUsageMask,
-                &accessRegion, acquireFence, outFlexLayout);
-    }
-
+            const IMapper::Rect& accessRegion,
+            int acquireFence, FlexLayout* outLayout) const;
     int unlock(buffer_handle_t handle) const;
 
 private:
-    const IMapper* mMapper;
-    Device* mDevice;
+    sp<IMapper> mMapper;
 };
 
 } // namespace Gralloc2