pixman: Add support for argb/xrgb float formats, v5.
authorMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
Wed, 30 May 2018 14:07:10 +0000 (16:07 +0200)
committerMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
Tue, 6 Nov 2018 13:24:05 +0000 (14:24 +0100)
commita4b8a26d2b741e1b3a17b58d34b67bffa17bf15c
tree661daa61ecd39d669837133e05cdd3ed6cc6d69c
parent018bf2f23033ea0c82df3e4cf48dbb330bec9414
pixman: Add support for argb/xrgb float formats, v5.

Pixman is already using the floating point formats internally, expose
this capability in case someone wants to support higher bit per
component formats.

This is useful for igt which depends on cairo to do the rendering.
It can use it to convert floats internally to planar Y'CbCr formats,
or to F16.

We add a new type PIXMAN_TYPE_RGBA_FLOAT for this format, which is an
all float array of R, G, B, and A. Formats that use mixed float/int
RGBA aren't supported, and will probably need their own type.

Changes since v1:
- Use RGBA 128 bits and RGB 96 bits memory layouts, to better match the opengl format.
Changes since v2:
- Add asserts in accessor and for strides to force alignment.
- Move test changes to their own commit.
Changes since v3:
- Define 32bpc as PIXMAN_FORMAT_PACKED_C32
- Rename pixman accessors from rgb*_float_float to rgb*f_float
Changes since v4:
- Create a new PIXMAN_FORMAT_BYTE for fitting up to 64 bits per component.
  (based on Siarhei Siamashka's suggestion)
- Use new format type PIXMAN_TYPE_RGBA_FLOAT

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> #v4
[mlankhorst: Fix missing braces in PIXMAN_FORMAT_RESHIFT macro]
pixman/pixman-access.c
pixman/pixman-bits-image.c
pixman/pixman-image.c
pixman/pixman.c
pixman/pixman.h