Use const modifiers for source buffers in nearest scaling fast paths
authorSiarhei Siamashka <siarhei.siamashka@nokia.com>
Mon, 17 Jan 2011 00:29:43 +0000 (02:29 +0200)
committerSiarhei Siamashka <siarhei.siamashka@nokia.com>
Tue, 15 Feb 2011 12:29:54 +0000 (14:29 +0200)
pixman/pixman-arm-common.h
pixman/pixman-fast-path.c
pixman/pixman-fast-path.h

index 372e9f9..525a2c4 100644 (file)
@@ -282,15 +282,15 @@ cputype##_composite_##name (pixman_implementation_t *imp,               \
                                                src_type, dst_type)            \
 void                                                                          \
 pixman_scaled_nearest_scanline_##name##_##op##_asm_##cputype (                \
-                                                       int32_t        w,      \
-                                                       dst_type *     dst,    \
-                                                       src_type *     src,    \
-                                                       pixman_fixed_t vx,     \
-                                                       pixman_fixed_t unit_x);\
+                                                   int32_t          w,        \
+                                                   dst_type *       dst,      \
+                                                   const src_type * src,      \
+                                                   pixman_fixed_t   vx,       \
+                                                   pixman_fixed_t   unit_x);  \
                                                                               \
 static force_inline void                                                      \
 scaled_nearest_scanline_##cputype##_##name##_##op (dst_type *       pd,       \
-                                                   src_type *       ps,       \
+                                                   const src_type * ps,       \
                                                    int32_t          w,        \
                                                    pixman_fixed_t   vx,       \
                                                    pixman_fixed_t   unit_x,   \
index 771ec9d..0cbe375 100644 (file)
@@ -1410,12 +1410,12 @@ FAST_NEAREST (8888_565_normal, 8888, 0565, uint32_t, uint16_t, OVER, NORMAL)
 
 /* Use more unrolling for src_0565_0565 because it is typically CPU bound */
 static force_inline void
-scaled_nearest_scanline_565_565_SRC (uint16_t *      dst,
-                                    uint16_t *      src,
-                                    int32_t         w,
-                                    pixman_fixed_t  vx,
-                                    pixman_fixed_t  unit_x,
-                                    pixman_fixed_t  max_vx)
+scaled_nearest_scanline_565_565_SRC (uint16_t *       dst,
+                                    const uint16_t * src,
+                                    int32_t          w,
+                                    pixman_fixed_t   vx,
+                                    pixman_fixed_t   unit_x,
+                                    pixman_fixed_t   max_vx)
 {
     uint16_t tmp1, tmp2, tmp3, tmp4;
     while ((w -= 4) >= 0)
index 069a282..591ab48 100644 (file)
@@ -138,12 +138,12 @@ pad_repeat_get_scanline_bounds (int32_t         source_image_width,
 #define FAST_NEAREST_SCANLINE(scanline_func_name, SRC_FORMAT, DST_FORMAT,                      \
                              src_type_t, dst_type_t, OP, repeat_mode)                          \
 static force_inline void                                                                       \
-scanline_func_name (dst_type_t     *dst,                                                       \
-                   src_type_t     *src,                                                        \
-                   int32_t         w,                                                          \
-                   pixman_fixed_t  vx,                                                         \
-                   pixman_fixed_t  unit_x,                                                     \
-                   pixman_fixed_t  max_vx)                                                     \
+scanline_func_name (dst_type_t       *dst,                                                     \
+                   const src_type_t *src,                                                      \
+                   int32_t           w,                                                        \
+                   pixman_fixed_t    vx,                                                       \
+                   pixman_fixed_t    unit_x,                                                   \
+                   pixman_fixed_t    max_vx)                                                   \
 {                                                                                              \
        uint32_t   d;                                                                           \
        src_type_t s1, s2;                                                                      \
@@ -346,7 +346,7 @@ fast_composite_scaled_nearest  ## scale_func_name (pixman_implementation_t *imp,
        }                                                                                       \
        else if (PIXMAN_REPEAT_ ## repeat_mode == PIXMAN_REPEAT_NONE)                           \
        {                                                                                       \
-           static src_type_t zero[1] = { 0 };                                                  \
+           static const src_type_t zero[1] = { 0 };                                            \
            if (y < 0 || y >= src_image->bits.height)                                           \
            {                                                                                   \
                scanline_func (dst, zero, left_pad + width + right_pad, 0, 0, 0);               \