Introduce a fake PIXMAN_REPEAT_COVER constant
authorSiarhei Siamashka <siarhei.siamashka@nokia.com>
Fri, 17 Sep 2010 13:22:25 +0000 (16:22 +0300)
committerSiarhei Siamashka <siarhei.siamashka@nokia.com>
Tue, 21 Sep 2010 10:30:59 +0000 (13:30 +0300)
We need to implement a true PIXMAN_REPEAT_NONE support later (padding
the source with zero pixels). So it's better not to use PIXMAN_REPEAT_NONE
for handling FAST_PATH_SAMPLES_COVER_CLIP special case.

pixman/pixman-fast-path.c
pixman/pixman-fast-path.h

index 12036a9..c060749 100644 (file)
@@ -1387,15 +1387,15 @@ fast_composite_src_memcpy (pixman_implementation_t *imp,
     }
 }
 
-FAST_NEAREST (8888_8888_none, 8888, 8888, uint32_t, uint32_t, SRC, NONE);
+FAST_NEAREST (8888_8888_cover, 8888, 8888, uint32_t, uint32_t, SRC, COVER);
 FAST_NEAREST (8888_8888_normal, 8888, 8888, uint32_t, uint32_t, SRC, NORMAL);
-FAST_NEAREST (8888_8888_none, 8888, 8888, uint32_t, uint32_t, OVER, NONE);
+FAST_NEAREST (8888_8888_cover, 8888, 8888, uint32_t, uint32_t, OVER, COVER);
 FAST_NEAREST (8888_8888_normal, 8888, 8888, uint32_t, uint32_t, OVER, NORMAL);
-FAST_NEAREST (8888_565_none, 8888, 0565, uint32_t, uint16_t, SRC, NONE);
+FAST_NEAREST (8888_565_cover, 8888, 0565, uint32_t, uint16_t, SRC, COVER);
 FAST_NEAREST (8888_565_normal, 8888, 0565, uint32_t, uint16_t, SRC, NORMAL);
-FAST_NEAREST (565_565_none, 0565, 0565, uint16_t, uint16_t, SRC, NONE);
+FAST_NEAREST (565_565_cover, 0565, 0565, uint16_t, uint16_t, SRC, COVER);
 FAST_NEAREST (565_565_normal, 0565, 0565, uint16_t, uint16_t, SRC, NORMAL);
-FAST_NEAREST (8888_565_none, 8888, 0565, uint32_t, uint16_t, OVER, NONE);
+FAST_NEAREST (8888_565_cover, 8888, 0565, uint32_t, uint16_t, OVER, COVER);
 FAST_NEAREST (8888_565_normal, 8888, 0565, uint32_t, uint16_t, OVER, NORMAL);
 
 static force_inline uint32_t
index 7babd66..287b753 100644 (file)
@@ -28,6 +28,8 @@
 
 #include "pixman-private.h"
 
+#define PIXMAN_REPEAT_COVER -1
+
 static force_inline pixman_bool_t
 repeat (pixman_repeat_t repeat, int *c, int size)
 {
@@ -216,12 +218,6 @@ fast_composite_scaled_nearest_ ## scale_func_name (pixman_implementation_t *imp,
     dst_type_t *dst;                                                                           \
     int       src_stride, dst_stride;                                                          \
                                                                                                \
-    if (PIXMAN_REPEAT_ ## repeat_mode != PIXMAN_REPEAT_NORMAL          &&                      \
-       PIXMAN_REPEAT_ ## repeat_mode != PIXMAN_REPEAT_NONE)                                    \
-    {                                                                                          \
-       abort();                                                                                \
-    }                                                                                          \
-                                                                                               \
     PIXMAN_IMAGE_GET_LINE (dst_image, dst_x, dst_y, dst_type_t, dst_stride, dst_line, 1);      \
     /* pass in 0 instead of src_x and src_y because src_x and src_y need to be                 \
      * transformed from destination space to source space */                                   \
@@ -305,7 +301,7 @@ fast_composite_scaled_nearest_ ## scale_func_name (pixman_implementation_t *imp,
        SCALED_NEAREST_FLAGS | FAST_PATH_SAMPLES_COVER_CLIP,            \
        PIXMAN_null, 0,                                                 \
        PIXMAN_ ## d, FAST_PATH_STD_DEST_FLAGS,                         \
-       fast_composite_scaled_nearest_ ## func ## _none ## _ ## op,     \
+       fast_composite_scaled_nearest_ ## func ## _cover ## _ ## op,    \
     }
 
 /* Prefer the use of 'cover' variant, because it is faster */