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
3 files changed