[cogl] bitmap: Don't try to token paste the typenames from stdint.h



commit d6b5d7085b004ebd48c1543b820331802395ee63
Author: Neil Roberts <neil linux intel com>
Date:   Fri Jan 18 18:14:42 2013 +0000

    bitmap: Don't try to token paste the typenames from stdint.h
    
    Previously the functions for packing and unpacking pixels where
    generated by token pasting together a function name along with its
    type, like the following:
    
     _cogl_pack_ ## uint8_t
    
    Then later in cogl-bitmap-conversion.c it would directly refer to the
    function names without token pasting.
    
    This wouldn't work however if the system headers define the stdint
    types using #defines instead of typedefs because in that case the
    function name generated using token pasting would get the expanded
    type name but the reference that doesn't use token pasting wouldn't.
    
    This patch adds an extra macro passed to the cogl-bitmap-packing.h
    header which just has the type size. That way the function can be
    defined like this instead:
    
     _cogl_pack_ ## 8
    
    That should prevent it from hitting problems with #defined types.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=691945
    
    Reviewed-by: Robert Bragg <robert linux intel com>

 cogl/cogl-bitmap-conversion.c |   52 +++++++++--------
 cogl/cogl-bitmap-packing.h    |  124 ++++++++++++++++++++--------------------
 2 files changed, 90 insertions(+), 86 deletions(-)
---
diff --git a/cogl/cogl-bitmap-conversion.c b/cogl/cogl-bitmap-conversion.c
index ccc32cd..4a388d9 100644
--- a/cogl/cogl-bitmap-conversion.c
+++ b/cogl/cogl-bitmap-conversion.c
@@ -32,6 +32,7 @@
 #include <string.h>
 
 #define component_type uint8_t
+#define component_size 8
 /* We want to specially optimise the packing when we are converting
    to/from an 8-bit type so that it won't do anything. That way for
    example if we are just doing a swizzle conversion then the inner
@@ -42,14 +43,17 @@
 #undef PACK_BYTE
 #undef UNPACK_BYTE
 #undef component_type
+#undef component_size
 
 #define component_type uint16_t
+#define component_size 16
 #define UNPACK_BYTE(b) (((b) * 65535 + 127) / 255)
 #define PACK_BYTE(b) (((b) * 255 + 32767) / 65535)
 #include "cogl-bitmap-packing.h"
 #undef PACK_BYTE
 #undef UNPACK_BYTE
 #undef component_type
+#undef component_size
 
 /* (Un)Premultiplication */
 
@@ -205,8 +209,8 @@ _cogl_premult_alpha_last_four_pixels_sse2 (uint8_t *p)
 #endif /* COGL_USE_PREMULT_SSE2 */
 
 static void
