OSDN Git Service

gralloc: add GRALLOC_USAGE_CURSOR flag
authorGreg Hackmann <ghackmann@google.com>
Wed, 9 Jul 2014 20:58:44 +0000 (13:58 -0700)
committerGreg Hackmann <ghackmann@google.com>
Wed, 23 Jul 2014 20:59:44 +0000 (20:59 +0000)
On many devices, hardware cursors have stricter layout constraints than
other overlays.  GRALLOC_USAGE_CURSOR indicates a buffer may be used as
a cursor; byte order and padding should be chosen accordingly.

GRALLOC_USAGE_CURSOR must not cause allocation failure.  If the requested
properties (dimensions, format, other usage flags, etc.) aren't compatible with
the device's cursor hardware, the implementation must allocate the buffer
anyway, acting as if GRALLOC_USAGE_CURSOR were not specified.

Change-Id: I7d66e8d7c953421d996c5def3257d408f91962f4
Signed-off-by: Greg Hackmann <ghackmann@google.com>
include/hardware/gralloc.h

index e7d0103..91e2f69 100644 (file)
@@ -124,6 +124,9 @@ enum {
      */
     GRALLOC_USAGE_PROTECTED             = 0x00004000,
 
+    /* buffer may be used as a cursor */
+    GRALLOC_USAGE_CURSOR                = 0x00008000,
+
     /* implementation-specific private usage flags */
     GRALLOC_USAGE_PRIVATE_0             = 0x10000000,
     GRALLOC_USAGE_PRIVATE_1             = 0x20000000,