static force_inline uint32_t
convert_r5g6b5 (const uint8_t *row, int x)
{
- return CONVERT_0565_TO_0888 (*((uint16_t *)row + x));
+ return convert_0565_to_0888 (*((uint16_t *)row + x));
}
#define MAKE_SEPARABLE_CONVOLUTION_FETCHER(name, format, repeat_mode) \
else
{
d = *dst;
- d = over (src, CONVERT_0565_TO_0888 (d));
+ d = over (src, convert_0565_to_0888 (d));
}
- *dst = CONVERT_8888_TO_0565 (d);
+ *dst = convert_8888_to_0565 (d);
}
else if (m)
{
d = *dst;
- d = over (in (src, m), CONVERT_0565_TO_0888 (d));
- *dst = CONVERT_8888_TO_0565 (d);
+ d = over (in (src, m), convert_0565_to_0888 (d));
+ *dst = convert_8888_to_0565 (d);
}
dst++;
}
if (src == 0)
return;
- src16 = CONVERT_8888_TO_0565 (src);
+ src16 = convert_8888_to_0565 (src);
PIXMAN_IMAGE_GET_LINE (dest_image, dest_x, dest_y, uint16_t, dst_stride, dst_line, 1);
PIXMAN_IMAGE_GET_LINE (mask_image, mask_x, mask_y, uint32_t, mask_stride, mask_line, 1);
else
{
d = *dst;
- d = over (src, CONVERT_0565_TO_0888 (d));
- *dst = CONVERT_8888_TO_0565 (d);
+ d = over (src, convert_0565_to_0888 (d));
+ *dst = convert_8888_to_0565 (d);
}
}
else if (ma)
{
d = *dst;
- d = CONVERT_0565_TO_0888 (d);
+ d = convert_0565_to_0888 (d);
s = src;
ma = ~ma;
UN8x4_MUL_UN8x4_ADD_UN8x4 (d, ma, s);
- *dst = CONVERT_8888_TO_0565 (d);
+ *dst = convert_8888_to_0565 (d);
}
dst++;
}
else
{
d = *dst;
- d = over (s, CONVERT_0565_TO_0888 (d));
+ d = over (s, convert_0565_to_0888 (d));
}
- *dst = CONVERT_8888_TO_0565 (d);
+ *dst = convert_8888_to_0565 (d);
}
dst++;
}
while (w--)
{
s = *src++;
- *dst = CONVERT_8888_TO_0565 (s);
+ *dst = convert_8888_to_0565 (s);
dst++;
}
}
if (s)
{
d = *dst;
- s = CONVERT_0565_TO_8888 (s);
+ s = convert_0565_to_8888 (s);
if (d)
{
- d = CONVERT_0565_TO_8888 (d);
+ d = convert_0565_to_8888 (d);
UN8x4_ADD_UN8x4 (s, d);
}
- *dst = CONVERT_8888_TO_0565 (s);
+ *dst = convert_8888_to_0565 (s);
}
dst++;
}
if (srca == 0xff)
{
- src565 = CONVERT_8888_TO_0565 (src);
+ src565 = convert_8888_to_0565 (src);
while (height--)
{
dst = dst_line;
}
if (bitcache & bitmask)
{
- d = over (src, CONVERT_0565_TO_0888 (*dst));
- *dst = CONVERT_8888_TO_0565 (d);
+ d = over (src, convert_0565_to_0888 (*dst));
+ *dst = convert_8888_to_0565 (d);
}
bitmask = UPDATE_BITMASK (bitmask);
dst++;
else if (dest_image->bits.format == PIXMAN_r5g6b5 ||
dest_image->bits.format == PIXMAN_b5g6r5)
{
- src = CONVERT_8888_TO_0565 (src);
+ src = convert_8888_to_0565 (src);
}
pixman_fill (dest_image->bits.bits, dest_image->bits.rowstride,
\
if (a1 == 0xff) \
{ \
- *dst = CONVERT_ ## SRC_FORMAT ## _TO_ ## DST_FORMAT (s1); \
+ *dst = convert_ ## SRC_FORMAT ## _to_ ## DST_FORMAT (s1); \
} \
else if (s1) \
{ \
- d = CONVERT_ ## DST_FORMAT ## _TO_8888 (*dst); \
- s1 = CONVERT_ ## SRC_FORMAT ## _TO_8888 (s1); \
+ d = convert_ ## DST_FORMAT ## _to_8888 (*dst); \
+ s1 = convert_ ## SRC_FORMAT ## _to_8888 (s1); \
a1 ^= 0xff; \
UN8x4_MUL_UN8_ADD_UN8x4 (d, a1, s1); \
- *dst = CONVERT_8888_TO_ ## DST_FORMAT (d); \
+ *dst = convert_8888_to_ ## DST_FORMAT (d); \
} \
dst++; \
\
if (a2 == 0xff) \
{ \
- *dst = CONVERT_ ## SRC_FORMAT ## _TO_ ## DST_FORMAT (s2); \
+ *dst = convert_ ## SRC_FORMAT ## _to_ ## DST_FORMAT (s2); \
} \
else if (s2) \
{ \
- d = CONVERT_## DST_FORMAT ## _TO_8888 (*dst); \
- s2 = CONVERT_## SRC_FORMAT ## _TO_8888 (s2); \
+ d = convert_## DST_FORMAT ## _to_8888 (*dst); \
+ s2 = convert_## SRC_FORMAT ## _to_8888 (s2); \
a2 ^= 0xff; \
UN8x4_MUL_UN8_ADD_UN8x4 (d, a2, s2); \
- *dst = CONVERT_8888_TO_ ## DST_FORMAT (d); \
+ *dst = convert_8888_to_ ## DST_FORMAT (d); \
} \
dst++; \
} \
else /* PIXMAN_OP_SRC */ \
{ \
- *dst++ = CONVERT_ ## SRC_FORMAT ## _TO_ ## DST_FORMAT (s1); \
- *dst++ = CONVERT_ ## SRC_FORMAT ## _TO_ ## DST_FORMAT (s2); \
+ *dst++ = convert_ ## SRC_FORMAT ## _to_ ## DST_FORMAT (s1); \
+ *dst++ = convert_ ## SRC_FORMAT ## _to_ ## DST_FORMAT (s2); \
} \
} \
\
\
if (a1 == 0xff) \
{ \
- *dst = CONVERT_ ## SRC_FORMAT ## _TO_ ## DST_FORMAT (s1); \
+ *dst = convert_ ## SRC_FORMAT ## _to_ ## DST_FORMAT (s1); \
} \
else if (s1) \
{ \
- d = CONVERT_## DST_FORMAT ## _TO_8888 (*dst); \
- s1 = CONVERT_ ## SRC_FORMAT ## _TO_8888 (s1); \
+ d = convert_## DST_FORMAT ## _to_8888 (*dst); \
+ s1 = convert_ ## SRC_FORMAT ## _to_8888 (s1); \
a1 ^= 0xff; \
UN8x4_MUL_UN8_ADD_UN8x4 (d, a1, s1); \
- *dst = CONVERT_8888_TO_ ## DST_FORMAT (d); \
+ *dst = convert_8888_to_ ## DST_FORMAT (d); \
} \
dst++; \
} \
else /* PIXMAN_OP_SRC */ \
{ \
- *dst++ = CONVERT_ ## SRC_FORMAT ## _TO_ ## DST_FORMAT (s1); \
+ *dst++ = convert_ ## SRC_FORMAT ## _to_ ## DST_FORMAT (s1); \
} \
} \
}
while (w && (uintptr_t)dst & 7)
{
s = *src++;
- *dst = CONVERT_8888_TO_0565 (s);
+ *dst = convert_8888_to_0565 (s);
dst++;
w--;
}
while (w)
{
s = *src++;
- *dst = CONVERT_8888_TO_0565 (s);
+ *dst = convert_8888_to_0565 (s);
dst++;
w--;
}
if (s)
{
d = *dst;
- s = CONVERT_0565_TO_8888 (s);
+ s = convert_0565_to_8888 (s);
if (d)
{
- d = CONVERT_0565_TO_8888 (d);
+ d = convert_0565_to_8888 (d);
UN8x4_ADD_UN8x4 (s, d);
}
- *dst = CONVERT_8888_TO_0565 (s);
+ *dst = convert_8888_to_0565 (s);
}
dst++;
w--;
if (s)
{
d = *dst;
- s = CONVERT_0565_TO_8888 (s);
+ s = convert_0565_to_8888 (s);
if (d)
{
- d = CONVERT_0565_TO_8888 (d);
+ d = convert_0565_to_8888 (d);
UN8x4_ADD_UN8x4 (s, d);
}
- *dst = CONVERT_8888_TO_0565 (s);
+ *dst = convert_8888_to_0565 (s);
}
dst++;
}
{
uint16_t s = *src++;
- *dst++ = CONVERT_0565_TO_8888 (s);
+ *dst++ = convert_0565_to_8888 (s);
w--;
}
{
uint16_t s = *src++;
- *dst++ = CONVERT_0565_TO_8888 (s);
+ *dst++ = convert_0565_to_8888 (s);
w--;
}
/* Conversion between 8888 and 0565 */
-#define CONVERT_8888_TO_0565(s) \
- ((((s) >> 3) & 0x001f) | \
- (((s) >> 5) & 0x07e0) | \
- (((s) >> 8) & 0xf800))
+static force_inline uint16_t
+convert_8888_to_0565 (uint32_t s)
+{
+ return ((((s) >> 3) & 0x001f) |
+ (((s) >> 5) & 0x07e0) |
+ (((s) >> 8) & 0xf800));
+}
-#define CONVERT_0565_TO_0888(s) \
- (((((s) << 3) & 0xf8) | (((s) >> 2) & 0x7)) | \
- ((((s) << 5) & 0xfc00) | (((s) >> 1) & 0x300)) | \
- ((((s) << 8) & 0xf80000) | (((s) << 3) & 0x70000)))
+static force_inline uint32_t
+convert_0565_to_0888 (uint16_t s)
+{
+ return (((((s) << 3) & 0xf8) | (((s) >> 2) & 0x7)) |
+ ((((s) << 5) & 0xfc00) | (((s) >> 1) & 0x300)) |
+ ((((s) << 8) & 0xf80000) | (((s) << 3) & 0x70000)));
+}
-#define CONVERT_0565_TO_8888(s) (CONVERT_0565_TO_0888(s) | 0xff000000)
+static force_inline uint32_t
+convert_0565_to_8888 (uint16_t s)
+{
+ return convert_0565_to_0888 (s) | 0xff000000;
+}
/* Trivial versions that are useful in macros */
-#define CONVERT_8888_TO_8888(s) (s)
-#define CONVERT_x888_TO_8888(s) ((s) | 0xff000000)
-#define CONVERT_0565_TO_0565(s) (s)
+
+static force_inline uint32_t
+convert_8888_to_8888 (uint32_t s)
+{
+ return s;
+}
+
+static force_inline uint32_t
+convert_x888_to_8888 (uint32_t s)
+{
+ return s | 0xff000000;
+}
+
+static force_inline uint16_t
+convert_0565_to_0565 (uint16_t s)
+{
+ return s;
+}
#define PIXMAN_FORMAT_IS_WIDE(f) \
(PIXMAN_FORMAT_A (f) > 8 || \
while (w && (uintptr_t)dst & 15)
{
s = *src++;
- *dst = CONVERT_8888_TO_0565 (s);
+ *dst = convert_8888_to_0565 (s);
dst++;
w--;
}
while (w)
{
s = *src++;
- *dst = CONVERT_8888_TO_0565 (s);
+ *dst = convert_8888_to_0565 (s);
dst++;
w--;
}
{
uint16_t s = *src++;
- *dst++ = CONVERT_0565_TO_8888 (s);
+ *dst++ = convert_0565_to_8888 (s);
w--;
}
{
uint16_t s = *src++;
- *dst++ = CONVERT_0565_TO_8888 (s);
+ *dst++ = convert_0565_to_8888 (s);
w--;
}
c = c >> 24;
else if (format == PIXMAN_r5g6b5 ||
format == PIXMAN_b5g6r5)
- c = CONVERT_8888_TO_0565 (c);
+ c = convert_8888_to_0565 (c);
#if 0
printf ("color: %x %x %x %x\n", color->alpha, color->red, color->green, color->blue);