-_cogl_bitmap_premult_unpacked_span_uint8_t (uint8_t *data,
-                                           int width)
+_cogl_bitmap_premult_unpacked_span_8 (uint8_t *data,
+                                      int width)
 {
 #ifdef COGL_USE_PREMULT_SSE2
 
@@ -231,8 +235,8 @@ _cogl_bitmap_premult_unpacked_span_uint8_t (uint8_t *data,
 }
 
 static void
-_cogl_bitmap_unpremult_unpacked_span_uint8_t (uint8_t *data,
-                                             int width)
+_cogl_bitmap_unpremult_unpacked_span_8 (uint8_t *data,
+                                        int width)
 {
   int x;
 
@@ -247,8 +251,8 @@ _cogl_bitmap_unpremult_unpacked_span_uint8_t (uint8_t *data,
 }
 
 static void
-_cogl_bitmap_unpremult_unpacked_span_uint16_t (uint16_t *data,
-                                              int width)
+_cogl_bitmap_unpremult_unpacked_span_16 (uint16_t *data,
+                                         int width)
 {
   while (width-- > 0)
     {
@@ -266,8 +270,8 @@ _cogl_bitmap_unpremult_unpacked_span_uint16_t (uint16_t *data,
 }
 
 static void
-_cogl_bitmap_premult_unpacked_span_uint16_t (uint16_t *data,
-                                            int width)
+_cogl_bitmap_premult_unpacked_span_16 (uint16_t *data,
+                                       int width)
 {
   while (width-- > 0)
     {
@@ -435,9 +439,9 @@ _cogl_bitmap_convert_into_bitmap (CoglBitmap *src_bmp,
       dst = dst_data + y * dst_rowstride;
 
       if (use_16)
-        _cogl_unpack_uint16_t (src_format, src, tmp_row, width);
+        _cogl_unpack_16 (src_format, src, tmp_row, width);
       else
-        _cogl_unpack_uint8_t (src_format, src, tmp_row, width);
+        _cogl_unpack_8 (src_format, src, tmp_row, width);
 
       /* Handle premultiplication */
       if (need_premult)
@@ -445,23 +449,23 @@ _cogl_bitmap_convert_into_bitmap (CoglBitmap *src_bmp,
           if (dst_format & COGL_PREMULT_BIT)
             {
               if (use_16)
-                _cogl_bitmap_premult_unpacked_span_uint16_t (tmp_row, width);
+                _cogl_bitmap_premult_unpacked_span_16 (tmp_row, width);
               else
-                _cogl_bitmap_premult_unpacked_span_uint8_t (tmp_row, width);
+                _cogl_bitmap_premult_unpacked_span_8 (tmp_row, width);
             }
           else
             {
               if (use_16)
-                _cogl_bitmap_unpremult_unpacked_span_uint16_t (tmp_row, width);
+                _cogl_bitmap_unpremult_unpacked_span_16 (tmp_row, width);
               else
-                _cogl_bitmap_unpremult_unpacked_span_uint8_t (tmp_row, width);
+                _cogl_bitmap_unpremult_unpacked_span_8 (tmp_row, width);
             }
         }
 
       if (use_16)
-        _cogl_pack_uint16_t (dst_format, tmp_row, dst, width);
+        _cogl_pack_16 (dst_format, tmp_row, dst, width);
       else
-        _cogl_pack_uint8_t (dst_format, tmp_row, dst, width);
+        _cogl_pack_8 (dst_format, tmp_row, dst, width);
     }
 
   _cogl_bitmap_unmap (src_bmp);
@@ -538,9 +542,9 @@ _cogl_bitmap_unpremult (CoglBitmap *bmp,
 
       if (tmp_row)
         {
-          _cogl_unpack_uint16_t (format, p, tmp_row, width);
-          _cogl_bitmap_unpremult_unpacked_span_uint16_t (tmp_row, width);
-          _cogl_pack_uint16_t (format, tmp_row, p, width);
+          _cogl_unpack_16 (format, p, tmp_row, width);
+          _cogl_bitmap_unpremult_unpacked_span_16 (tmp_row, width);
+          _cogl_pack_16 (format, tmp_row, p, width);
         }
       else
         {
@@ -556,7 +560,7 @@ _cogl_bitmap_unpremult (CoglBitmap *bmp,
                 }
             }
           else
-            _cogl_bitmap_unpremult_unpacked_span_uint8_t (p, width);
+            _cogl_bitmap_unpremult_unpacked_span_8 (p, width);
         }
     }
 
@@ -605,9 +609,9 @@ _cogl_bitmap_premult (CoglBitmap *bmp,
 
       if (tmp_row)
         {
-          _cogl_unpack_uint16_t (format, p, tmp_row, width);
-          _cogl_bitmap_premult_unpacked_span_uint16_t (tmp_row, width);
-          _cogl_pack_uint16_t (format, tmp_row, p, width);
+          _cogl_unpack_16 (format, p, tmp_row, width);
+          _cogl_bitmap_premult_unpacked_span_16 (tmp_row, width);
+          _cogl_pack_16 (format, tmp_row, p, width);
         }
       else
         {
@@ -620,7 +624,7 @@ _cogl_bitmap_premult (CoglBitmap *bmp,
                 }
             }
           else
-            _cogl_bitmap_premult_unpacked_span_uint8_t (p, width);
+            _cogl_bitmap_premult_unpacked_span_8 (p, width);
         }
     }
 
diff --git a/cogl/cogl-bitmap-packing.h b/cogl/cogl-bitmap-packing.h
index 131b9bf..2c714ce 100644
--- a/cogl/cogl-bitmap-packing.h
+++ b/cogl/cogl-bitmap-packing.h
@@ -42,7 +42,7 @@
                        511) / 1023)
 
 inline static void
-G_PASTE (_cogl_unpack_a_8_, component_type) (const uint8_t *src,
+G_PASTE (_cogl_unpack_a_8_, component_size) (const uint8_t *src,
                                              component_type *dst,
                                              int width)
 {
@@ -58,7 +58,7 @@ G_PASTE (_cogl_unpack_a_8_, component_type) (const uint8_t *src,
 }
 
 inline static void
-G_PASTE (_cogl_unpack_g_8_, component_type) (const uint8_t *src,
+G_PASTE (_cogl_unpack_g_8_, component_size) (const uint8_t *src,
                                              component_type *dst,
                                              int width)
 {
@@ -79,7 +79,7 @@ G_PASTE (_cogl_unpack_g_8_, component_type) (const uint8_t *src,
 }
 
 inline static void
-G_PASTE (_cogl_unpack_rgb_888_, component_type) (const uint8_t *src,
+G_PASTE (_cogl_unpack_rgb_888_, component_size) (const uint8_t *src,
                                                  component_type *dst,
                                                  int width)
 {
@@ -95,7 +95,7 @@ G_PASTE (_cogl_unpack_rgb_888_, component_type) (const uint8_t *src,
 }
 
 inline static void
-G_PASTE (_cogl_unpack_bgr_888_, component_type) (const uint8_t *src,
+G_PASTE (_cogl_unpack_bgr_888_, component_size) (const uint8_t *src,
                                                  component_type *dst,
                                                  int width)
 {
@@ -111,7 +111,7 @@ G_PASTE (_cogl_unpack_bgr_888_, component_type) (const uint8_t *src,
 }
 
 inline static void
-G_PASTE (_cogl_unpack_bgra_8888_, component_type) (const uint8_t *src,
+G_PASTE (_cogl_unpack_bgra_8888_, component_size) (const uint8_t *src,
                                                    component_type *dst,
                                                    int width)
 {
@@ -127,7 +127,7 @@ G_PASTE (_cogl_unpack_bgra_8888_, component_type) (const uint8_t *src,
 }
 
 inline static void
-G_PASTE (_cogl_unpack_argb_8888_, component_type) (const uint8_t *src,
+G_PASTE (_cogl_unpack_argb_8888_, component_size) (const uint8_t *src,
                                                    component_type *dst,
                                                    int width)
 {
@@ -143,7 +143,7 @@ G_PASTE (_cogl_unpack_argb_8888_, component_type) (const uint8_t *src,
 }
 
 inline static void
-G_PASTE (_cogl_unpack_abgr_8888_, component_type) (const uint8_t *src,
+G_PASTE (_cogl_unpack_abgr_8888_, component_size) (const uint8_t *src,
                                                    component_type *dst,
                                                    int width)
 {
@@ -159,7 +159,7 @@ G_PASTE (_cogl_unpack_abgr_8888_, component_type) (const uint8_t *src,
 }
 
 inline static void
-G_PASTE (_cogl_unpack_rgba_8888_, component_type) (const uint8_t *src,
+G_PASTE (_cogl_unpack_rgba_8888_, component_size) (const uint8_t *src,
                                                    component_type *dst,
                                                    int width)
 {
@@ -175,7 +175,7 @@ G_PASTE (_cogl_unpack_rgba_8888_, component_type) (const uint8_t *src,
 }
 
 inline static void
-G_PASTE (_cogl_unpack_rgb_565_, component_type) (const uint8_t *src,
+G_PASTE (_cogl_unpack_rgb_565_, component_size) (const uint8_t *src,
                                                  component_type *dst,
                                                  int width)
 {
@@ -193,7 +193,7 @@ G_PASTE (_cogl_unpack_rgb_565_, component_type) (const uint8_t *src,
 }
 
 inline static void
-G_PASTE (_cogl_unpack_rgba_4444_, component_type) (const uint8_t *src,
+G_PASTE (_cogl_unpack_rgba_4444_, component_size) (const uint8_t *src,
                                                    component_type *dst,
                                                    int width)
 {
@@ -211,7 +211,7 @@ G_PASTE (_cogl_unpack_rgba_4444_, component_type) (const uint8_t *src,
 }
 
 inline static void
-G_PASTE (_cogl_unpack_rgba_5551_, component_type) (const uint8_t *src,
+G_PASTE (_cogl_unpack_rgba_5551_, component_size) (const uint8_t *src,
                                                    component_type *dst,
                                                    int width)
 {
@@ -229,7 +229,7 @@ G_PASTE (_cogl_unpack_rgba_5551_, component_type) (const uint8_t *src,
 }
 
 inline static void
-G_PASTE (_cogl_unpack_rgba_1010102_, component_type) (const uint8_t *src,
+G_PASTE (_cogl_unpack_rgba_1010102_, component_size) (const uint8_t *src,
                                                       component_type *dst,
                                                       int width)
 {
@@ -247,7 +247,7 @@ G_PASTE (_cogl_unpack_rgba_1010102_, component_type) (const uint8_t *src,
 }
 
 inline static void
-G_PASTE (_cogl_unpack_bgra_1010102_, component_type) (const uint8_t *src,
+G_PASTE (_cogl_unpack_bgra_1010102_, component_size) (const uint8_t *src,
                                                       component_type *dst,
                                                       int width)
 {
@@ -265,7 +265,7 @@ G_PASTE (_cogl_unpack_bgra_1010102_, component_type) (const uint8_t *src,
 }
 
 inline static void
-G_PASTE (_cogl_unpack_argb_2101010_, component_type) (const uint8_t *src,
+G_PASTE (_cogl_unpack_argb_2101010_, component_size) (const uint8_t *src,
                                                       component_type *dst,
                                                       int width)
 {
@@ -283,7 +283,7 @@ G_PASTE (_cogl_unpack_argb_2101010_, component_type) (const uint8_t *src,
 }
 
 inline static void
-G_PASTE (_cogl_unpack_abgr_2101010_, component_type) (const uint8_t *src,
+G_PASTE (_cogl_unpack_abgr_2101010_, component_size) (const uint8_t *src,
                                                       component_type *dst,
                                                       int width)
 {
@@ -308,7 +308,7 @@ G_PASTE (_cogl_unpack_abgr_2101010_, component_type) (const uint8_t *src,
 #undef UNPACK_10
 
 inline static void
-G_PASTE (_cogl_unpack_, component_type) (CoglPixelFormat format,
+G_PASTE (_cogl_unpack_, component_size) (CoglPixelFormat format,
                                          const uint8_t *src,
                                          component_type *dst,
                                          int width)
@@ -316,59 +316,59 @@ G_PASTE (_cogl_unpack_, component_type) (CoglPixelFormat format,
   switch (format)
     {
     case COGL_PIXEL_FORMAT_A_8:
-      G_PASTE (_cogl_unpack_a_8_, component_type) (src, dst, width);
+      G_PASTE (_cogl_unpack_a_8_, component_size) (src, dst, width);
       break;
     case COGL_PIXEL_FORMAT_G_8:
-      G_PASTE (_cogl_unpack_g_8_, component_type) (src, dst, width);
+      G_PASTE (_cogl_unpack_g_8_, component_size) (src, dst, width);
       break;
     case COGL_PIXEL_FORMAT_RGB_888:
-      G_PASTE (_cogl_unpack_rgb_888_, component_type) (src, dst, width);
+      G_PASTE (_cogl_unpack_rgb_888_, component_size) (src, dst, width);
       break;
     case COGL_PIXEL_FORMAT_BGR_888:
-      G_PASTE (_cogl_unpack_bgr_888_, component_type) (src, dst, width);
+      G_PASTE (_cogl_unpack_bgr_888_, component_size) (src, dst, width);
       break;
     case COGL_PIXEL_FORMAT_RGBA_8888:
     case COGL_PIXEL_FORMAT_RGBA_8888_PRE:
-      G_PASTE (_cogl_unpack_rgba_8888_, component_type) (src, dst, width);
+      G_PASTE (_cogl_unpack_rgba_8888_, component_size) (src, dst, width);
       break;
     case COGL_PIXEL_FORMAT_BGRA_8888:
     case COGL_PIXEL_FORMAT_BGRA_8888_PRE:
-      G_PASTE (_cogl_unpack_bgra_8888_, component_type) (src, dst, width);
+      G_PASTE (_cogl_unpack_bgra_8888_, component_size) (src, dst, width);
       break;
     case COGL_PIXEL_FORMAT_ARGB_8888:
     case COGL_PIXEL_FORMAT_ARGB_8888_PRE:
-      G_PASTE (_cogl_unpack_argb_8888_, component_type) (src, dst, width);
+      G_PASTE (_cogl_unpack_argb_8888_, component_size) (src, dst, width);
       break;
     case COGL_PIXEL_FORMAT_ABGR_8888:
     case COGL_PIXEL_FORMAT_ABGR_8888_PRE:
-      G_PASTE (_cogl_unpack_abgr_8888_, component_type) (src, dst, width);
+      G_PASTE (_cogl_unpack_abgr_8888_, component_size) (src, dst, width);
       break;
     case COGL_PIXEL_FORMAT_RGB_565:
-      G_PASTE (_cogl_unpack_rgb_565_, component_type) (src, dst, width);
+      G_PASTE (_cogl_unpack_rgb_565_, component_size) (src, dst, width);
       break;
     case COGL_PIXEL_FORMAT_RGBA_4444:
     case COGL_PIXEL_FORMAT_RGBA_4444_PRE:
-      G_PASTE (_cogl_unpack_rgba_4444_, component_type) (src, dst, width);
+      G_PASTE (_cogl_unpack_rgba_4444_, component_size) (src, dst, width);
       break;
     case COGL_PIXEL_FORMAT_RGBA_5551:
     case COGL_PIXEL_FORMAT_RGBA_5551_PRE:
-      G_PASTE (_cogl_unpack_rgba_5551_, component_type) (src, dst, width);
+      G_PASTE (_cogl_unpack_rgba_5551_, component_size) (src, dst, width);
       break;
     case COGL_PIXEL_FORMAT_RGBA_1010102:
     case COGL_PIXEL_FORMAT_RGBA_1010102_PRE:
-      G_PASTE (_cogl_unpack_rgba_1010102_, component_type) (src, dst, width);
+      G_PASTE (_cogl_unpack_rgba_1010102_, component_size) (src, dst, width);
       break;
     case COGL_PIXEL_FORMAT_BGRA_1010102:
     case COGL_PIXEL_FORMAT_BGRA_1010102_PRE:
-      G_PASTE (_cogl_unpack_bgra_1010102_, component_type) (src, dst, width);
+      G_PASTE (_cogl_unpack_bgra_1010102_, component_size) (src, dst, width);
       break;
     case COGL_PIXEL_FORMAT_ARGB_2101010:
     case COGL_PIXEL_FORMAT_ARGB_2101010_PRE:
-      G_PASTE (_cogl_unpack_argb_2101010_, component_type) (src, dst, width);
+      G_PASTE (_cogl_unpack_argb_2101010_, component_size) (src, dst, width);
       break;
     case COGL_PIXEL_FORMAT_ABGR_2101010:
     case COGL_PIXEL_FORMAT_ABGR_2101010_PRE:
-      G_PASTE (_cogl_unpack_abgr_2101010_, component_type) (src, dst, width);
+      G_PASTE (_cogl_unpack_abgr_2101010_, component_size) (src, dst, width);
       break;
     case COGL_PIXEL_FORMAT_DEPTH_16:
     case COGL_PIXEL_FORMAT_DEPTH_32:
@@ -393,7 +393,7 @@ G_PASTE (_cogl_unpack_, component_type) (CoglPixelFormat format,
 #define PACK_10(b) PACK_SIZE (b, 1023)
 
 inline static void
-G_PASTE (_cogl_pack_a_8_, component_type) (const component_type *src,
+G_PASTE (_cogl_pack_a_8_, component_size) (const component_type *src,
                                            uint8_t *dst,
                                            int width)
 {
@@ -406,7 +406,7 @@ G_PASTE (_cogl_pack_a_8_, component_type) (const component_type *src,
 }
 
 inline static void
-G_PASTE (_cogl_pack_g_8_, component_type) (const component_type *src,
+G_PASTE (_cogl_pack_g_8_, component_size) (const component_type *src,
                                            uint8_t *dst,
                                            int width)
 {
@@ -424,7 +424,7 @@ G_PASTE (_cogl_pack_g_8_, component_type) (const component_type *src,
 }
 
 inline static void
-G_PASTE (_cogl_pack_rgb_888_, component_type) (const component_type *src,
+G_PASTE (_cogl_pack_rgb_888_, component_size) (const component_type *src,
                                                uint8_t *dst,
                                                int width)
 {
@@ -439,7 +439,7 @@ G_PASTE (_cogl_pack_rgb_888_, component_type) (const component_type *src,
 }
 
 inline static void
-G_PASTE (_cogl_pack_bgr_888_, component_type) (const component_type *src,
+G_PASTE (_cogl_pack_bgr_888_, component_size) (const component_type *src,
                                                uint8_t *dst,
                                                int width)
 {
@@ -454,7 +454,7 @@ G_PASTE (_cogl_pack_bgr_888_, component_type) (const component_type *src,
 }
 
 inline static void
-G_PASTE (_cogl_pack_bgra_8888_, component_type) (const component_type *src,
+G_PASTE (_cogl_pack_bgra_8888_, component_size) (const component_type *src,
                                                  uint8_t *dst,
                                                  int width)
 {
@@ -470,7 +470,7 @@ G_PASTE (_cogl_pack_bgra_8888_, component_type) (const component_type *src,
 }
 
 inline static void
-G_PASTE (_cogl_pack_argb_8888_, component_type) (const component_type *src,
+G_PASTE (_cogl_pack_argb_8888_, component_size) (const component_type *src,
                                                  uint8_t *dst,
                                                  int width)
 {
@@ -486,7 +486,7 @@ G_PASTE (_cogl_pack_argb_8888_, component_type) (const component_type *src,
 }
 
 inline static void
-G_PASTE (_cogl_pack_abgr_8888_, component_type) (const component_type *src,
+G_PASTE (_cogl_pack_abgr_8888_, component_size) (const component_type *src,
                                                  uint8_t *dst,
                                                  int width)
 {
@@ -502,7 +502,7 @@ G_PASTE (_cogl_pack_abgr_8888_, component_type) (const component_type *src,
 }
 
 inline static void
-G_PASTE (_cogl_pack_rgba_8888_, component_type) (const component_type *src,
+G_PASTE (_cogl_pack_rgba_8888_, component_size) (const component_type *src,
                                                  uint8_t *dst,
                                                  int width)
 {
@@ -518,7 +518,7 @@ G_PASTE (_cogl_pack_rgba_8888_, component_type) (const component_type *src,
 }
 
 inline static void
-G_PASTE (_cogl_pack_rgb_565_, component_type) (const component_type *src,
+G_PASTE (_cogl_pack_rgb_565_, component_size) (const component_type *src,
                                                uint8_t *dst,
                                                int width)
 {
@@ -535,7 +535,7 @@ G_PASTE (_cogl_pack_rgb_565_, component_type) (const component_type *src,
 }
 
 inline static void
-G_PASTE (_cogl_pack_rgba_4444_, component_type) (const component_type *src,
+G_PASTE (_cogl_pack_rgba_4444_, component_size) (const component_type *src,
                                                  uint8_t *dst,
                                                  int width)
 {
@@ -553,7 +553,7 @@ G_PASTE (_cogl_pack_rgba_4444_, component_type) (const component_type *src,
 }
 
 inline static void
-G_PASTE (_cogl_pack_rgba_5551_, component_type) (const component_type *src,
+G_PASTE (_cogl_pack_rgba_5551_, component_size) (const component_type *src,
                                                  uint8_t *dst,
                                                  int width)
 {
@@ -571,7 +571,7 @@ G_PASTE (_cogl_pack_rgba_5551_, component_type) (const component_type *src,
 }
 
 inline static void
-G_PASTE (_cogl_pack_rgba_1010102_, component_type) (const component_type *src,
+G_PASTE (_cogl_pack_rgba_1010102_, component_size) (const component_type *src,
                                                     uint8_t *dst,
                                                     int width)
 {
@@ -589,7 +589,7 @@ G_PASTE (_cogl_pack_rgba_1010102_, component_type) (const component_type *src,
 }
 
 inline static void
-G_PASTE (_cogl_pack_bgra_1010102_, component_type) (const component_type *src,
+G_PASTE (_cogl_pack_bgra_1010102_, component_size) (const component_type *src,
                                                     uint8_t *dst,
                                                     int width)
 {
@@ -607,7 +607,7 @@ G_PASTE (_cogl_pack_bgra_1010102_, component_type) (const component_type *src,
 }
 
 inline static void
-G_PASTE (_cogl_pack_argb_2101010_, component_type) (const component_type *src,
+G_PASTE (_cogl_pack_argb_2101010_, component_size) (const component_type *src,
                                                     uint8_t *dst,
                                                     int width)
 {
@@ -625,7 +625,7 @@ G_PASTE (_cogl_pack_argb_2101010_, component_type) (const component_type *src,
 }
 
 inline static void
-G_PASTE (_cogl_pack_abgr_2101010_, component_type) (const component_type *src,
+G_PASTE (_cogl_pack_abgr_2101010_, component_size) (const component_type *src,
                                                     uint8_t *dst,
                                                     int width)
 {
@@ -651,7 +651,7 @@ G_PASTE (_cogl_pack_abgr_2101010_, component_type) (const component_type *src,
 #undef PACK_10
 
 inline static void
-G_PASTE (_cogl_pack_, component_type) (CoglPixelFormat format,
+G_PASTE (_cogl_pack_, component_size) (CoglPixelFormat format,
                                        const component_type *src,
                                        uint8_t *dst,
                                        int width)
@@ -659,59 +659,59 @@ G_PASTE (_cogl_pack_, component_type) (CoglPixelFormat format,
   switch (format)
     {
     case COGL_PIXEL_FORMAT_A_8:
-      G_PASTE (_cogl_pack_a_8_, component_type) (src, dst, width);
+      G_PASTE (_cogl_pack_a_8_, component_size) (src, dst, width);
       break;
     case COGL_PIXEL_FORMAT_G_8:
-      G_PASTE (_cogl_pack_g_8_, component_type) (src, dst, width);
+      G_PASTE (_cogl_pack_g_8_, component_size) (src, dst, width);
       break;
     case COGL_PIXEL_FORMAT_RGB_888:
-      G_PASTE (_cogl_pack_rgb_888_, component_type) (src, dst, width);
+      G_PASTE (_cogl_pack_rgb_888_, component_size) (src, dst, width);
       break;
     case COGL_PIXEL_FORMAT_BGR_888:
-      G_PASTE (_cogl_pack_bgr_888_, component_type) (src, dst, width);
+      G_PASTE (_cogl_pack_bgr_888_, component_size) (src, dst, width);
       break;
     case COGL_PIXEL_FORMAT_RGBA_8888:
     case COGL_PIXEL_FORMAT_RGBA_8888_PRE:
-      G_PASTE (_cogl_pack_rgba_8888_, component_type) (src, dst, width);
+      G_PASTE (_cogl_pack_rgba_8888_, component_size) (src, dst, width);
       break;
     case COGL_PIXEL_FORMAT_BGRA_8888:
     case COGL_PIXEL_FORMAT_BGRA_8888_PRE:
-      G_PASTE (_cogl_pack_bgra_8888_, component_type) (src, dst, width);
+      G_PASTE (_cogl_pack_bgra_8888_, component_size) (src, dst, width);
       break;
     case COGL_PIXEL_FORMAT_ARGB_8888:
     case COGL_PIXEL_FORMAT_ARGB_8888_PRE:
-      G_PASTE (_cogl_pack_argb_8888_, component_type) (src, dst, width);
+      G_PASTE (_cogl_pack_argb_8888_, component_size) (src, dst, width);
       break;
     case COGL_PIXEL_FORMAT_ABGR_8888:
     case COGL_PIXEL_FORMAT_ABGR_8888_PRE:
-      G_PASTE (_cogl_pack_abgr_8888_, component_type) (src, dst, width);
+      G_PASTE (_cogl_pack_abgr_8888_, component_size) (src, dst, width);
       break;
     case COGL_PIXEL_FORMAT_RGB_565:
-      G_PASTE (_cogl_pack_rgb_565_, component_type) (src, dst, width);
+      G_PASTE (_cogl_pack_rgb_565_, component_size) (src, dst, width);
       break;
     case COGL_PIXEL_FORMAT_RGBA_4444:
     case COGL_PIXEL_FORMAT_RGBA_4444_PRE:
-      G_PASTE (_cogl_pack_rgba_4444_, component_type) (src, dst, width);
+      G_PASTE (_cogl_pack_rgba_4444_, component_size) (src, dst, width);
       break;
     case COGL_PIXEL_FORMAT_RGBA_5551:
     case COGL_PIXEL_FORMAT_RGBA_5551_PRE:
-      G_PASTE (_cogl_pack_rgba_5551_, component_type) (src, dst, width);
+      G_PASTE (_cogl_pack_rgba_5551_, component_size) (src, dst, width);
       break;
     case COGL_PIXEL_FORMAT_RGBA_1010102:
     case COGL_PIXEL_FORMAT_RGBA_1010102_PRE:
-      G_PASTE (_cogl_pack_rgba_1010102_, component_type) (src, dst, width);
+      G_PASTE (_cogl_pack_rgba_1010102_, component_size) (src, dst, width);
       break;
     case COGL_PIXEL_FORMAT_BGRA_1010102:
     case COGL_PIXEL_FORMAT_BGRA_1010102_PRE:
-      G_PASTE (_cogl_pack_bgra_1010102_, component_type) (src, dst, width);
+      G_PASTE (_cogl_pack_bgra_1010102_, component_size) (src, dst, width);
       break;
     case COGL_PIXEL_FORMAT_ARGB_2101010:
     case COGL_PIXEL_FORMAT_ARGB_2101010_PRE:
-      G_PASTE (_cogl_pack_argb_2101010_, component_type) (src, dst, width);
+      G_PASTE (_cogl_pack_argb_2101010_, component_size) (src, dst, width);
       break;
     case COGL_PIXEL_FORMAT_ABGR_2101010:
     case COGL_PIXEL_FORMAT_ABGR_2101010_PRE:
-      G_PASTE (_cogl_pack_abgr_2101010_, component_type) (src, dst, width);
+      G_PASTE (_cogl_pack_abgr_2101010_, component_size) (src, dst, width);
       break;
     case COGL_PIXEL_FORMAT_DEPTH_16:
     case COGL_PIXEL_FORMAT_DEPTH_32:



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]