diff options
author | Mathias Agopian <mathias@google.com> | 2013-01-29 18:57:48 -0800 |
---|---|---|
committer | Mathias Agopian <mathias@google.com> | 2013-02-04 20:47:13 -0800 |
commit | e3e0a570a85ea40ce215e80679ba4ae1b014664f (patch) | |
tree | aa71ab7aa6e8ba589a1b53c0bdfc68b5751bdfb9 /include/hardware/hwcomposer.h | |
parent | efa40942bf792e3fa4485ac12d6020af29a9a4c3 (diff) | |
download | hardware_libhardware-e3e0a570a85ea40ce215e80679ba4ae1b014664f.zip hardware_libhardware-e3e0a570a85ea40ce215e80679ba4ae1b014664f.tar.gz hardware_libhardware-e3e0a570a85ea40ce215e80679ba4ae1b014664f.tar.bz2 |
add support for plane-alpha in HWC
Change-Id: Ied228e689ca892c505fbd811fd2b8579287e4ac6
Diffstat (limited to 'include/hardware/hwcomposer.h')
-rw-r--r-- | include/hardware/hwcomposer.h | 42 |
1 files changed, 41 insertions, 1 deletions
diff --git a/include/hardware/hwcomposer.h b/include/hardware/hwcomposer.h index 391fe64..3b29f1f 100644 --- a/include/hardware/hwcomposer.h +++ b/include/hardware/hwcomposer.h @@ -202,13 +202,53 @@ typedef struct hwc_layer_1 { * responsible for closing it when no longer needed. */ int releaseFenceFd; + + /* + * Availability: HWC_DEVICE_API_VERSION_1_2 + * + * Alpha value applied to the whole layer. The effective + * value of each pixel is computed as: + * + * if (blending == HWC_BLENDING_PREMULT) + * pixel.rgb = pixel.rgb * planeAlpha / 255 + * pixel.a = pixel.a * planeAlpha / 255 + * + * Then blending proceeds as usual according to the "blending" + * field above. + * + * NOTE: planeAlpha applies to YUV layers as well: + * + * pixel.rgb = yuv_to_rgb(pixel.yuv) + * if (blending == HWC_BLENDING_PREMULT) + * pixel.rgb = pixel.rgb * planeAlpha / 255 + * pixel.a = planeAlpha + * + * + * IMPLEMENTATION NOTE: + * + * If the source image doesn't have an alpha channel, then + * the h/w can use the HWC_BLENDING_COVERAGE equations instead of + * HWC_BLENDING_PREMULT and simply set the alpha channel to + * planeAlpha. + * + * e.g.: + * + * if (blending == HWC_BLENDING_PREMULT) + * blending = HWC_BLENDING_COVERAGE; + * pixel.a = planeAlpha; + * + */ + uint8_t planeAlpha; + + /* reserved for future use */ + uint8_t _pad[3]; }; }; /* Allow for expansion w/o breaking binary compatibility. * Pad layer to 96 bytes, assuming 32-bit pointers. */ - int32_t reserved[24 - 18]; + int32_t reserved[24 - 19]; } hwc_layer_1_t; |