gralloc: support codec2 via GraphicBufferAllocator/Mapper

Codec2 is moving to GraphicBufferAllocator/Mapper. This patch
cleans up GBA/M so codec2 can use it.

- Since the graphic buffer id isn't used by GBA/M, deprecate
  the old allocate function.
- Include Rect so clients aren't required to include Rect.

Bug: 145139476
Test: Cherry pick ag/9741096 and run
    android.media.cts.MediaMetadataRetrieverTest#testThumbnailVP9Hdr

Change-Id: I3c0a03b771423f23741731e725a2846709ffc5da
diff --git a/libs/ui/GraphicBufferAllocator.cpp b/libs/ui/GraphicBufferAllocator.cpp
index fcc2547..efe0931 100644
--- a/libs/ui/GraphicBufferAllocator.cpp
+++ b/libs/ui/GraphicBufferAllocator.cpp
@@ -111,11 +111,10 @@
     ALOGD("%s", s.c_str());
 }
 
-status_t GraphicBufferAllocator::allocate(uint32_t width, uint32_t height,
-        PixelFormat format, uint32_t layerCount, uint64_t usage,
-        buffer_handle_t* handle, uint32_t* stride,
-        uint64_t /*graphicBufferId*/, std::string requestorName)
-{
+status_t GraphicBufferAllocator::allocate(uint32_t width, uint32_t height, PixelFormat format,
+                                          uint32_t layerCount, uint64_t usage,
+                                          buffer_handle_t* handle, uint32_t* stride,
+                                          std::string requestorName) {
     ATRACE_CALL();
 
     // make sure to not allocate a N x 0 or 0 x N buffer, since this is
@@ -175,6 +174,13 @@
     }
 }
 
+status_t GraphicBufferAllocator::allocate(uint32_t width, uint32_t height, PixelFormat format,
+                                          uint32_t layerCount, uint64_t usage,
+                                          buffer_handle_t* handle, uint32_t* stride,
+                                          uint64_t /*graphicBufferId*/, std::string requestorName) {
+    return allocate(width, height, format, layerCount, usage, handle, stride, requestorName);
+}
+
 status_t GraphicBufferAllocator::free(buffer_handle_t handle)
 {
     ATRACE_CALL();