github.com/racerxdl/gonx@v0.0.0-20210103083128-c5afc43bcbd2/services/display/types.go (about)

     1  package display
     2  
     3  // From Android gralloc.h
     4  
     5  const (
     6  	/* buffer is never read in software */
     7  	GRALLOC_USAGE_SW_READ_NEVER = 0x00000000
     8  	/* buffer is rarely read in software */
     9  	GRALLOC_USAGE_SW_READ_RARELY = 0x00000002
    10  	/* buffer is often read in software */
    11  	GRALLOC_USAGE_SW_READ_OFTEN = 0x00000003
    12  	/* mask for the software read values */
    13  	GRALLOC_USAGE_SW_READ_MASK = 0x0000000F
    14  	/* buffer is never written in software */
    15  	GRALLOC_USAGE_SW_WRITE_NEVER = 0x00000000
    16  	/* buffer is rarely written in software */
    17  	GRALLOC_USAGE_SW_WRITE_RARELY = 0x00000020
    18  	/* buffer is often written in software */
    19  	GRALLOC_USAGE_SW_WRITE_OFTEN = 0x00000030
    20  	/* mask for the software write values */
    21  	GRALLOC_USAGE_SW_WRITE_MASK = 0x000000F0
    22  	/* buffer will be used as an OpenGL ES texture */
    23  	GRALLOC_USAGE_HW_TEXTURE = 0x00000100
    24  	/* buffer will be used as an OpenGL ES render target */
    25  	GRALLOC_USAGE_HW_RENDER = 0x00000200
    26  	/* buffer will be used by the 2D hardware blitter */
    27  	GRALLOC_USAGE_HW_2D = 0x00000400
    28  	/* buffer will be used by the HWComposer HAL module */
    29  	GRALLOC_USAGE_HW_COMPOSER = 0x00000800
    30  	/* buffer will be used with the framebuffer device */
    31  	GRALLOC_USAGE_HW_FB = 0x00001000
    32  	/* buffer should be displayed full-screen on an external display when
    33  	 * possible */
    34  	GRALLOC_USAGE_EXTERNAL_DISP = 0x00002000
    35  	/* Must have a hardware-protected path to external display sink for
    36  	 * this buffer.  If a hardware-protected path is not available, then
    37  	 * either don't composite only this buffer (preferred) to the
    38  	 * external sink, or (less desirable) do not route the entire
    39  	 * composition to the external sink.  */
    40  	GRALLOC_USAGE_PROTECTED = 0x00004000
    41  	/* buffer may be used as a cursor */
    42  	GRALLOC_USAGE_CURSOR = 0x00008000
    43  	/* buffer will be used with the HW video encoder */
    44  	GRALLOC_USAGE_HW_VIDEO_ENCODER = 0x00010000
    45  	/* buffer will be written by the HW camera pipeline */
    46  	GRALLOC_USAGE_HW_CAMERA_WRITE = 0x00020000
    47  	/* buffer will be read by the HW camera pipeline */
    48  	GRALLOC_USAGE_HW_CAMERA_READ = 0x00040000
    49  	/* buffer will be used as part of zero-shutter-lag queue */
    50  	GRALLOC_USAGE_HW_CAMERA_ZSL = 0x00060000
    51  	/* mask for the camera access values */
    52  	GRALLOC_USAGE_HW_CAMERA_MASK = 0x00060000
    53  	/* mask for the software usage bit-mask */
    54  	GRALLOC_USAGE_HW_MASK = 0x00071F00
    55  	/* buffer will be used as a RenderScript Allocation */
    56  	GRALLOC_USAGE_RENDERSCRIPT = 0x00100000
    57  )