[Cogl] [PATCH] Set the COGL_BITWISE_BIT flag for the formats with 10-bit components
Robert Bragg
robert at sixbynine.org
Mon Jan 20 06:19:20 PST 2014
Ah, good catch!
This looks good to land to me:
Reviewed-by: Robert Bragg <robert at linux.intel.com>
Thanks,
Robert
On Wed, Jan 15, 2014 at 5:58 PM, Neil Roberts <neil at linux.intel.com> wrote:
> The texture formats which have 10-bit components are necessarily not
> byte-aligned so they ought to have the COGL_BITWISE_BIT flag. This
> flag is enough to make them unique so they no longer need a new enum
> value. The last enum value is therefore reset back to 1.
> ---
> cogl/cogl-types.h | 18 +++++++++---------
> 1 file changed, 9 insertions(+), 9 deletions(-)
>
> diff --git a/cogl/cogl-types.h b/cogl/cogl-types.h
> index 007c801..2126bdd 100644
> --- a/cogl/cogl-types.h
> +++ b/cogl/cogl-types.h
> @@ -264,7 +264,7 @@ typedef struct _CoglColor CoglColor;
> * increment of the last sequence number in the most significant
> * byte.
> *
> - * The last sequence number used was 2
> + * The last sequence number used was 1
> *
> * Update this note whenever a new sequence number is used.
> */
> @@ -344,15 +344,15 @@ typedef enum { /*< prefix=COGL_PIXEL_FORMAT >*/
> COGL_PIXEL_FORMAT_ARGB_8888_PRE = (4 | COGL_A_BIT | COGL_AFIRST_BIT | COGL_PREMULT_BIT),
> COGL_PIXEL_FORMAT_ABGR_8888_PRE = (4 | COGL_A_BIT | COGL_BGR_BIT | COGL_AFIRST_BIT | COGL_PREMULT_BIT),
>
> - COGL_PIXEL_FORMAT_RGBA_1010102 = (4 | COGL_A_BIT | COGL_FORMAT_ENUM(2)),
> - COGL_PIXEL_FORMAT_BGRA_1010102 = (4 | COGL_A_BIT | COGL_FORMAT_ENUM(2) | COGL_BGR_BIT),
> - COGL_PIXEL_FORMAT_ARGB_2101010 = (4 | COGL_A_BIT | COGL_FORMAT_ENUM(2) | COGL_AFIRST_BIT),
> - COGL_PIXEL_FORMAT_ABGR_2101010 = (4 | COGL_A_BIT | COGL_FORMAT_ENUM(2) | COGL_BGR_BIT | COGL_AFIRST_BIT),
> + COGL_PIXEL_FORMAT_RGBA_1010102 = (4 | COGL_A_BIT | COGL_BITWISE_BIT),
> + COGL_PIXEL_FORMAT_BGRA_1010102 = (4 | COGL_A_BIT | COGL_BITWISE_BIT | COGL_BGR_BIT),
> + COGL_PIXEL_FORMAT_ARGB_2101010 = (4 | COGL_A_BIT | COGL_BITWISE_BIT | COGL_AFIRST_BIT),
> + COGL_PIXEL_FORMAT_ABGR_2101010 = (4 | COGL_A_BIT | COGL_BITWISE_BIT | COGL_BGR_BIT | COGL_AFIRST_BIT),
>
> - COGL_PIXEL_FORMAT_RGBA_1010102_PRE = (4 | COGL_A_BIT | COGL_FORMAT_ENUM(2) | COGL_PREMULT_BIT),
> - COGL_PIXEL_FORMAT_BGRA_1010102_PRE = (4 | COGL_A_BIT | COGL_FORMAT_ENUM(2) | COGL_BGR_BIT | COGL_PREMULT_BIT),
> - COGL_PIXEL_FORMAT_ARGB_2101010_PRE = (4 | COGL_A_BIT | COGL_FORMAT_ENUM(2) | COGL_AFIRST_BIT | COGL_PREMULT_BIT),
> - COGL_PIXEL_FORMAT_ABGR_2101010_PRE = (4 | COGL_A_BIT | COGL_FORMAT_ENUM(2) | COGL_BGR_BIT | COGL_AFIRST_BIT | COGL_PREMULT_BIT),
> + COGL_PIXEL_FORMAT_RGBA_1010102_PRE = (4 | COGL_A_BIT | COGL_BITWISE_BIT | COGL_PREMULT_BIT),
> + COGL_PIXEL_FORMAT_BGRA_1010102_PRE = (4 | COGL_A_BIT | COGL_BITWISE_BIT | COGL_BGR_BIT | COGL_PREMULT_BIT),
> + COGL_PIXEL_FORMAT_ARGB_2101010_PRE = (4 | COGL_A_BIT | COGL_BITWISE_BIT | COGL_AFIRST_BIT | COGL_PREMULT_BIT),
> + COGL_PIXEL_FORMAT_ABGR_2101010_PRE = (4 | COGL_A_BIT | COGL_BITWISE_BIT | COGL_BGR_BIT | COGL_AFIRST_BIT | COGL_PREMULT_BIT),
>
> COGL_PIXEL_FORMAT_DEPTH_16 = (2 | COGL_DEPTH_BIT),
> COGL_PIXEL_FORMAT_DEPTH_32 = (4 | COGL_DEPTH_BIT),
> --
> 1.8.4.2
>
> _______________________________________________
> Cogl mailing list
> Cogl at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/cogl
More information about the Cogl
mailing list