[Cogl] [PATCH] Set the COGL_BITWISE_BIT flag for the formats with 10-bit components

Neil Roberts neil at linux.intel.com
Wed Jan 15 09:58:37 PST 2014


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



More information about the Cogl mailing list