Rename FAST_PATH_NO_WIDE_FORMAT to FAST_PATH_NARROW_FORMAT
[profile/ivi/pixman.git] / pixman / pixman-general.c
index fc742c0..fc276bd 100644 (file)
@@ -63,11 +63,11 @@ general_composite_rect  (pixman_implementation_t *imp,
        mask && mask->type == BITS ? mask->bits.format : 0;
     const pixman_format_code_t dest_format =
        dest->type == BITS ? dest->bits.format : 0;
-    const int src_wide = PIXMAN_FORMAT_IS_WIDE (src_format);
-    const int mask_wide = mask && PIXMAN_FORMAT_IS_WIDE (mask_format);
-    const int dest_wide = PIXMAN_FORMAT_IS_WIDE (dest_format);
-    const int wide = src_wide || mask_wide || dest_wide;
-    const int Bpp = wide ? 8 : 4;
+    const int src_narrow = !PIXMAN_FORMAT_IS_WIDE (src_format);
+    const int mask_narrow = !mask || !PIXMAN_FORMAT_IS_WIDE (mask_format);
+    const int dest_narrow = !PIXMAN_FORMAT_IS_WIDE (dest_format);
+    const int narrow = src_narrow && mask_narrow && dest_narrow;
+    const int Bpp = narrow ? 4 : 8;
     uint8_t *scanline_buffer = stack_scanline_buffer;
     uint8_t *src_buffer, *mask_buffer, *dest_buffer;
     fetch_scanline_t fetch_src = NULL, fetch_mask = NULL, fetch_dest = NULL;
@@ -106,29 +106,29 @@ general_composite_rect  (pixman_implementation_t *imp,
 
     if (op == PIXMAN_OP_CLEAR)
        fetch_src = NULL;
-    else if (wide)
-       fetch_src = _pixman_image_get_scanline_64;
-    else
+    else if (narrow)
        fetch_src = _pixman_image_get_scanline_32;
+    else
+       fetch_src = _pixman_image_get_scanline_64;
 
     if (!mask || op == PIXMAN_OP_CLEAR)
        fetch_mask = NULL;
-    else if (wide)
-       fetch_mask = _pixman_image_get_scanline_64;
-    else
+    else if (narrow)
        fetch_mask = _pixman_image_get_scanline_32;
+    else
+       fetch_mask = _pixman_image_get_scanline_64;
 
     if (op == PIXMAN_OP_CLEAR || op == PIXMAN_OP_SRC)
        fetch_dest = NULL;
-    else if (wide)
-       fetch_dest = _pixman_image_get_scanline_64;
-    else
+    else if (narrow)
        fetch_dest = _pixman_image_get_scanline_32;
-
-    if (wide)
-       store = _pixman_image_store_scanline_64;
     else
+       fetch_dest = _pixman_image_get_scanline_64;
+
+    if (narrow)
        store = _pixman_image_store_scanline_32;
+    else
+       store = _pixman_image_store_scanline_64;
 
     /* Skip the store step and composite directly into the
      * destination if the output format of the compose func matches
@@ -148,7 +148,7 @@ general_composite_rect  (pixman_implementation_t *imp,
          op == PIXMAN_OP_OUT_REVERSE   ||
          op == PIXMAN_OP_DST)))
     {
-       if (!wide &&
+       if (narrow &&
            !dest->common.alpha_map &&
            !dest->bits.write_func)
        {
@@ -175,19 +175,19 @@ general_composite_rect  (pixman_implementation_t *imp,
         mask->common.component_alpha    &&
         PIXMAN_FORMAT_RGB (mask->bits.format);
 
-    if (wide)
+    if (narrow)
     {
        if (component_alpha)
-           compose = (pixman_combine_32_func_t)_pixman_implementation_combine_64_ca;
+           compose = _pixman_implementation_combine_32_ca;
        else
-           compose = (pixman_combine_32_func_t)_pixman_implementation_combine_64;
+           compose = _pixman_implementation_combine_32;
     }
     else
     {
        if (component_alpha)
-           compose = _pixman_implementation_combine_32_ca;
+           compose = (pixman_combine_32_func_t)_pixman_implementation_combine_64_ca;
        else
-           compose = _pixman_implementation_combine_32;
+           compose = (pixman_combine_32_func_t)_pixman_implementation_combine_64;
     }
 
     if (!compose)