diff options
author | Mathias Agopian <mathias@google.com> | 2009-04-10 14:24:30 -0700 |
---|---|---|
committer | Mathias Agopian <mathias@google.com> | 2009-04-10 14:24:30 -0700 |
commit | 076b1cc3a9b90aa5b381a1ed268ca0b548444c9b (patch) | |
tree | b87f7863623b37fa9a6cc4ef48934aab46f79986 /include/ui/PixelFormat.h | |
parent | 4ec21527096d0dcaa99634e6058aca3a415461af (diff) | |
download | frameworks_native-076b1cc3a9b90aa5b381a1ed268ca0b548444c9b.zip frameworks_native-076b1cc3a9b90aa5b381a1ed268ca0b548444c9b.tar.gz frameworks_native-076b1cc3a9b90aa5b381a1ed268ca0b548444c9b.tar.bz2 |
Integrate from //sandbox/mathias/donut/...@145728
SurfaceFlinger rework for new EGL driver model support.
Diffstat (limited to 'include/ui/PixelFormat.h')
-rw-r--r-- | include/ui/PixelFormat.h | 36 |
1 files changed, 28 insertions, 8 deletions
diff --git a/include/ui/PixelFormat.h b/include/ui/PixelFormat.h index 14af823..6d87321b 100644 --- a/include/ui/PixelFormat.h +++ b/include/ui/PixelFormat.h @@ -84,6 +84,13 @@ typedef int32_t PixelFormat; struct PixelFormatInfo { + enum { + INDEX_ALPHA = 0, + INDEX_RED = 1, + INDEX_GREEN = 2, + INDEX_BLUE = 3 + }; + enum { // components ALPHA = 1, RGB = 2, @@ -95,20 +102,33 @@ struct PixelFormatInfo Y_CB_CR_I = 8, }; + struct szinfo { + uint8_t h; + uint8_t l; + }; + inline PixelFormatInfo() : version(sizeof(PixelFormatInfo)) { } size_t getScanlineSize(unsigned int width) const; + size_t getSize(size_t ci) const { + return (ci <= 3) ? (cinfo[ci].h - cinfo[ci].l) : 0; + } size_t version; PixelFormat format; size_t bytesPerPixel; size_t bitsPerPixel; - uint8_t h_alpha; - uint8_t l_alpha; - uint8_t h_red; - uint8_t l_red; - uint8_t h_green; - uint8_t l_green; - uint8_t h_blue; - uint8_t l_blue; + union { + szinfo cinfo[4]; + struct { + uint8_t h_alpha; + uint8_t l_alpha; + uint8_t h_red; + uint8_t l_red; + uint8_t h_green; + uint8_t l_green; + uint8_t h_blue; + uint8_t l_blue; + }; + }; uint8_t components; uint8_t reserved0[3]; uint32_t reserved1; |