forked from enlightenment/efl
From: Sanghee Park <sh15.park@samsung.com>
Subject: Drawing objects by pixman * Extend pixman support to allow other operations to use pixman when doing software rendering. On x86 this isn't useful but on ARMv7 with NEON pixman happens to do better with image blending and nearest scale blending. * Add tiled rotator for 32bit display as an option. SVN revision: 66478
This commit is contained in:
parent
bd24931df1
commit
550b8417c7
|
@ -584,3 +584,11 @@
|
||||||
* Fix bug in ico loader that causes crashes (eina_file_close
|
* Fix bug in ico loader that causes crashes (eina_file_close
|
||||||
bug and mis-read of uchar into int).
|
bug and mis-read of uchar into int).
|
||||||
|
|
||||||
|
2011-12-23 Sanghee Park
|
||||||
|
|
||||||
|
* Extend pixman support to allow other operations to use
|
||||||
|
pixman when doing software rendering. On x86 this isn't useful
|
||||||
|
but on ARMv7 with NEON pixman happens to do better with image
|
||||||
|
blending and nearest scale blending.
|
||||||
|
* Add tiled rotator for 32bit display as an option.
|
||||||
|
|
||||||
|
|
|
@ -404,8 +404,8 @@ fi
|
||||||
# Pixman
|
# Pixman
|
||||||
have_pixman="no"
|
have_pixman="no"
|
||||||
AC_ARG_ENABLE([pixman],
|
AC_ARG_ENABLE([pixman],
|
||||||
AC_HELP_STRING([--disable-pixman],
|
AC_HELP_STRING([--enable-pixman],
|
||||||
[disable pixman for software rendering. @<:@default=enabled@:>@]),
|
[enable pixman for software rendering. @<:@default=enabled@:>@]),
|
||||||
[
|
[
|
||||||
if test "x${enableval}" = "xyes" ; then
|
if test "x${enableval}" = "xyes" ; then
|
||||||
want_pixman="yes"
|
want_pixman="yes"
|
||||||
|
@ -430,6 +430,69 @@ if test "x${want_pixman}" = "xyes" -o "x${want_pixman}" = "xauto" ; then
|
||||||
])
|
])
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
have_pixman_font="no"
|
||||||
|
AC_ARG_ENABLE(pixman-font,
|
||||||
|
AC_HELP_STRING([--enable-pixman-font], [Allow pixman to render fonts]),
|
||||||
|
[
|
||||||
|
have_pixman_font="yes"
|
||||||
|
AC_DEFINE(PIXMAN_FONT, 1, [Allow pixman to render fonts])
|
||||||
|
]
|
||||||
|
)
|
||||||
|
|
||||||
|
have_pixman_rect="no"
|
||||||
|
AC_ARG_ENABLE(pixman-rect,
|
||||||
|
AC_HELP_STRING([--enable-pixman-rect], [Allow pixman to render rects]),
|
||||||
|
[
|
||||||
|
have_pixman_rect="yes"
|
||||||
|
AC_DEFINE(PIXMAN_RECT, 1, [Allow pixman to render rects])
|
||||||
|
]
|
||||||
|
)
|
||||||
|
|
||||||
|
have_pixman_line="no"
|
||||||
|
AC_ARG_ENABLE(pixman-line,
|
||||||
|
AC_HELP_STRING([--enable-pixman-line], [Allow pixman to render lines]),
|
||||||
|
[
|
||||||
|
have_pixman_line="yes"
|
||||||
|
AC_DEFINE(PIXMAN_LINE, 1, [Allow pixman to render lines])
|
||||||
|
]
|
||||||
|
)
|
||||||
|
|
||||||
|
have_pixman_poly="no"
|
||||||
|
AC_ARG_ENABLE(pixman-poly,
|
||||||
|
AC_HELP_STRING([--enable-pixman-poly], [Allow pixman to render polys]),
|
||||||
|
[
|
||||||
|
have_pixman_poly="yes"
|
||||||
|
AC_DEFINE(PIXMAN_POLY, 1, [Allow pixman to render polys])
|
||||||
|
]
|
||||||
|
)
|
||||||
|
|
||||||
|
have_pixman_image="no"
|
||||||
|
AC_ARG_ENABLE(pixman-image,
|
||||||
|
AC_HELP_STRING([--enable-pixman-image], [Allow pixman to render images]),
|
||||||
|
[
|
||||||
|
have_pixman_image="yes"
|
||||||
|
AC_DEFINE(PIXMAN_IMAGE, 1, [Allow pixman to render images])
|
||||||
|
]
|
||||||
|
)
|
||||||
|
|
||||||
|
have_pixman_image_scale_sample="no"
|
||||||
|
AC_ARG_ENABLE(pixman-image-scale-sample,
|
||||||
|
AC_HELP_STRING([--enable-pixman-image-scale-sample], [Allow pixman to render sampled scaled images]),
|
||||||
|
[
|
||||||
|
have_pixman_image_scale_sample="yes"
|
||||||
|
AC_DEFINE(PIXMAN_IMAGE_SCALE_SAMPLE, 1, [Allow pixman to render image sampled scaling])
|
||||||
|
]
|
||||||
|
)
|
||||||
|
|
||||||
|
have_tile_rotate="no"
|
||||||
|
AC_ARG_ENABLE(tile-rotate,
|
||||||
|
AC_HELP_STRING([--enable-tile-rotate], [Enable tiled rotate algorithm]),
|
||||||
|
[
|
||||||
|
have_tile_rotate="yes"
|
||||||
|
AC_DEFINE(TILE_ROTATE, 1, [Enable tiled rotate algorithm])
|
||||||
|
]
|
||||||
|
)
|
||||||
|
|
||||||
### Checks for header files
|
### Checks for header files
|
||||||
AC_HEADER_STDC
|
AC_HEADER_STDC
|
||||||
AC_CHECK_HEADERS([unistd.h stdint.h sys/param.h netinet/in.h sys/mman.h])
|
AC_CHECK_HEADERS([unistd.h stdint.h sys/param.h netinet/in.h sys/mman.h])
|
||||||
|
@ -2023,6 +2086,16 @@ echo
|
||||||
echo " Word Cache..............: $want_word_cache"
|
echo " Word Cache..............: $want_word_cache"
|
||||||
echo " Metric Cache............: $want_metric_cache"
|
echo " Metric Cache............: $want_metric_cache"
|
||||||
echo
|
echo
|
||||||
|
echo " Pixman..................: $have_pixman"
|
||||||
|
echo " Pixman Fonts............: $have_pixman_font"
|
||||||
|
echo " Pixman Rects............: $have_pixman_rect"
|
||||||
|
echo " Pixman Lines............: $have_pixman_line"
|
||||||
|
echo " Pixman Polygons.........: $have_pixman_poly"
|
||||||
|
echo " Pixman Images...........: $have_pixman_image"
|
||||||
|
echo " Pixman Image ScaleSample: $have_pixman_image_scale_sample"
|
||||||
|
echo
|
||||||
|
echo " Tiled 32BPP rotate......: $have_tile_rotate"
|
||||||
|
echo
|
||||||
echo "ARGB Software Engine Options:"
|
echo "ARGB Software Engine Options:"
|
||||||
echo " Sampling Scaler.........: $scaler_sample"
|
echo " Sampling Scaler.........: $scaler_sample"
|
||||||
echo " Smooth Scaler...........: $scaler_smooth"
|
echo " Smooth Scaler...........: $scaler_smooth"
|
||||||
|
|
|
@ -48,15 +48,167 @@ evas_common_convert_rgba_to_32bpp_rgb_8888_rot_180 (DATA32 *src, DATA8 *dst, int
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef TILE_ROTATE
|
||||||
|
#define FAST_SIMPLE_ROTATE(suffix, pix_type) \
|
||||||
|
static void \
|
||||||
|
blt_rotated_90_trivial_##suffix(pix_type *dst, \
|
||||||
|
int dst_stride, \
|
||||||
|
const pix_type *src, \
|
||||||
|
int src_stride, \
|
||||||
|
int w, \
|
||||||
|
int h) \
|
||||||
|
{ \
|
||||||
|
int x, y; \
|
||||||
|
for (y = 0; y < h; y++) \
|
||||||
|
{ \
|
||||||
|
const pix_type *s = src + (h - y - 1); \
|
||||||
|
pix_type *d = dst + (dst_stride * y); \
|
||||||
|
for (x = 0; x < w; x++) \
|
||||||
|
{ \
|
||||||
|
*d++ = *s; \
|
||||||
|
s += src_stride; \
|
||||||
|
} \
|
||||||
|
} \
|
||||||
|
} \
|
||||||
|
static void \
|
||||||
|
blt_rotated_270_trivial_##suffix(pix_type *dst, \
|
||||||
|
int dst_stride, \
|
||||||
|
const pix_type *src, \
|
||||||
|
int src_stride, \
|
||||||
|
int w, \
|
||||||
|
int h) \
|
||||||
|
{ \
|
||||||
|
int x, y; \
|
||||||
|
for (y = 0; y < h; y++) \
|
||||||
|
{ \
|
||||||
|
const pix_type *s = src + (src_stride * (w - 1)) + y; \
|
||||||
|
pix_type *d = dst + (dst_stride * y); \
|
||||||
|
for (x = 0; x < w; x++) \
|
||||||
|
{ \
|
||||||
|
*d++ = *s; \
|
||||||
|
s -= src_stride; \
|
||||||
|
} \
|
||||||
|
} \
|
||||||
|
} \
|
||||||
|
static void \
|
||||||
|
blt_rotated_90_##suffix(pix_type *dst, \
|
||||||
|
int dst_stride, \
|
||||||
|
const pix_type *src, \
|
||||||
|
int src_stride, \
|
||||||
|
int w, \
|
||||||
|
int h) \
|
||||||
|
{ \
|
||||||
|
int x, leading_pixels = 0, trailing_pixels = 0; \
|
||||||
|
const int TILE_SIZE = TILE_CACHE_LINE_SIZE / sizeof(pix_type); \
|
||||||
|
if ((uintptr_t)dst & (TILE_CACHE_LINE_SIZE - 1)) \
|
||||||
|
{ \
|
||||||
|
leading_pixels = TILE_SIZE - \
|
||||||
|
(((uintptr_t)dst & (TILE_CACHE_LINE_SIZE - 1)) / sizeof(pix_type)); \
|
||||||
|
if (leading_pixels > w) \
|
||||||
|
leading_pixels = w; \
|
||||||
|
blt_rotated_90_trivial_##suffix(dst, \
|
||||||
|
dst_stride, \
|
||||||
|
src, \
|
||||||
|
src_stride, \
|
||||||
|
leading_pixels, \
|
||||||
|
h); \
|
||||||
|
dst += leading_pixels; \
|
||||||
|
src += leading_pixels * src_stride; \
|
||||||
|
w -= leading_pixels; \
|
||||||
|
} \
|
||||||
|
if ((uintptr_t)(dst + w) & (TILE_CACHE_LINE_SIZE - 1)) \
|
||||||
|
{ \
|
||||||
|
trailing_pixels = (((uintptr_t)(dst + w) & \
|
||||||
|
(TILE_CACHE_LINE_SIZE - 1)) / sizeof(pix_type)); \
|
||||||
|
if (trailing_pixels > w) \
|
||||||
|
trailing_pixels = w; \
|
||||||
|
w -= trailing_pixels; \
|
||||||
|
} \
|
||||||
|
for (x = 0; x < w; x += TILE_SIZE) \
|
||||||
|
{ \
|
||||||
|
blt_rotated_90_trivial_##suffix(dst + x, \
|
||||||
|
dst_stride, \
|
||||||
|
src + (src_stride * x), \
|
||||||
|
src_stride, \
|
||||||
|
TILE_SIZE, \
|
||||||
|
h); \
|
||||||
|
} \
|
||||||
|
if (trailing_pixels) \
|
||||||
|
blt_rotated_90_trivial_##suffix(dst + w, \
|
||||||
|
dst_stride, \
|
||||||
|
src + (w * src_stride), \
|
||||||
|
src_stride, \
|
||||||
|
trailing_pixels, \
|
||||||
|
h); \
|
||||||
|
} \
|
||||||
|
static void \
|
||||||
|
blt_rotated_270_##suffix(pix_type *dst, \
|
||||||
|
int dst_stride, \
|
||||||
|
const pix_type *src, \
|
||||||
|
int src_stride, \
|
||||||
|
int w, \
|
||||||
|
int h) \
|
||||||
|
{ \
|
||||||
|
int x, leading_pixels = 0, trailing_pixels = 0; \
|
||||||
|
const int TILE_SIZE = TILE_CACHE_LINE_SIZE / sizeof(pix_type); \
|
||||||
|
if ((uintptr_t)dst & (TILE_CACHE_LINE_SIZE - 1)) \
|
||||||
|
{ \
|
||||||
|
leading_pixels = TILE_SIZE - \
|
||||||
|
(((uintptr_t)dst & (TILE_CACHE_LINE_SIZE - 1)) / sizeof(pix_type)); \
|
||||||
|
if (leading_pixels > w) \
|
||||||
|
leading_pixels = w; \
|
||||||
|
blt_rotated_270_trivial_##suffix(dst, \
|
||||||
|
dst_stride, \
|
||||||
|
src + (src_stride * (w - leading_pixels)), \
|
||||||
|
src_stride, \
|
||||||
|
leading_pixels, \
|
||||||
|
h); \
|
||||||
|
dst += leading_pixels; \
|
||||||
|
w -= leading_pixels; \
|
||||||
|
} \
|
||||||
|
if ((uintptr_t)(dst + w) & (TILE_CACHE_LINE_SIZE - 1)) \
|
||||||
|
{ \
|
||||||
|
trailing_pixels = (((uintptr_t)(dst + w) & \
|
||||||
|
(TILE_CACHE_LINE_SIZE - 1)) / sizeof(pix_type)); \
|
||||||
|
if (trailing_pixels > w) \
|
||||||
|
trailing_pixels = w; \
|
||||||
|
w -= trailing_pixels; \
|
||||||
|
src += trailing_pixels * src_stride; \
|
||||||
|
} \
|
||||||
|
for (x = 0; x < w; x += TILE_SIZE) \
|
||||||
|
{ \
|
||||||
|
blt_rotated_270_trivial_##suffix(dst + x, \
|
||||||
|
dst_stride, \
|
||||||
|
src + (src_stride * (w - x - TILE_SIZE)), \
|
||||||
|
src_stride, \
|
||||||
|
TILE_SIZE, \
|
||||||
|
h); \
|
||||||
|
} \
|
||||||
|
if (trailing_pixels) \
|
||||||
|
blt_rotated_270_trivial_##suffix(dst + w, \
|
||||||
|
dst_stride, \
|
||||||
|
src - (trailing_pixels * src_stride), \
|
||||||
|
src_stride, \
|
||||||
|
trailing_pixels, \
|
||||||
|
h); \
|
||||||
|
}
|
||||||
|
|
||||||
|
FAST_SIMPLE_ROTATE(8888, DATA8)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#ifdef BUILD_CONVERT_32_RGB_8888
|
#ifdef BUILD_CONVERT_32_RGB_8888
|
||||||
#ifdef BUILD_CONVERT_32_RGB_ROT270
|
#ifdef BUILD_CONVERT_32_RGB_ROT270
|
||||||
void
|
void
|
||||||
evas_common_convert_rgba_to_32bpp_rgb_8888_rot_270 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x __UNUSED__, int dith_y __UNUSED__, DATA8 *pal __UNUSED__)
|
evas_common_convert_rgba_to_32bpp_rgb_8888_rot_270 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x __UNUSED__, int dith_y __UNUSED__, DATA8 *pal __UNUSED__)
|
||||||
{
|
{
|
||||||
|
#ifdef TILE_ROTATE
|
||||||
|
blt_rotated_270_8888((DATA8 *)dst, dst_jump+w, (const DATA8 *)src, src_jump+h, w, h) ;
|
||||||
|
#else
|
||||||
DATA32 *src_ptr;
|
DATA32 *src_ptr;
|
||||||
DATA32 *dst_ptr;
|
DATA32 *dst_ptr;
|
||||||
int x, y;
|
int x, y;
|
||||||
|
|
||||||
dst_ptr = (DATA32 *)dst;
|
dst_ptr = (DATA32 *)dst;
|
||||||
|
|
||||||
CONVERT_LOOP_START_ROT_270();
|
CONVERT_LOOP_START_ROT_270();
|
||||||
|
@ -64,6 +216,7 @@ evas_common_convert_rgba_to_32bpp_rgb_8888_rot_270 (DATA32 *src, DATA8 *dst, int
|
||||||
*dst_ptr = *src_ptr;
|
*dst_ptr = *src_ptr;
|
||||||
|
|
||||||
CONVERT_LOOP_END_ROT_270();
|
CONVERT_LOOP_END_ROT_270();
|
||||||
|
#endif
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -74,106 +227,118 @@ evas_common_convert_rgba_to_32bpp_rgb_8888_rot_270 (DATA32 *src, DATA8 *dst, int
|
||||||
void
|
void
|
||||||
evas_common_convert_rgba_to_32bpp_rgb_8888_rot_90 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x __UNUSED__, int dith_y __UNUSED__, DATA8 *pal __UNUSED__)
|
evas_common_convert_rgba_to_32bpp_rgb_8888_rot_90 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x __UNUSED__, int dith_y __UNUSED__, DATA8 *pal __UNUSED__)
|
||||||
{
|
{
|
||||||
#ifndef BUILD_NEON
|
# ifndef BUILD_NEON
|
||||||
|
# ifdef TILE_ROTATE
|
||||||
|
blt_rotated_90_8888((DATA8 *)dst, dst_jump+w, (const DATA8 *)src, src_jump+h, w, h) ;
|
||||||
|
# else
|
||||||
DATA32 *src_ptr;
|
DATA32 *src_ptr;
|
||||||
DATA32 *dst_ptr;
|
DATA32 *dst_ptr;
|
||||||
int x, y;
|
int x, y;
|
||||||
|
|
||||||
dst_ptr = (DATA32 *)dst;
|
dst_ptr = (DATA32 *)dst;
|
||||||
CONVERT_LOOP_START_ROT_90();
|
CONVERT_LOOP_START_ROT_90();
|
||||||
|
|
||||||
*dst_ptr = *src_ptr;
|
*dst_ptr = *src_ptr;
|
||||||
|
|
||||||
CONVERT_LOOP_END_ROT_90();
|
CONVERT_LOOP_END_ROT_90();
|
||||||
#else
|
# endif
|
||||||
|
|
||||||
|
# else
|
||||||
|
|
||||||
|
# ifdef TILE_ROTATE
|
||||||
|
blt_rotated_90_8888((DATA8 *)dst, dst_jump+w, (const DATA8 *)src, src_jump+h, w, h) ;
|
||||||
|
# else
|
||||||
if ((w & 1) || (h & 1))
|
if ((w & 1) || (h & 1))
|
||||||
{
|
{
|
||||||
/* Rarely (if ever) if ever: so slow path is fine */
|
/* Rarely (if ever) if ever: so slow path is fine */
|
||||||
DATA32 *src_ptr;
|
DATA32 *src_ptr;
|
||||||
DATA32 *dst_ptr;
|
DATA32 *dst_ptr;
|
||||||
int x, y;
|
int x, y;
|
||||||
|
|
||||||
dst_ptr = (DATA32 *)dst;
|
dst_ptr = (DATA32 *)dst;
|
||||||
CONVERT_LOOP_START_ROT_90();
|
CONVERT_LOOP_START_ROT_90();
|
||||||
|
|
||||||
*dst_ptr = *src_ptr;
|
*dst_ptr = *src_ptr;
|
||||||
|
|
||||||
CONVERT_LOOP_END_ROT_90();
|
CONVERT_LOOP_END_ROT_90();
|
||||||
} else {
|
}
|
||||||
#define AP "convert_rgba32_rot_90_"
|
else
|
||||||
asm volatile (
|
{
|
||||||
".fpu neon \n\t"
|
# define AP "convert_rgba32_rot_90_"
|
||||||
" mov %[s1], %[src] \n\t"
|
asm volatile (
|
||||||
" add %[s1], %[s1], %[h],lsl #2 \n\t"
|
".fpu neon \n\t"
|
||||||
" sub %[s1], #8 \n\t"
|
" mov %[s1], %[src] \n\t"
|
||||||
|
" add %[s1], %[s1], %[h],lsl #2 \n\t"
|
||||||
|
" sub %[s1], #8 \n\t"
|
||||||
|
|
||||||
" mov %[s2], %[src] \n\t"
|
" mov %[s2], %[src] \n\t"
|
||||||
" add %[s2], %[s2], %[h], lsl #3 \n\t"
|
" add %[s2], %[s2], %[h], lsl #3 \n\t"
|
||||||
" add %[s2], %[s2], %[sjmp], lsr #1 \n\t"
|
" add %[s2], %[s2], %[sjmp], lsr #1 \n\t"
|
||||||
" sub %[s2], #8 \n\t"
|
" sub %[s2], #8 \n\t"
|
||||||
|
|
||||||
" mov %[d1], %[dst] \n\t"
|
" mov %[d1], %[dst] \n\t"
|
||||||
|
|
||||||
" add %[d2], %[d1], %[djmp] \n\t"
|
" add %[d2], %[d1], %[djmp] \n\t"
|
||||||
" add %[d2], %[d2], %[w], lsl #2 \n\t"
|
" add %[d2], %[d2], %[w], lsl #2 \n\t"
|
||||||
|
|
||||||
" mov %[sadv], %[h], lsl #3 \n\t"
|
" mov %[sadv], %[h], lsl #3 \n\t"
|
||||||
" add %[sadv], %[sadv], %[sjmp], lsl #1\n\t"
|
" add %[sadv], %[sadv], %[sjmp], lsl #1\n\t"
|
||||||
|
|
||||||
" mov %[y], #0 \n\t"
|
" mov %[y], #0 \n\t"
|
||||||
" mov %[x], #0 \n\t"
|
" mov %[x], #0 \n\t"
|
||||||
AP"loop: \n\t"
|
AP"loop: \n\t"
|
||||||
" vld1.u32 d0, [%[s1]] \n\t"
|
" vld1.u32 d0, [%[s1]] \n\t"
|
||||||
" vld1.u32 d1, [%[s2]] \n\t"
|
" vld1.u32 d1, [%[s2]] \n\t"
|
||||||
" add %[x], #2 \n\t"
|
" add %[x], #2 \n\t"
|
||||||
" add %[s1], %[sadv] \n\t"
|
" add %[s1], %[sadv] \n\t"
|
||||||
" add %[s2], %[sadv] \n\t"
|
" add %[s2], %[sadv] \n\t"
|
||||||
" vtrn.u32 d0, d1 \n\t"
|
" vtrn.u32 d0, d1 \n\t"
|
||||||
" cmp %[x], %[w] \n\t"
|
" cmp %[x], %[w] \n\t"
|
||||||
" vst1.u32 d1, [%[d1]]! \n\t"
|
" vst1.u32 d1, [%[d1]]! \n\t"
|
||||||
" vst1.u32 d0, [%[d2]]! \n\t"
|
" vst1.u32 d0, [%[d2]]! \n\t"
|
||||||
" blt "AP"loop \n\t"
|
" blt "AP"loop \n\t"
|
||||||
|
|
||||||
" mov %[x], #0 \n\t"
|
" mov %[x], #0 \n\t"
|
||||||
" add %[d1], %[djmp] \n\t"
|
" add %[d1], %[djmp] \n\t"
|
||||||
" add %[d1], %[d1], %[w], lsl #2 \n\t"
|
" add %[d1], %[d1], %[w], lsl #2 \n\t"
|
||||||
" add %[d2], %[djmp] \n\t"
|
" add %[d2], %[djmp] \n\t"
|
||||||
" add %[d2], %[d2], %[w], lsl #2 \n\t"
|
" add %[d2], %[d2], %[w], lsl #2 \n\t"
|
||||||
|
|
||||||
" mov %[s1], %[src] \n\t"
|
" mov %[s1], %[src] \n\t"
|
||||||
" add %[s1], %[s1], %[h], lsl #2 \n\t"
|
" add %[s1], %[s1], %[h], lsl #2 \n\t"
|
||||||
" sub %[s1], %[s1], %[y], lsl #2 \n\t"
|
" sub %[s1], %[s1], %[y], lsl #2 \n\t"
|
||||||
" sub %[s1], #16 \n\t"
|
" sub %[s1], #16 \n\t"
|
||||||
|
|
||||||
" add %[s2], %[s1], %[h], lsl #2 \n\t"
|
" add %[s2], %[s1], %[h], lsl #2 \n\t"
|
||||||
" add %[s2], %[s2], %[sjmp], lsl #2 \n\t"
|
" add %[s2], %[s2], %[sjmp], lsl #2 \n\t"
|
||||||
|
|
||||||
" add %[y], #2 \n\t"
|
" add %[y], #2 \n\t"
|
||||||
|
|
||||||
" cmp %[y], %[h] \n\t"
|
" cmp %[y], %[h] \n\t"
|
||||||
" blt "AP"loop \n\t"
|
" blt "AP"loop \n\t"
|
||||||
|
|
||||||
: // Out
|
: // Out
|
||||||
: [s1] "r" (1),
|
: [s1] "r" (1),
|
||||||
[s2] "r" (11),
|
[s2] "r" (11),
|
||||||
[d1] "r" (2),
|
[d1] "r" (2),
|
||||||
[d2] "r" (12),
|
[d2] "r" (12),
|
||||||
[src] "r" (src),
|
[src] "r" (src),
|
||||||
[dst] "r" (dst),
|
[dst] "r" (dst),
|
||||||
[x] "r" (3),
|
[x] "r" (3),
|
||||||
[y] "r" (4),
|
[y] "r" (4),
|
||||||
[w] "r" (w),
|
[w] "r" (w),
|
||||||
[h] "r" (h),
|
[h] "r" (h),
|
||||||
[sadv] "r" (5),
|
[sadv] "r" (5),
|
||||||
[sjmp] "r" (src_jump * 4),
|
[sjmp] "r" (src_jump * 4),
|
||||||
[djmp] "r" (dst_jump * 4 * 2)
|
[djmp] "r" (dst_jump * 4 * 2)
|
||||||
: "d0", "d1", "memory", "cc"// Clober
|
: "d0", "d1", "memory", "cc"// Clober
|
||||||
|
|
||||||
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
#undef AP
|
# undef AP
|
||||||
#endif
|
# endif
|
||||||
|
# endif
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -448,7 +613,7 @@ evas_common_convert_rgba_to_32bpp_rgb_666(DATA32 *src, DATA8 *dst, int src_jump,
|
||||||
|
|
||||||
CONVERT_LOOP_START_ROT_0();
|
CONVERT_LOOP_START_ROT_0();
|
||||||
|
|
||||||
*dst_ptr =
|
*dst_ptr =
|
||||||
(((R_VAL(src_ptr) << 12) | (B_VAL(src_ptr) >> 2)) & 0x03f03f) |
|
(((R_VAL(src_ptr) << 12) | (B_VAL(src_ptr) >> 2)) & 0x03f03f) |
|
||||||
((G_VAL(src_ptr) << 4) & 0x000fc0);
|
((G_VAL(src_ptr) << 4) & 0x000fc0);
|
||||||
|
|
||||||
|
|
|
@ -75,6 +75,14 @@ evas_common_draw_context_free(RGBA_Draw_Context *dc)
|
||||||
{
|
{
|
||||||
if (!dc) return;
|
if (!dc) return;
|
||||||
|
|
||||||
|
#ifdef HAVE_PIXMAN
|
||||||
|
if (dc->col.pixman_color_image)
|
||||||
|
{
|
||||||
|
pixman_image_unref(dc->col.pixman_color_image);
|
||||||
|
dc->col.pixman_color_image = NULL;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
evas_common_draw_context_apply_clean_cutouts(&dc->cutout);
|
evas_common_draw_context_apply_clean_cutouts(&dc->cutout);
|
||||||
free(dc);
|
free(dc);
|
||||||
}
|
}
|
||||||
|
@ -133,6 +141,20 @@ evas_common_draw_context_set_color(RGBA_Draw_Context *dc, int r, int g, int b, i
|
||||||
G_VAL(&(dc->col.col)) = (DATA8)g;
|
G_VAL(&(dc->col.col)) = (DATA8)g;
|
||||||
B_VAL(&(dc->col.col)) = (DATA8)b;
|
B_VAL(&(dc->col.col)) = (DATA8)b;
|
||||||
A_VAL(&(dc->col.col)) = (DATA8)a;
|
A_VAL(&(dc->col.col)) = (DATA8)a;
|
||||||
|
#ifdef HAVE_PIXMAN
|
||||||
|
if (dc && dc->col.pixman_color_image)
|
||||||
|
pixman_image_unref(dc->col.pixman_color_image);
|
||||||
|
|
||||||
|
pixman_color_t pixman_color;
|
||||||
|
|
||||||
|
pixman_color.alpha = (dc->col.col & 0xff000000) >> 16;
|
||||||
|
pixman_color.red = (dc->col.col & 0x00ff0000) >> 8;
|
||||||
|
pixman_color.green = (dc->col.col & 0x0000ff00);
|
||||||
|
pixman_color.blue = (dc->col.col & 0x000000ff) << 8;
|
||||||
|
|
||||||
|
dc->col.pixman_color_image = pixman_image_create_solid_fill(&pixman_color);
|
||||||
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI void
|
EAPI void
|
||||||
|
@ -159,12 +181,42 @@ evas_common_draw_context_set_mask(RGBA_Draw_Context *dc, RGBA_Image *mask, int x
|
||||||
dc->mask.y = y;
|
dc->mask.y = y;
|
||||||
dc->mask.w = w;
|
dc->mask.w = w;
|
||||||
dc->mask.h = h;
|
dc->mask.h = h;
|
||||||
|
|
||||||
|
#ifdef HAVE_PIXMAN
|
||||||
|
if (mask->pixman.im)
|
||||||
|
pixman_image_unref(mask->pixman.im);
|
||||||
|
|
||||||
|
if (mask->cache_entry.flags.alpha)
|
||||||
|
{
|
||||||
|
mask->pixman.im = pixman_image_create_bits(PIXMAN_a8r8g8b8, w, h,
|
||||||
|
(uint32_t *)mask->mask.mask,
|
||||||
|
w * 4);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
mask->pixman.im = pixman_image_create_bits(PIXMAN_x8r8g8b8, w, h,
|
||||||
|
(uint32_t *)mask->mask.mask,
|
||||||
|
w * 4);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI void
|
EAPI void
|
||||||
evas_common_draw_context_unset_mask(RGBA_Draw_Context *dc)
|
evas_common_draw_context_unset_mask(RGBA_Draw_Context *dc)
|
||||||
{
|
{
|
||||||
dc->mask.mask = NULL;
|
dc->mask.mask = NULL;
|
||||||
|
|
||||||
|
#ifdef HAVE_PIXMAN
|
||||||
|
RGBA_Image *mask;
|
||||||
|
mask = (RGBA_Image *)dc->mask.mask;
|
||||||
|
|
||||||
|
if (mask && mask->pixman.im)
|
||||||
|
{
|
||||||
|
pixman_image_unref(mask->pixman.im);
|
||||||
|
mask->pixman.im = NULL;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -179,32 +231,32 @@ evas_common_draw_context_add_cutout(RGBA_Draw_Context *dc, int x, int y, int w,
|
||||||
{
|
{
|
||||||
#if 1 // this is a bit faster
|
#if 1 // this is a bit faster
|
||||||
int xa1, xa2, xb1, xb2;
|
int xa1, xa2, xb1, xb2;
|
||||||
|
|
||||||
xa1 = x;
|
xa1 = x;
|
||||||
xa2 = xa1 + w - 1;
|
xa2 = xa1 + w - 1;
|
||||||
xb1 = dc->clip.x;
|
xb1 = dc->clip.x;
|
||||||
if (xa2 < xb1) return;
|
if (xa2 < xb1) return;
|
||||||
xb2 = xb1 + dc->clip.w - 1;
|
xb2 = xb1 + dc->clip.w - 1;
|
||||||
if (xa1 >= xb2) return;
|
if (xa1 >= xb2) return;
|
||||||
if (xa2 > xb2) xa2 = xb2;
|
if (xa2 > xb2) xa2 = xb2;
|
||||||
if (xb1 > xa1) xa1 = xb1;
|
if (xb1 > xa1) xa1 = xb1;
|
||||||
x = xa1;
|
x = xa1;
|
||||||
w = xa2 - xa1 + 1;
|
w = xa2 - xa1 + 1;
|
||||||
|
|
||||||
xa1 = y;
|
xa1 = y;
|
||||||
xa2 = xa1 + h - 1;
|
xa2 = xa1 + h - 1;
|
||||||
xb1 = dc->clip.y;
|
xb1 = dc->clip.y;
|
||||||
if (xa2 < xb1) return;
|
if (xa2 < xb1) return;
|
||||||
xb2 = xb1 + dc->clip.h - 1;
|
xb2 = xb1 + dc->clip.h - 1;
|
||||||
if (xa1 >= xb2) return;
|
if (xa1 >= xb2) return;
|
||||||
if (xa2 > xb2) xa2 = xb2;
|
if (xa2 > xb2) xa2 = xb2;
|
||||||
if (xb1 > xa1) xa1 = xb1;
|
if (xb1 > xa1) xa1 = xb1;
|
||||||
y = xa1;
|
y = xa1;
|
||||||
h = xa2 - xa1 + 1;
|
h = xa2 - xa1 + 1;
|
||||||
#else
|
#else
|
||||||
RECTS_CLIP_TO_RECT(x, y, w, h,
|
RECTS_CLIP_TO_RECT(x, y, w, h,
|
||||||
dc->clip.x, dc->clip.y, dc->clip.w, dc->clip.h);
|
dc->clip.x, dc->clip.y, dc->clip.w, dc->clip.h);
|
||||||
#endif
|
#endif
|
||||||
if ((w < 1) || (h < 1)) return;
|
if ((w < 1) || (h < 1)) return;
|
||||||
}
|
}
|
||||||
evas_common_draw_context_cutouts_add(&dc->cutout, x, y, w, h);
|
evas_common_draw_context_cutouts_add(&dc->cutout, x, y, w, h);
|
||||||
|
@ -513,7 +565,7 @@ evas_common_draw_context_apply_cutouts(RGBA_Draw_Context *dc)
|
||||||
|
|
||||||
if (!dc->clip.use) return NULL;
|
if (!dc->clip.use) return NULL;
|
||||||
if ((dc->clip.w <= 0) || (dc->clip.h <= 0)) return NULL;
|
if ((dc->clip.w <= 0) || (dc->clip.h <= 0)) return NULL;
|
||||||
|
|
||||||
|
|
||||||
res = evas_common_draw_context_cutouts_new();
|
res = evas_common_draw_context_cutouts_new();
|
||||||
evas_common_draw_context_cutouts_add(res, dc->clip.x, dc->clip.y, dc->clip.w, dc->clip.h);
|
evas_common_draw_context_cutouts_add(res, dc->clip.x, dc->clip.y, dc->clip.w, dc->clip.h);
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
|
|
||||||
static int max_cached_words = WORD_CACHE_NWORDS;
|
static int max_cached_words = WORD_CACHE_NWORDS;
|
||||||
|
|
||||||
struct prword
|
struct prword
|
||||||
{
|
{
|
||||||
EINA_INLIST;
|
EINA_INLIST;
|
||||||
struct cinfo *cinfo;
|
struct cinfo *cinfo;
|
||||||
|
@ -34,16 +34,16 @@ struct prword
|
||||||
int baseline;
|
int baseline;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct cinfo
|
struct cinfo
|
||||||
{
|
{
|
||||||
FT_UInt index;
|
FT_UInt index;
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
int x, y;
|
int x, y;
|
||||||
} pos;
|
} pos;
|
||||||
int posx;
|
int posx;
|
||||||
RGBA_Font_Glyph *fg;
|
RGBA_Font_Glyph *fg;
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
int w,h;
|
int w,h;
|
||||||
int rows;
|
int rows;
|
||||||
|
@ -77,11 +77,11 @@ evas_common_font_draw_init(void)
|
||||||
#ifdef EVAS_FRAME_QUEUING
|
#ifdef EVAS_FRAME_QUEUING
|
||||||
EAPI void
|
EAPI void
|
||||||
evas_common_font_draw_finish(void)
|
evas_common_font_draw_finish(void)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* BiDi handling: We receive the shaped string + other props from text_props,
|
* BiDi handling: We receive the shaped string + other props from text_props,
|
||||||
* we need to reorder it so we'll have the visual string (the way we draw)
|
* we need to reorder it so we'll have the visual string (the way we draw)
|
||||||
* and then for kerning we have to switch the order of the kerning query (as the prev
|
* and then for kerning we have to switch the order of the kerning query (as the prev
|
||||||
|
@ -89,7 +89,7 @@ evas_common_font_draw_finish(void)
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
evas_common_font_draw_internal(RGBA_Image *dst, RGBA_Draw_Context *dc, RGBA_Font *fn __UNUSED__, int x, int y,
|
evas_common_font_draw_internal(RGBA_Image *dst, RGBA_Draw_Context *dc, RGBA_Font *fn __UNUSED__, int x, int y,
|
||||||
const Evas_Text_Props *text_props, RGBA_Gfx_Func func, int ext_x, int ext_y, int ext_w,
|
const Evas_Text_Props *text_props, RGBA_Gfx_Func func, int ext_x, int ext_y, int ext_w,
|
||||||
int ext_h, int im_w, int im_h __UNUSED__)
|
int ext_h, int im_w, int im_h __UNUSED__)
|
||||||
{
|
{
|
||||||
DATA32 *im;
|
DATA32 *im;
|
||||||
|
@ -136,7 +136,7 @@ evas_common_font_draw_internal(RGBA_Image *dst, RGBA_Draw_Context *dc, RGBA_Font
|
||||||
{
|
{
|
||||||
xrun -= x + xrun - ext_x - ext_w;
|
xrun -= x + xrun - ext_x - ext_w;
|
||||||
}
|
}
|
||||||
if (x < ext_x)
|
if (x < ext_x)
|
||||||
{
|
{
|
||||||
int excess = ext_x - x;
|
int excess = ext_x - x;
|
||||||
xstart = excess - 1;
|
xstart = excess - 1;
|
||||||
|
@ -244,10 +244,29 @@ evas_common_font_draw_internal(RGBA_Image *dst, RGBA_Draw_Context *dc, RGBA_Font
|
||||||
if (j < w) j = w;
|
if (j < w) j = w;
|
||||||
h = fg->glyph_out->bitmap.rows;
|
h = fg->glyph_out->bitmap.rows;
|
||||||
/*
|
/*
|
||||||
if ((fg->glyph_out->bitmap.pixel_mode == ft_pixel_mode_grays)
|
if ((fg->glyph_out->bitmap.pixel_mode == ft_pixel_mode_grays)
|
||||||
&& (fg->glyph_out->bitmap.num_grays == 256)
|
&& (fg->glyph_out->bitmap.num_grays == 256)
|
||||||
)
|
)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef HAVE_PIXMAN
|
||||||
|
# ifdef PIXMAN_FONT
|
||||||
|
int index;
|
||||||
|
DATA32 *font_alpha_buffer;
|
||||||
|
pixman_image_t *font_mask_image;
|
||||||
|
|
||||||
|
font_alpha_buffer = alloca(w * h * sizeof(DATA32));
|
||||||
|
for (index = 0; index < (w * h); index++)
|
||||||
|
font_alpha_buffer[index] = data[index] << 24;
|
||||||
|
|
||||||
|
font_mask_image = pixman_image_create_bits(PIXMAN_a8r8g8b8, w, h,
|
||||||
|
font_alpha_buffer,
|
||||||
|
w * sizeof(DATA32));
|
||||||
|
|
||||||
|
if (!font_mask_image) return;
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
{
|
{
|
||||||
if ((j > 0) && (chr_x + w > ext_x))
|
if ((j > 0) && (chr_x + w > ext_x))
|
||||||
{
|
{
|
||||||
|
@ -255,44 +274,63 @@ evas_common_font_draw_internal(RGBA_Image *dst, RGBA_Draw_Context *dc, RGBA_Font
|
||||||
{
|
{
|
||||||
/* ext glyph draw */
|
/* ext glyph draw */
|
||||||
dc->font_ext.func.gl_draw(dc->font_ext.data,
|
dc->font_ext.func.gl_draw(dc->font_ext.data,
|
||||||
(void *)dst,
|
(void *)dst,
|
||||||
dc, fg, chr_x,
|
dc, fg, chr_x,
|
||||||
y - (chr_y - y));
|
y - (chr_y - y));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ((fg->glyph_out->bitmap.num_grays == 256) &&
|
if ((fg->glyph_out->bitmap.num_grays == 256) &&
|
||||||
(fg->glyph_out->bitmap.pixel_mode == FT_PIXEL_MODE_GRAY))
|
(fg->glyph_out->bitmap.pixel_mode == FT_PIXEL_MODE_GRAY))
|
||||||
{
|
{
|
||||||
for (i = 0; i < h; i++)
|
#ifdef HAVE_PIXMAN
|
||||||
{
|
# ifdef PIXMAN_FONT
|
||||||
int dx, dy;
|
if ((dst->pixman.im) &&
|
||||||
int in_x, in_w;
|
(dc->col.pixman_color_image))
|
||||||
|
pixman_image_composite(PIXMAN_OP_OVER,
|
||||||
in_x = 0;
|
dc->col.pixman_color_image,
|
||||||
in_w = 0;
|
font_mask_image,
|
||||||
dx = chr_x;
|
dst->pixman.im,
|
||||||
dy = y - (chr_y - i - y);
|
chr_x,
|
||||||
#ifdef EVAS_SLI
|
y - (chr_y - y),
|
||||||
if (((dy) % dc->sli.h) == dc->sli.y)
|
0, 0,
|
||||||
|
chr_x,
|
||||||
|
y - (chr_y - y),
|
||||||
|
w, h);
|
||||||
|
else
|
||||||
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
{
|
||||||
|
for (i = 0; i < h; i++)
|
||||||
{
|
{
|
||||||
if ((dx < (ext_x + ext_w)) &&
|
int dx, dy;
|
||||||
(dy >= (ext_y)) &&
|
int in_x, in_w;
|
||||||
(dy < (ext_y + ext_h)))
|
|
||||||
|
in_x = 0;
|
||||||
|
in_w = 0;
|
||||||
|
dx = chr_x;
|
||||||
|
dy = y - (chr_y - i - y);
|
||||||
|
#ifdef EVAS_SLI
|
||||||
|
if (((dy) % dc->sli.h) == dc->sli.y)
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
if (dx + w > (ext_x + ext_w))
|
if ((dx < (ext_x + ext_w)) &&
|
||||||
in_w += (dx + w) - (ext_x + ext_w);
|
(dy >= (ext_y)) &&
|
||||||
if (dx < ext_x)
|
(dy < (ext_y + ext_h)))
|
||||||
{
|
{
|
||||||
in_w += ext_x - dx;
|
if (dx + w > (ext_x + ext_w))
|
||||||
in_x = ext_x - dx;
|
in_w += (dx + w) - (ext_x + ext_w);
|
||||||
dx = ext_x;
|
if (dx < ext_x)
|
||||||
}
|
{
|
||||||
if (in_w < w)
|
in_w += ext_x - dx;
|
||||||
{
|
in_x = ext_x - dx;
|
||||||
func(NULL, data + (i * j) + in_x, dc->col.col,
|
dx = ext_x;
|
||||||
im + (dy * im_w) + dx, w - in_w);
|
}
|
||||||
|
if (in_w < w)
|
||||||
|
{
|
||||||
|
func(NULL, data + (i * j) + in_x, dc->col.col,
|
||||||
|
im + (dy * im_w) + dx, w - in_w);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -309,7 +347,7 @@ evas_common_font_draw_internal(RGBA_Image *dst, RGBA_Draw_Context *dc, RGBA_Font
|
||||||
{
|
{
|
||||||
int dx, dy;
|
int dx, dy;
|
||||||
int in_x, in_w, end;
|
int in_x, in_w, end;
|
||||||
|
|
||||||
in_x = 0;
|
in_x = 0;
|
||||||
in_w = 0;
|
in_w = 0;
|
||||||
dx = chr_x;
|
dx = chr_x;
|
||||||
|
@ -333,8 +371,8 @@ evas_common_font_draw_internal(RGBA_Image *dst, RGBA_Draw_Context *dc, RGBA_Font
|
||||||
dp++;
|
dp++;
|
||||||
}
|
}
|
||||||
if ((dx < (ext_x + ext_w)) &&
|
if ((dx < (ext_x + ext_w)) &&
|
||||||
(dy >= (ext_y)) &&
|
(dy >= (ext_y)) &&
|
||||||
(dy < (ext_y + ext_h)))
|
(dy < (ext_y + ext_h)))
|
||||||
{
|
{
|
||||||
if (dx + w > (ext_x + ext_w))
|
if (dx + w > (ext_x + ext_w))
|
||||||
in_w += (dx + w) - (ext_x + ext_w);
|
in_w += (dx + w) - (ext_x + ext_w);
|
||||||
|
@ -347,7 +385,7 @@ evas_common_font_draw_internal(RGBA_Image *dst, RGBA_Draw_Context *dc, RGBA_Font
|
||||||
if (in_w < w)
|
if (in_w < w)
|
||||||
{
|
{
|
||||||
func(NULL, tmpbuf + in_x, dc->col.col,
|
func(NULL, tmpbuf + in_x, dc->col.col,
|
||||||
im + (dy * im_w) + dx, w - in_w);
|
im + (dy * im_w) + dx, w - in_w);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -356,6 +394,11 @@ evas_common_font_draw_internal(RGBA_Image *dst, RGBA_Draw_Context *dc, RGBA_Font
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#ifdef HAVE_PIXMAN
|
||||||
|
# ifdef PIXMAN_FONT
|
||||||
|
pixman_image_unref(font_mask_image);
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
break;
|
break;
|
||||||
|
@ -573,7 +616,7 @@ evas_font_word_prerender(RGBA_Draw_Context *dc, const Evas_Text_Props *text_prop
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
im = NULL;
|
im = NULL;
|
||||||
}
|
}
|
||||||
|
@ -599,7 +642,7 @@ evas_font_word_prerender(RGBA_Draw_Context *dc, const Evas_Text_Props *text_prop
|
||||||
{
|
{
|
||||||
struct prword *last = (struct prword *)(words->last);
|
struct prword *last = (struct prword *)(words->last);
|
||||||
|
|
||||||
if (last)
|
if (last)
|
||||||
{
|
{
|
||||||
if (last->im) free(last->im);
|
if (last->im) free(last->im);
|
||||||
if (last->cinfo) free(last->cinfo);
|
if (last->cinfo) free(last->cinfo);
|
||||||
|
|
|
@ -145,7 +145,7 @@ _evas_common_rgba_image_new(void)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
evas_common_rgba_image_scalecache_init(&im->cache_entry);
|
evas_common_rgba_image_scalecache_init(&im->cache_entry);
|
||||||
|
|
||||||
return &im->cache_entry;
|
return &im->cache_entry;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -161,7 +161,7 @@ _evas_common_rgba_image_delete(Image_Entry *ie)
|
||||||
LKD(im->cache_entry.ref_fq_del);
|
LKD(im->cache_entry.ref_fq_del);
|
||||||
eina_condition_free(&(im->cache_entry.cond_fq_del));
|
eina_condition_free(&(im->cache_entry.cond_fq_del));
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
evas_common_rgba_image_scalecache_shutdown(&im->cache_entry);
|
evas_common_rgba_image_scalecache_shutdown(&im->cache_entry);
|
||||||
if (ie->info.module) evas_module_unref((Evas_Module *)ie->info.module);
|
if (ie->info.module) evas_module_unref((Evas_Module *)ie->info.module);
|
||||||
/* memset the image to 0x99 because i recently saw a segv where an
|
/* memset the image to 0x99 because i recently saw a segv where an
|
||||||
|
@ -173,13 +173,13 @@ _evas_common_rgba_image_delete(Image_Entry *ie)
|
||||||
// memset(im, 0x99, sizeof(im));
|
// memset(im, 0x99, sizeof(im));
|
||||||
#ifdef EVAS_CSERVE
|
#ifdef EVAS_CSERVE
|
||||||
if (ie->data1) evas_cserve_image_free(ie);
|
if (ie->data1) evas_cserve_image_free(ie);
|
||||||
#endif
|
#endif
|
||||||
/*
|
/*
|
||||||
* FIXME: This doesn't seem to be needed... But I'm not sure why.
|
* FIXME: This doesn't seem to be needed... But I'm not sure why.
|
||||||
* -- nash
|
* -- nash
|
||||||
{
|
{
|
||||||
Filtered_Image *fi;
|
Filtered_Image *fi;
|
||||||
|
|
||||||
EINA_LIST_FREE(im->filtered, fi)
|
EINA_LIST_FREE(im->filtered, fi)
|
||||||
{
|
{
|
||||||
free(fi->key);
|
free(fi->key);
|
||||||
|
@ -249,8 +249,8 @@ evas_common_rgba_image_unload(Image_Entry *ie)
|
||||||
#endif
|
#endif
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (im->image.data && !im->image.no_free)
|
if (im->image.data && !im->image.no_free)
|
||||||
free(im->image.data);
|
free(im->image.data);
|
||||||
im->image.data = NULL;
|
im->image.data = NULL;
|
||||||
|
@ -266,18 +266,19 @@ void
|
||||||
_evas_common_rgba_image_post_surface(Image_Entry *ie)
|
_evas_common_rgba_image_post_surface(Image_Entry *ie)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_PIXMAN
|
#ifdef HAVE_PIXMAN
|
||||||
RGBA_Image *im = (RGBA_Image *) ie;
|
# ifdef PIXMAN_IMAGE
|
||||||
|
RGBA_Image *im = (RGBA_Image *)ie;
|
||||||
|
|
||||||
if (im->pixman.im) pixman_image_unref(im->pixman.im);
|
if (im->pixman.im) pixman_image_unref(im->pixman.im);
|
||||||
if (im->cache_entry.flags.alpha)
|
if (im->cache_entry.flags.alpha)
|
||||||
{
|
{
|
||||||
im->pixman.im = pixman_image_create_bits
|
im->pixman.im = pixman_image_create_bits
|
||||||
(
|
(
|
||||||
// FIXME: endianess determines this
|
// FIXME: endianess determines this
|
||||||
PIXMAN_a8r8g8b8,
|
PIXMAN_a8r8g8b8,
|
||||||
// PIXMAN_b8g8r8a8,
|
// PIXMAN_b8g8r8a8,
|
||||||
im->cache_entry.w, im->cache_entry.h,
|
im->cache_entry.w, im->cache_entry.h,
|
||||||
im->image.data,
|
im->image.data,
|
||||||
im->cache_entry.w * 4
|
im->cache_entry.w * 4
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -285,14 +286,17 @@ _evas_common_rgba_image_post_surface(Image_Entry *ie)
|
||||||
{
|
{
|
||||||
im->pixman.im = pixman_image_create_bits
|
im->pixman.im = pixman_image_create_bits
|
||||||
(
|
(
|
||||||
// FIXME: endianess determines this
|
// FIXME: endianess determines this
|
||||||
PIXMAN_x8r8g8b8,
|
PIXMAN_x8r8g8b8,
|
||||||
// PIXMAN_b8g8r8x8,
|
// PIXMAN_b8g8r8x8,
|
||||||
im->cache_entry.w, im->cache_entry.h,
|
im->cache_entry.w, im->cache_entry.h,
|
||||||
im->image.data,
|
im->image.data,
|
||||||
im->cache_entry.w * 4
|
im->cache_entry.w * 4
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
# else
|
||||||
|
ie = NULL;
|
||||||
|
# endif
|
||||||
#else
|
#else
|
||||||
ie = NULL;
|
ie = NULL;
|
||||||
#endif
|
#endif
|
||||||
|
@ -306,7 +310,7 @@ _evas_common_rgba_image_surface_alloc(Image_Entry *ie, unsigned int w, unsigned
|
||||||
|
|
||||||
#ifdef EVAS_CSERVE
|
#ifdef EVAS_CSERVE
|
||||||
if (ie->data1) return 0;
|
if (ie->data1) return 0;
|
||||||
#endif
|
#endif
|
||||||
if (im->image.no_free) return 0;
|
if (im->image.no_free) return 0;
|
||||||
|
|
||||||
if (im->flags & RGBA_IMAGE_ALPHA_ONLY)
|
if (im->flags & RGBA_IMAGE_ALPHA_ONLY)
|
||||||
|
@ -328,7 +332,7 @@ _evas_common_rgba_image_surface_alloc(Image_Entry *ie, unsigned int w, unsigned
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
_evas_common_rgba_image_post_surface(ie);
|
_evas_common_rgba_image_post_surface(ie);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -338,12 +342,14 @@ _evas_common_rgba_image_surface_delete(Image_Entry *ie)
|
||||||
RGBA_Image *im = (RGBA_Image *) ie;
|
RGBA_Image *im = (RGBA_Image *) ie;
|
||||||
|
|
||||||
#ifdef HAVE_PIXMAN
|
#ifdef HAVE_PIXMAN
|
||||||
|
# ifdef PIXMAN_IMAGE
|
||||||
if (im->pixman.im)
|
if (im->pixman.im)
|
||||||
{
|
{
|
||||||
pixman_image_unref(im->pixman.im);
|
pixman_image_unref(im->pixman.im);
|
||||||
im->pixman.im = NULL;
|
im->pixman.im = NULL;
|
||||||
}
|
}
|
||||||
#endif
|
# endif
|
||||||
|
#endif
|
||||||
if (ie->file)
|
if (ie->file)
|
||||||
DBG("unload: [%p] %s %s", ie, ie->file, ie->key);
|
DBG("unload: [%p] %s %s", ie, ie->file, ie->key);
|
||||||
if ((im->cs.data) && (im->image.data))
|
if ((im->cs.data) && (im->image.data))
|
||||||
|
@ -364,7 +370,7 @@ _evas_common_rgba_image_surface_delete(Image_Entry *ie)
|
||||||
#ifdef EVAS_CSERVE
|
#ifdef EVAS_CSERVE
|
||||||
else if (ie->data1)
|
else if (ie->data1)
|
||||||
evas_cserve_image_free(ie);
|
evas_cserve_image_free(ie);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
im->image.data = NULL;
|
im->image.data = NULL;
|
||||||
ie->allocated.w = 0;
|
ie->allocated.w = 0;
|
||||||
|
@ -391,7 +397,7 @@ _evas_common_rgba_image_dirty_region(Image_Entry* ie, unsigned int x __UNUSED__,
|
||||||
|
|
||||||
#ifdef EVAS_CSERVE
|
#ifdef EVAS_CSERVE
|
||||||
if (ie->data1) evas_cserve_image_free(ie);
|
if (ie->data1) evas_cserve_image_free(ie);
|
||||||
#endif
|
#endif
|
||||||
im->flags |= RGBA_IMAGE_IS_DIRTY;
|
im->flags |= RGBA_IMAGE_IS_DIRTY;
|
||||||
evas_common_rgba_image_scalecache_dirty(&im->cache_entry);
|
evas_common_rgba_image_scalecache_dirty(&im->cache_entry);
|
||||||
}
|
}
|
||||||
|
@ -411,13 +417,13 @@ _evas_common_rgba_image_dirty(Image_Entry *ie_dst, const Image_Entry *ie_src)
|
||||||
{
|
{
|
||||||
#ifdef EVAS_CSERVE
|
#ifdef EVAS_CSERVE
|
||||||
if (ie_src->data1) evas_cserve_image_free((Image_Entry*) ie_src);
|
if (ie_src->data1) evas_cserve_image_free((Image_Entry*) ie_src);
|
||||||
#endif
|
#endif
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef EVAS_CSERVE
|
#ifdef EVAS_CSERVE
|
||||||
if (ie_src->data1) evas_cserve_image_free((Image_Entry*) ie_src);
|
if (ie_src->data1) evas_cserve_image_free((Image_Entry*) ie_src);
|
||||||
#endif
|
#endif
|
||||||
evas_common_image_colorspace_normalize(src);
|
evas_common_image_colorspace_normalize(src);
|
||||||
evas_common_image_colorspace_normalize(dst);
|
evas_common_image_colorspace_normalize(dst);
|
||||||
/* evas_common_blit_rectangle(src, dst, 0, 0, src->cache_entry.w, src->cache_entry.h, 0, 0); */
|
/* evas_common_blit_rectangle(src, dst, 0, 0, src->cache_entry.w, src->cache_entry.h, 0, 0); */
|
||||||
|
@ -431,18 +437,18 @@ _evas_common_rgba_image_ram_usage(Image_Entry *ie)
|
||||||
{
|
{
|
||||||
RGBA_Image *im = (RGBA_Image *)ie;
|
RGBA_Image *im = (RGBA_Image *)ie;
|
||||||
int size = sizeof(struct _RGBA_Image);
|
int size = sizeof(struct _RGBA_Image);
|
||||||
|
|
||||||
if (ie->cache_key) size += strlen(ie->cache_key);
|
if (ie->cache_key) size += strlen(ie->cache_key);
|
||||||
if (ie->file) size += strlen(ie->file);
|
if (ie->file) size += strlen(ie->file);
|
||||||
if (ie->key) size += strlen(ie->key);
|
if (ie->key) size += strlen(ie->key);
|
||||||
|
|
||||||
if (im->image.data)
|
if (im->image.data)
|
||||||
{
|
{
|
||||||
#ifdef EVAS_CSERVE
|
#ifdef EVAS_CSERVE
|
||||||
if ((!im->image.no_free) || (ie->data1))
|
if ((!im->image.no_free) || (ie->data1))
|
||||||
#else
|
#else
|
||||||
if ((!im->image.no_free))
|
if ((!im->image.no_free))
|
||||||
#endif
|
#endif
|
||||||
size += im->cache_entry.w * im->cache_entry.h * sizeof(DATA32);
|
size += im->cache_entry.w * im->cache_entry.h * sizeof(DATA32);
|
||||||
}
|
}
|
||||||
size += evas_common_rgba_image_scalecache_usage_get(&im->cache_entry);
|
size += evas_common_rgba_image_scalecache_usage_get(&im->cache_entry);
|
||||||
|
@ -590,7 +596,7 @@ evas_common_image_colorspace_normalize(RGBA_Image *im)
|
||||||
{
|
{
|
||||||
#ifdef EVAS_CSERVE
|
#ifdef EVAS_CSERVE
|
||||||
if (((Image_Entry *)im)->data1) evas_cserve_image_free(&im->cache_entry);
|
if (((Image_Entry *)im)->data1) evas_cserve_image_free(&im->cache_entry);
|
||||||
#endif
|
#endif
|
||||||
if (!im->image.no_free) free(im->image.data);
|
if (!im->image.no_free) free(im->image.data);
|
||||||
im->image.data = im->cs.data;
|
im->image.data = im->cs.data;
|
||||||
im->cs.no_free = im->image.no_free;
|
im->cs.no_free = im->image.no_free;
|
||||||
|
|
|
@ -109,9 +109,24 @@ _evas_draw_point(RGBA_Image *dst, RGBA_Draw_Context *dc, int x, int y)
|
||||||
return;
|
return;
|
||||||
if ((dc->clip.use) && (!IN_RECT(x, y, dc->clip.x, dc->clip.y, dc->clip.w, dc->clip.h)))
|
if ((dc->clip.use) && (!IN_RECT(x, y, dc->clip.x, dc->clip.y, dc->clip.w, dc->clip.h)))
|
||||||
return;
|
return;
|
||||||
pfunc = evas_common_gfx_func_composite_color_pt_get(dc->col.col, dst, dc->render_op);
|
#ifdef HAVE_PIXMAN
|
||||||
if (pfunc)
|
# ifdef PIXMAN_LINE
|
||||||
pfunc(0, 255, dc->col.col, dst->image.data + (dst->cache_entry.w * y) + x);
|
pixman_op_t op = PIXMAN_OP_SRC;
|
||||||
|
|
||||||
|
if (dc->render_op == _EVAS_RENDER_BLEND)
|
||||||
|
op = PIXMAN_OP_OVER;
|
||||||
|
|
||||||
|
if ((dst->pixman.im) && (dc->col.pixman_color_image))
|
||||||
|
pixman_image_composite(op, dc->col.pixman_color_image, NULL,
|
||||||
|
dst->pixman.im, x, y, 0, 0, x, y, 1, 1);
|
||||||
|
else
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
pfunc = evas_common_gfx_func_composite_color_pt_get(dc->col.col, dst, dc->render_op);
|
||||||
|
if (pfunc)
|
||||||
|
pfunc(0, 255, dc->col.col, dst->image.data + (dst->cache_entry.w * y) + x);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -130,6 +145,14 @@ _evas_draw_simple_line(RGBA_Image *dst, RGBA_Draw_Context *dc, int x0, int y0, i
|
||||||
RGBA_Gfx_Pt_Func pfunc;
|
RGBA_Gfx_Pt_Func pfunc;
|
||||||
RGBA_Gfx_Func sfunc;
|
RGBA_Gfx_Func sfunc;
|
||||||
|
|
||||||
|
#ifdef HAVE_PIXMAN
|
||||||
|
# ifdef PIXMAN_LINE
|
||||||
|
pixman_op_t op = PIXMAN_OP_SRC; // _EVAS_RENDER_COPY
|
||||||
|
if (dc->render_op == _EVAS_RENDER_BLEND)
|
||||||
|
op = PIXMAN_OP_OVER;
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
dstw = dst->cache_entry.w;
|
dstw = dst->cache_entry.w;
|
||||||
color = dc->col.col;
|
color = dc->col.col;
|
||||||
|
|
||||||
|
@ -172,12 +195,30 @@ _evas_draw_simple_line(RGBA_Image *dst, RGBA_Draw_Context *dc, int x0, int y0, i
|
||||||
|
|
||||||
len = x1 - x0 + 1;
|
len = x1 - x0 + 1;
|
||||||
p = dst->image.data + (dstw * y0) + x0;
|
p = dst->image.data + (dstw * y0) + x0;
|
||||||
sfunc = evas_common_gfx_func_composite_color_span_get(color, dst, len, dc->render_op);
|
#ifdef HAVE_PIXMAN
|
||||||
if (sfunc)
|
# ifdef PIXMAN_LINE
|
||||||
sfunc(NULL, NULL, color, p, len);
|
if ((dst->pixman.im) && (dc->col.pixman_color_image) &&
|
||||||
}
|
(!dc->mask.mask))
|
||||||
}
|
pixman_image_composite(op, dc->col.pixman_color_image,
|
||||||
return;
|
NULL, dst->pixman.im,
|
||||||
|
x0, y0, 0, 0, x0, y0, len, 1);
|
||||||
|
else if ((dst->pixman.im) && (dc->col.pixman_color_image) &&
|
||||||
|
(dc->mask.mask))
|
||||||
|
pixman_image_composite(op, dc->col.pixman_color_image,
|
||||||
|
dc->mask.mask->pixman.im,
|
||||||
|
dst->pixman.im,
|
||||||
|
x0, y0, 0, 0, x0, y0, len, 1);
|
||||||
|
else
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
sfunc = evas_common_gfx_func_composite_color_span_get(color, dst, len, dc->render_op);
|
||||||
|
if (sfunc)
|
||||||
|
sfunc(NULL, NULL, color, p, len);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
pfunc = evas_common_gfx_func_composite_color_pt_get(color, dst, dc->render_op);
|
pfunc = evas_common_gfx_func_composite_color_pt_get(color, dst, dc->render_op);
|
||||||
|
@ -192,17 +233,34 @@ _evas_draw_simple_line(RGBA_Image *dst, RGBA_Draw_Context *dc, int x0, int y0, i
|
||||||
|
|
||||||
len = y1 - y0 + 1;
|
len = y1 - y0 + 1;
|
||||||
p = dst->image.data + (dstw * y0) + x0;
|
p = dst->image.data + (dstw * y0) + x0;
|
||||||
while (len--)
|
#ifdef HAVE_PIXMAN
|
||||||
{
|
# ifdef PIXMAN_LINE
|
||||||
#ifdef EVAS_SLI
|
if ((dst->pixman.im) && (dc->col.pixman_color_image) &&
|
||||||
if (((y1 + 1 - len) % dc->sli.h) == dc->sli.y)
|
(!dc->mask.mask))
|
||||||
|
pixman_image_composite(op, dc->col.pixman_color_image,
|
||||||
|
NULL, dst->pixman.im,
|
||||||
|
x0, y0, 0, 0, x0, y0, 1, len);
|
||||||
|
else if ((dst->pixman.im) && (dc->col.pixman_color_image) &&
|
||||||
|
(dc->mask.mask))
|
||||||
|
pixman_image_composite(op, dc->col.pixman_color_image,
|
||||||
|
dc->mask.mask->pixman.im, dst->pixman.im,
|
||||||
|
x0, y0, 0, 0, x0, y0, 1, len);
|
||||||
|
else
|
||||||
|
# endif
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
pfunc(0, 255, color, p);
|
while (len--)
|
||||||
}
|
{
|
||||||
p += dstw;
|
#ifdef EVAS_SLI
|
||||||
}
|
if (((y1 + 1 - len) % dc->sli.h) == dc->sli.y)
|
||||||
}
|
#endif
|
||||||
|
{
|
||||||
|
pfunc(0, 255, color, p);
|
||||||
|
}
|
||||||
|
p += dstw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -281,16 +339,52 @@ _evas_draw_simple_line(RGBA_Image *dst, RGBA_Draw_Context *dc, int x0, int y0, i
|
||||||
if (dx > 0) dstw--;
|
if (dx > 0) dstw--;
|
||||||
else dstw++;
|
else dstw++;
|
||||||
}
|
}
|
||||||
|
#ifdef HAVE_PIXMAN
|
||||||
|
# ifdef PIXMAN_LINE
|
||||||
|
int pixman_x_position = x0;
|
||||||
|
int pixman_y_position = y0;
|
||||||
|
int x_unit = dstw - dst->cache_entry.w;
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
while (len--)
|
while (len--)
|
||||||
{
|
{
|
||||||
#ifdef EVAS_SLI
|
#ifdef EVAS_SLI
|
||||||
if (((y1 + 1 - len) % dc->sli.h) == dc->sli.y)
|
if (((y1 + 1 - len) % dc->sli.h) == dc->sli.y)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
pfunc(0, 255, color, p);
|
#ifdef HAVE_PIXMAN
|
||||||
}
|
# ifdef PIXMAN_LINE
|
||||||
p += dstw;
|
if ((dst->pixman.im) && (dc->col.pixman_color_image) &&
|
||||||
|
(!dc->mask.mask))
|
||||||
|
pixman_image_composite(op, dc->col.pixman_color_image,
|
||||||
|
NULL, dst->pixman.im,
|
||||||
|
pixman_x_position,
|
||||||
|
pixman_y_position,
|
||||||
|
0, 0, pixman_x_position,
|
||||||
|
pixman_y_position, 1, 1);
|
||||||
|
else if ((dst->pixman.im) && (dc->col.pixman_color_image) &&
|
||||||
|
(dc->mask.mask))
|
||||||
|
pixman_image_composite(op, dc->col.pixman_color_image,
|
||||||
|
dc->mask.mask->pixman.im,
|
||||||
|
dst->pixman.im,
|
||||||
|
pixman_x_position,
|
||||||
|
pixman_y_position, 0, 0,
|
||||||
|
pixman_x_position,
|
||||||
|
pixman_y_position, 1, 1);
|
||||||
|
else
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
pfunc(0, 255, color, p);
|
||||||
|
}
|
||||||
|
#ifdef HAVE_PIXMAN
|
||||||
|
# ifdef PIXMAN_LINE
|
||||||
|
pixman_x_position += x_unit;
|
||||||
|
pixman_y_position += 1;
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
p += dstw;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -456,6 +550,31 @@ _evas_draw_line(RGBA_Image *dst, RGBA_Draw_Context *dc, int x0, int y0, int x1,
|
||||||
dx = x1 - x0;
|
dx = x1 - x0;
|
||||||
dy = y1 - y0;
|
dy = y1 - y0;
|
||||||
|
|
||||||
|
#ifdef HAVE_PIXMAN
|
||||||
|
# ifdef PIXMAN_LINE
|
||||||
|
int pix_x;
|
||||||
|
int pix_y;
|
||||||
|
int pix_x_unit;
|
||||||
|
int pix_y_unit;
|
||||||
|
|
||||||
|
pixman_op_t op = PIXMAN_OP_SRC; // _EVAS_RENDER_COPY
|
||||||
|
if (dc->render_op == _EVAS_RENDER_BLEND)
|
||||||
|
op = PIXMAN_OP_OVER;
|
||||||
|
pix_x = x0;
|
||||||
|
pix_y = y0;
|
||||||
|
|
||||||
|
if (dx < 0)
|
||||||
|
pix_x_unit = -1;
|
||||||
|
else
|
||||||
|
pix_x_unit = 1;
|
||||||
|
|
||||||
|
if (dy < 0)
|
||||||
|
pix_y_unit = -1;
|
||||||
|
else
|
||||||
|
pix_y_unit = 1;
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
if ( (dx == 0) || (dy == 0) || (dx == dy) || (dx == -dy) )
|
if ( (dx == 0) || (dy == 0) || (dx == dy) || (dx == -dy) )
|
||||||
{
|
{
|
||||||
_evas_draw_simple_line(dst, dc, x0, y0, x1, y1);
|
_evas_draw_simple_line(dst, dc, x0, y0, x1, y1);
|
||||||
|
@ -494,6 +613,11 @@ _evas_draw_line(RGBA_Image *dst, RGBA_Draw_Context *dc, int x0, int y0, int x1,
|
||||||
prev_y = y;
|
prev_y = y;
|
||||||
p += dh;
|
p += dh;
|
||||||
py += dely;
|
py += dely;
|
||||||
|
#ifdef HAVE_PIXMAN
|
||||||
|
# ifdef PIXMAN_LINE
|
||||||
|
pix_y += pix_y_unit;
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
if (!p1_in)
|
if (!p1_in)
|
||||||
{
|
{
|
||||||
|
@ -509,12 +633,37 @@ _evas_draw_line(RGBA_Image *dst, RGBA_Draw_Context *dc, int x0, int y0, int x1,
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
if (IN_RANGE(px, py, clw, clh))
|
if (IN_RANGE(px, py, clw, clh))
|
||||||
pfunc(0, 255, color, p);
|
{
|
||||||
}
|
#ifdef HAVE_PIXMAN
|
||||||
next_x:
|
# ifdef PIXMAN_LINE
|
||||||
yy += dyy;
|
if ((dst->pixman.im) && (dc->col.pixman_color_image) &&
|
||||||
px++;
|
(!dc->mask.mask))
|
||||||
p++;
|
pixman_image_composite(op, dc->col.pixman_color_image,
|
||||||
|
NULL, dst->pixman.im,
|
||||||
|
pix_x, pix_y, 0, 0,
|
||||||
|
pix_x, pix_y, 1, 1);
|
||||||
|
else if ((dst->pixman.im) && (dc->col.pixman_color_image) &&
|
||||||
|
(dc->mask.mask))
|
||||||
|
pixman_image_composite(op, dc->col.pixman_color_image,
|
||||||
|
dc->mask.mask->pixman.im,
|
||||||
|
dst->pixman.im,
|
||||||
|
pix_x, pix_y, 0, 0,
|
||||||
|
pix_x, pix_y, 1, 1);
|
||||||
|
else
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
pfunc(0, 255, color, p);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
next_x:
|
||||||
|
yy += dyy;
|
||||||
|
px++;
|
||||||
|
p++;
|
||||||
|
#ifdef HAVE_PIXMAN
|
||||||
|
# ifdef PIXMAN_LINE
|
||||||
|
pix_x += pix_x_unit;
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -529,9 +678,14 @@ _evas_draw_line(RGBA_Image *dst, RGBA_Draw_Context *dc, int x0, int y0, int x1,
|
||||||
x += ((xx - (x << 16)) >> 15);
|
x += ((xx - (x << 16)) >> 15);
|
||||||
if (prev_x != x)
|
if (prev_x != x)
|
||||||
{
|
{
|
||||||
prev_x = x;
|
prev_x = x;
|
||||||
px += delx;
|
px += delx;
|
||||||
p += delx;
|
p += delx;
|
||||||
|
#ifdef HAVE_PIXMAN
|
||||||
|
# ifdef PIXMAN_LINE
|
||||||
|
pix_x += pix_x_unit;
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
if (!p1_in)
|
if (!p1_in)
|
||||||
{
|
{
|
||||||
|
@ -547,12 +701,38 @@ _evas_draw_line(RGBA_Image *dst, RGBA_Draw_Context *dc, int x0, int y0, int x1,
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
if (IN_RANGE(px, py, clw, clh))
|
if (IN_RANGE(px, py, clw, clh))
|
||||||
pfunc(0, 255, color, p);
|
{
|
||||||
}
|
#ifdef HAVE_PIXMAN
|
||||||
next_y:
|
# ifdef PIXMAN_LINE
|
||||||
|
if ((dst->pixman.im) && (dc->col.pixman_color_image) &&
|
||||||
|
(!dc->mask.mask))
|
||||||
|
pixman_image_composite(op, dc->col.pixman_color_image,
|
||||||
|
NULL, dst->pixman.im,
|
||||||
|
pix_x, pix_y, 0, 0,
|
||||||
|
pix_x, pix_y, 1, 1);
|
||||||
|
else if ((dst->pixman.im) && (dc->col.pixman_color_image) &&
|
||||||
|
(dc->mask.mask))
|
||||||
|
pixman_image_composite(op, dc->col.pixman_color_image,
|
||||||
|
dc->mask.mask->pixman.im,
|
||||||
|
dst->pixman.im,
|
||||||
|
pix_x, pix_y, 0, 0,
|
||||||
|
pix_x, pix_y, 1, 1);
|
||||||
|
else
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
pfunc(0, 255, color, p);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
next_y:
|
||||||
xx += dxx;
|
xx += dxx;
|
||||||
py++;
|
py++;
|
||||||
p += dstw;
|
p += dstw;
|
||||||
|
#ifdef HAVE_PIXMAN
|
||||||
|
# ifdef PIXMAN_LINE
|
||||||
|
pix_y += pix_y_unit;
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -564,16 +744,47 @@ _evas_draw_line_aa(RGBA_Image *dst, RGBA_Draw_Context *dc, int x0, int y0, int x
|
||||||
int dx, dy, rx, by, p0_in, p1_in, dh, a_a = 1;
|
int dx, dy, rx, by, p0_in, p1_in, dh, a_a = 1;
|
||||||
int delx, dely, xx, yy, dxx, dyy;
|
int delx, dely, xx, yy, dxx, dyy;
|
||||||
int clx, cly, clw, clh;
|
int clx, cly, clw, clh;
|
||||||
int dstw;
|
int dstw, dsth;
|
||||||
DATA32 *p, *data, color;
|
DATA32 *p, *data, color;
|
||||||
RGBA_Gfx_Pt_Func pfunc;
|
RGBA_Gfx_Pt_Func pfunc;
|
||||||
|
|
||||||
if (y0 > y1)
|
|
||||||
EXCHANGE_POINTS(x0, y0, x1, y1);
|
|
||||||
dx = x1 - x0;
|
dx = x1 - x0;
|
||||||
dy = y1 - y0;
|
dy = y1 - y0;
|
||||||
|
|
||||||
if ( (dx == 0) || (dy == 0) || (dx == dy) || (dx == -dy) )
|
#ifdef HAVE_PIXMAN
|
||||||
|
# ifdef PIXMAN_LINE
|
||||||
|
int pix_x;
|
||||||
|
int pix_y;
|
||||||
|
int pix_x_unit;
|
||||||
|
int pix_y_unit;
|
||||||
|
|
||||||
|
pixman_image_t *aa_mask_image;
|
||||||
|
int alpha_data_buffer;
|
||||||
|
|
||||||
|
pixman_op_t op = PIXMAN_OP_SRC; // _EVAS_RENDER_COPY
|
||||||
|
if (dc->render_op == _EVAS_RENDER_BLEND)
|
||||||
|
op = PIXMAN_OP_OVER;
|
||||||
|
pix_x = x0;
|
||||||
|
pix_y = y0;
|
||||||
|
|
||||||
|
if (dx < 0)
|
||||||
|
pix_x_unit = -1;
|
||||||
|
else
|
||||||
|
pix_x_unit = 1;
|
||||||
|
|
||||||
|
if (dy < 0)
|
||||||
|
pix_y_unit = -1;
|
||||||
|
else
|
||||||
|
pix_y_unit = 1;
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
if (y0 > y1)
|
||||||
|
EXCHANGE_POINTS(x0, y0, x1, y1);
|
||||||
|
|
||||||
|
dx = x1 - x0;
|
||||||
|
dy = y1 - y0;
|
||||||
|
|
||||||
|
if ((dx == 0) || (dy == 0) || (dx == dy) || (dx == -dy))
|
||||||
{
|
{
|
||||||
_evas_draw_simple_line(dst, dc, x0, y0, x1, y1);
|
_evas_draw_simple_line(dst, dc, x0, y0, x1, y1);
|
||||||
return;
|
return;
|
||||||
|
@ -590,6 +801,7 @@ _evas_draw_line_aa(RGBA_Image *dst, RGBA_Draw_Context *dc, int x0, int y0, int x
|
||||||
|
|
||||||
data = evas_cache_image_pixels(&dst->cache_entry);
|
data = evas_cache_image_pixels(&dst->cache_entry);
|
||||||
dstw = dst->cache_entry.w;
|
dstw = dst->cache_entry.w;
|
||||||
|
dsth = dst->cache_entry.h;
|
||||||
|
|
||||||
data += (dstw * cly) + clx;
|
data += (dstw * cly) + clx;
|
||||||
x0 -= clx;
|
x0 -= clx;
|
||||||
|
@ -609,9 +821,14 @@ _evas_draw_line_aa(RGBA_Image *dst, RGBA_Draw_Context *dc, int x0, int y0, int x
|
||||||
y = (yy >> 16);
|
y = (yy >> 16);
|
||||||
if (prev_y != y)
|
if (prev_y != y)
|
||||||
{
|
{
|
||||||
prev_y = y;
|
prev_y = y;
|
||||||
p += dh;
|
p += dh;
|
||||||
py += dely;
|
py += dely;
|
||||||
|
#ifdef HAVE_PIXMAN
|
||||||
|
# ifdef PIXMAN_LINE
|
||||||
|
pix_y += pix_y_unit;
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
if (!p1_in)
|
if (!p1_in)
|
||||||
{
|
{
|
||||||
|
@ -624,39 +841,109 @@ _evas_draw_line_aa(RGBA_Image *dst, RGBA_Draw_Context *dc, int x0, int y0, int x
|
||||||
}
|
}
|
||||||
if (px < clw)
|
if (px < clw)
|
||||||
{
|
{
|
||||||
aa = ((yy - (y << 16)) >> 8);
|
aa = ((yy - (y << 16)) >> 8);
|
||||||
if ((py) < clh)
|
if ((py) < clh)
|
||||||
pfunc(0, 255 - aa, color, p);
|
{
|
||||||
if ((py + 1) < clh)
|
#ifdef HAVE_PIXMAN
|
||||||
pfunc(0, aa, color, p + dstw);
|
# ifdef PIXMAN_LINE
|
||||||
}
|
alpha_data_buffer = 255 - aa;
|
||||||
|
aa_mask_image = pixman_image_create_bits(PIXMAN_a8, 1, 1,
|
||||||
next_x:
|
(uint32_t *)&alpha_data_buffer, 4);
|
||||||
yy += dyy;
|
|
||||||
px++;
|
if ((dst->pixman.im) && (dc->col.pixman_color_image ) &&
|
||||||
p++;
|
(!dc->mask.mask))
|
||||||
|
pixman_image_composite(PIXMAN_OP_OVER,
|
||||||
|
dc->col.pixman_color_image,
|
||||||
|
aa_mask_image, dst->pixman.im,
|
||||||
|
pix_x, pix_y, 0, 0,
|
||||||
|
pix_x, pix_y, 1, 1);
|
||||||
|
else if ((dst->pixman.im) && (dc->col.pixman_color_image) &&
|
||||||
|
(dc->mask.mask) )
|
||||||
|
pixman_image_composite(op, dc->col.pixman_color_image,
|
||||||
|
dc->mask.mask->pixman.im,
|
||||||
|
dst->pixman.im,
|
||||||
|
pix_x, pix_y, 0, 0,
|
||||||
|
pix_x, pix_y, 1, 1);
|
||||||
|
else
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
pfunc(0, 255 - aa, color, p);
|
||||||
|
#ifdef HAVE_PIXMAN
|
||||||
|
# ifdef PIXMAN_LINE
|
||||||
|
pixman_image_unref(aa_mask_image);
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
if ((py + 1) < clh)
|
||||||
|
{
|
||||||
|
#ifdef HAVE_PIXMAN
|
||||||
|
# ifdef PIXMAN_LINE
|
||||||
|
alpha_data_buffer = aa;
|
||||||
|
aa_mask_image = pixman_image_create_bits(PIXMAN_a8, 1, 1,
|
||||||
|
(uint32_t *)&alpha_data_buffer, 4);
|
||||||
|
|
||||||
|
if ((dst->pixman.im) && (dc->col.pixman_color_image) &&
|
||||||
|
(!dc->mask.mask))
|
||||||
|
pixman_image_composite(PIXMAN_OP_OVER,
|
||||||
|
dc->col.pixman_color_image,
|
||||||
|
aa_mask_image, dst->pixman.im,
|
||||||
|
pix_x, pix_y + 1, 0, 0,
|
||||||
|
pix_x, pix_y + 1, 1, 1);
|
||||||
|
else if ((dst->pixman.im) && (dc->col.pixman_color_image) &&
|
||||||
|
(dc->mask.mask))
|
||||||
|
pixman_image_composite(op, dc->col.pixman_color_image,
|
||||||
|
dc->mask.mask->pixman.im,
|
||||||
|
dst->pixman.im,
|
||||||
|
pix_x, pix_y + 1, 0, 0,
|
||||||
|
pix_x, pix_y + 1, 1, 1);
|
||||||
|
else
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
pfunc(0, aa, color, p + dstw);
|
||||||
|
#ifdef HAVE_PIXMAN
|
||||||
|
# ifdef PIXMAN_LINE
|
||||||
|
pixman_image_unref(aa_mask_image);
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
next_x:
|
||||||
|
yy += dyy;
|
||||||
|
px++;
|
||||||
|
p++;
|
||||||
|
#ifdef HAVE_PIXMAN
|
||||||
|
# ifdef PIXMAN_LINE
|
||||||
|
pix_x += pix_x_unit;
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* steep: y-parametric */
|
/* steep: y-parametric */
|
||||||
SETUP_LINE_STEEP;
|
SETUP_LINE_STEEP;
|
||||||
|
|
||||||
while (py < by)
|
while (py < by)
|
||||||
{
|
{
|
||||||
DATA8 aa;
|
DATA8 aa;
|
||||||
|
|
||||||
x = (xx >> 16);
|
x = (xx >> 16);
|
||||||
if (prev_x != x)
|
if (prev_x != x)
|
||||||
{
|
{
|
||||||
prev_x = x;
|
prev_x = x;
|
||||||
px += delx;
|
px += delx;
|
||||||
p += delx;
|
p += delx;
|
||||||
|
#ifdef HAVE_PIXMAN
|
||||||
|
# ifdef PIXMAN_LINE
|
||||||
|
pix_x += pix_x_unit;
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
if (!p1_in)
|
if (!p1_in)
|
||||||
{
|
{
|
||||||
if ((px < 0) && (delx < 0)) return;
|
if ((px < 0) && (delx < 0)) return;
|
||||||
if ((px > rx) && (delx > 0)) return;
|
if ((px > rx) && (delx > 0)) return;
|
||||||
}
|
}
|
||||||
if (!p0_in)
|
if (!p0_in)
|
||||||
{
|
{
|
||||||
|
@ -664,15 +951,80 @@ _evas_draw_line_aa(RGBA_Image *dst, RGBA_Draw_Context *dc, int x0, int y0, int x
|
||||||
}
|
}
|
||||||
if (py < clh)
|
if (py < clh)
|
||||||
{
|
{
|
||||||
aa = ((xx - (x << 16)) >> 8);
|
aa = ((xx - (x << 16)) >> 8);
|
||||||
if ((px) < clw)
|
if ((px) < clw)
|
||||||
pfunc(0, 255 - aa, color, p);
|
{
|
||||||
if ((px + 1) < clw)
|
#ifdef HAVE_PIXMAN
|
||||||
pfunc(0, aa, color, p + 1);
|
# ifdef PIXMAN_LINE
|
||||||
}
|
alpha_data_buffer = 255 - aa;
|
||||||
|
aa_mask_image = pixman_image_create_bits(PIXMAN_a8, 1, 1, (uint32_t *)&alpha_data_buffer, 4);
|
||||||
|
|
||||||
|
if ((dst->pixman.im) && (dc->col.pixman_color_image) &&
|
||||||
|
(!dc->mask.mask))
|
||||||
|
pixman_image_composite(PIXMAN_OP_OVER,
|
||||||
|
dc->col.pixman_color_image,
|
||||||
|
aa_mask_image, dst->pixman.im,
|
||||||
|
pix_x, pix_y, 0, 0,
|
||||||
|
pix_x, pix_y, 1, 1);
|
||||||
|
else if ((dst->pixman.im) && (dc->col.pixman_color_image) &&
|
||||||
|
(dc->mask.mask))
|
||||||
|
pixman_image_composite(op, dc->col.pixman_color_image,
|
||||||
|
dc->mask.mask->pixman.im,
|
||||||
|
dst->pixman.im,
|
||||||
|
pix_x, pix_y, 0, 0,
|
||||||
|
pix_x, pix_y, 1, 1);
|
||||||
|
else
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
pfunc(0, 255 - aa, color, p);
|
||||||
|
#ifdef HAVE_PIXMAN
|
||||||
|
# ifdef PIXMAN_LINE
|
||||||
|
pixman_image_unref(aa_mask_image);
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
}
|
||||||
|
if ((px + 1) < clw)
|
||||||
|
{
|
||||||
|
#ifdef HAVE_PIXMAN
|
||||||
|
# ifdef PIXMAN_LINE
|
||||||
|
alpha_data_buffer = aa;
|
||||||
|
aa_mask_image = pixman_image_create_bits(PIXMAN_a8, 1, 1,
|
||||||
|
(uint32_t *)&alpha_data_buffer, 4);
|
||||||
|
|
||||||
|
if ((dst->pixman.im) && (dc->col.pixman_color_image) &&
|
||||||
|
(!dc->mask.mask))
|
||||||
|
pixman_image_composite(PIXMAN_OP_OVER,
|
||||||
|
dc->col.pixman_color_image,
|
||||||
|
aa_mask_image, dst->pixman.im,
|
||||||
|
pix_x + 1, pix_y, 0, 0,
|
||||||
|
pix_x + 1, pix_y, 1, 1);
|
||||||
|
else if ((dst->pixman.im) && (dc->col.pixman_color_image) &&
|
||||||
|
(dc->mask.mask))
|
||||||
|
pixman_image_composite(op, dc->col.pixman_color_image,
|
||||||
|
dc->mask.mask->pixman.im,
|
||||||
|
dst->pixman.im,
|
||||||
|
pix_x + 1, pix_y, 0, 0,
|
||||||
|
pix_x + 1, pix_y, 1, 1);
|
||||||
|
else
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
pfunc(0, aa, color, p + 1);
|
||||||
|
#ifdef HAVE_PIXMAN
|
||||||
|
# ifdef PIXMAN_LINE
|
||||||
|
pixman_image_unref(aa_mask_image);
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
}
|
||||||
next_y:
|
next_y:
|
||||||
xx += dxx;
|
xx += dxx;
|
||||||
py++;
|
py++;
|
||||||
p += dstw;
|
p += dstw;
|
||||||
|
#ifdef HAVE_PIXMAN
|
||||||
|
# ifdef PIXMAN_LINE
|
||||||
|
pix_y += pix_y_unit;
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -133,6 +133,14 @@ evas_common_polygon_draw(RGBA_Image *dst, RGBA_Draw_Context *dc, RGBA_Polygon_Po
|
||||||
int ext_x, ext_y, ext_w, ext_h;
|
int ext_x, ext_y, ext_w, ext_h;
|
||||||
int *sorted_index;
|
int *sorted_index;
|
||||||
|
|
||||||
|
#ifdef HAVE_PIXMAN
|
||||||
|
# ifdef PIXMAN_POLY
|
||||||
|
pixman_op_t op = PIXMAN_OP_SRC; // _EVAS_RENDER_COPY
|
||||||
|
if (dc->render_op == _EVAS_RENDER_BLEND)
|
||||||
|
op = PIXMAN_OP_OVER;
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
ext_x = 0;
|
ext_x = 0;
|
||||||
ext_y = 0;
|
ext_y = 0;
|
||||||
ext_w = dst->cache_entry.w;
|
ext_w = dst->cache_entry.w;
|
||||||
|
@ -279,10 +287,30 @@ evas_common_polygon_draw(RGBA_Image *dst, RGBA_Draw_Context *dc, RGBA_Polygon_Po
|
||||||
if (((span->y) % dc->sli.h) == dc->sli.y)
|
if (((span->y) % dc->sli.h) == dc->sli.y)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
ptr = dst->image.data + (span->y * (dst->cache_entry.w)) + span->x;
|
#ifdef HAVE_PIXMAN
|
||||||
func(NULL, NULL, dc->col.col, ptr, span->w);
|
# ifdef PIXMAN_POLY
|
||||||
}
|
if ((dst->pixman.im) && (dc->col.pixman_color_image) &&
|
||||||
}
|
(!dc->mask.mask))
|
||||||
|
pixman_image_composite(op, dc->col.pixman_color_image,
|
||||||
|
NULL, dst->pixman.im,
|
||||||
|
span->x, span->y, 0, 0,
|
||||||
|
span->x, span->y, span->w, 1);
|
||||||
|
else if ((dst->pixman.im) && (dc->col.pixman_color_image) &&
|
||||||
|
(dc->mask.mask))
|
||||||
|
pixman_image_composite(op, dc->col.pixman_color_image,
|
||||||
|
dc->mask.mask->pixman.im,
|
||||||
|
dst->pixman.im,
|
||||||
|
span->x, span->y, 0, 0,
|
||||||
|
span->x, span->y, span->w, 1);
|
||||||
|
else
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
ptr = dst->image.data + (span->y * (dst->cache_entry.w)) + span->x;
|
||||||
|
func(NULL, NULL, dc->col.col, ptr, span->w);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
while (spans)
|
while (spans)
|
||||||
{
|
{
|
||||||
span = (RGBA_Span *)spans;
|
span = (RGBA_Span *)spans;
|
||||||
|
|
|
@ -58,16 +58,34 @@ rectangle_draw_internal(RGBA_Image *dst, RGBA_Draw_Context *dc, int x, int y, in
|
||||||
RECTS_CLIP_TO_RECT(x, y, w, h, dc->clip.x, dc->clip.y, dc->clip.w, dc->clip.h);
|
RECTS_CLIP_TO_RECT(x, y, w, h, dc->clip.x, dc->clip.y, dc->clip.w, dc->clip.h);
|
||||||
if ((w <= 0) || (h <= 0)) return;
|
if ((w <= 0) || (h <= 0)) return;
|
||||||
|
|
||||||
func = evas_common_gfx_func_composite_color_span_get(dc->col.col, dst, w, dc->render_op);
|
#ifdef HAVE_PIXMAN
|
||||||
ptr = dst->image.data + (y * dst->cache_entry.w) + x;
|
# ifdef PIXMAN_RECT
|
||||||
for (yy = 0; yy < h; yy++)
|
pixman_op_t op = PIXMAN_OP_SRC; // _EVAS_RENDER_COPY
|
||||||
|
|
||||||
|
if (dc->render_op == _EVAS_RENDER_BLEND)
|
||||||
|
op = PIXMAN_OP_OVER;
|
||||||
|
|
||||||
|
if ((dst->pixman.im) && (dc->col.pixman_color_image))
|
||||||
{
|
{
|
||||||
#ifdef EVAS_SLI
|
pixman_image_composite(op, dc->col.pixman_color_image, NULL,
|
||||||
if (((yy + y) % dc->sli.h) == dc->sli.y)
|
dst->pixman.im, x, y, 0, 0,
|
||||||
|
x, y, w, h);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
# endif
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
func(NULL, NULL, dc->col.col, ptr, w);
|
func = evas_common_gfx_func_composite_color_span_get(dc->col.col, dst, w, dc->render_op);
|
||||||
}
|
ptr = dst->image.data + (y * dst->cache_entry.w) + x;
|
||||||
ptr += dst->cache_entry.w;
|
for (yy = 0; yy < h; yy++)
|
||||||
|
{
|
||||||
|
#ifdef EVAS_SLI
|
||||||
|
if (((yy + y) % dc->sli.h) == dc->sli.y)
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
func(NULL, NULL, dc->col.col, ptr, w);
|
||||||
|
}
|
||||||
|
ptr += dst->cache_entry.w;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -154,7 +154,7 @@ scale_rgba_in_to_out_clip_sample_internal(RGBA_Image *src, RGBA_Image *dst,
|
||||||
dst_clip_w = m_clip_w;
|
dst_clip_w = m_clip_w;
|
||||||
dst_clip_h = m_clip_h;
|
dst_clip_h = m_clip_h;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dst_clip_x < dst_region_x)
|
if (dst_clip_x < dst_region_x)
|
||||||
{
|
{
|
||||||
dst_clip_w += dst_clip_x - dst_region_x;
|
dst_clip_w += dst_clip_x - dst_region_x;
|
||||||
|
@ -258,7 +258,7 @@ scale_rgba_in_to_out_clip_sample_internal(RGBA_Image *src, RGBA_Image *dst,
|
||||||
func = evas_common_gfx_func_composite_pixel_mask_span_get(src, dst, dst_clip_w, dc->render_op);
|
func = evas_common_gfx_func_composite_pixel_mask_span_get(src, dst, dst_clip_w, dc->render_op);
|
||||||
maskobj = dc->mask.mask;
|
maskobj = dc->mask.mask;
|
||||||
mask = maskobj->mask.mask;
|
mask = maskobj->mask.mask;
|
||||||
/*
|
/*
|
||||||
if (1 || dst_region_w > src_region_w || dst_region_h > src_region_h){
|
if (1 || dst_region_w > src_region_w || dst_region_h > src_region_h){
|
||||||
printf("Mask w/h: %d/%d\n",maskobj->cache_entry.w,
|
printf("Mask w/h: %d/%d\n",maskobj->cache_entry.w,
|
||||||
maskobj->cache_entry.h);
|
maskobj->cache_entry.h);
|
||||||
|
@ -276,26 +276,47 @@ scale_rgba_in_to_out_clip_sample_internal(RGBA_Image *src, RGBA_Image *dst,
|
||||||
if ((dst_region_w == src_region_w) && (dst_region_h == src_region_h))
|
if ((dst_region_w == src_region_w) && (dst_region_h == src_region_h))
|
||||||
{
|
{
|
||||||
#ifdef HAVE_PIXMAN
|
#ifdef HAVE_PIXMAN
|
||||||
if ((1) &&
|
# ifdef PIXMAN_IMAGE_SCALE_SAMPLE
|
||||||
(src->pixman.im) && (dst->pixman.im) &&
|
if ((src->pixman.im) && (dst->pixman.im) && (!dc->mask.mask) &&
|
||||||
((!dc->mul.use) ||
|
((!dc->mul.use) ||
|
||||||
((dc->mul.use) && (dc->mul.col == 0xffffffff))) &&
|
((dc->mul.use) && (dc->mul.col == 0xffffffff))) &&
|
||||||
((dc->render_op == _EVAS_RENDER_COPY) ||
|
((dc->render_op == _EVAS_RENDER_COPY) ||
|
||||||
(dc->render_op == _EVAS_RENDER_BLEND))
|
(dc->render_op == _EVAS_RENDER_BLEND)))
|
||||||
)
|
|
||||||
{
|
{
|
||||||
pixman_op_t op = PIXMAN_OP_SRC; // _EVAS_RENDER_COPY
|
pixman_op_t op = PIXMAN_OP_SRC; // _EVAS_RENDER_COPY
|
||||||
if (dc->render_op == _EVAS_RENDER_BLEND) op = PIXMAN_OP_OVER;
|
if (dc->render_op == _EVAS_RENDER_BLEND)
|
||||||
|
op = PIXMAN_OP_OVER;
|
||||||
|
|
||||||
pixman_image_composite(op,
|
pixman_image_composite(op,
|
||||||
src->pixman.im, NULL,
|
src->pixman.im, NULL,
|
||||||
dst->pixman.im,
|
dst->pixman.im,
|
||||||
(dst_clip_x - dst_region_x) + src_region_x,
|
(dst_clip_x - dst_region_x) + src_region_x,
|
||||||
(dst_clip_y - dst_region_y) + src_region_y,
|
(dst_clip_y - dst_region_y) + src_region_y,
|
||||||
0, 0,
|
0, 0,
|
||||||
dst_clip_x, dst_clip_y,
|
dst_clip_x, dst_clip_y,
|
||||||
|
dst_clip_w, dst_clip_h);
|
||||||
|
}
|
||||||
|
else if ((src->pixman.im) && (dst->pixman.im) &&
|
||||||
|
(dc->mask.mask) && (dc->mask.mask->pixman.im) &&
|
||||||
|
((dc->render_op == _EVAS_RENDER_COPY) ||
|
||||||
|
(dc->render_op == _EVAS_RENDER_BLEND)))
|
||||||
|
{
|
||||||
|
// In case of pixel and color operation.
|
||||||
|
pixman_op_t op = PIXMAN_OP_SRC; // _EVAS_RENDER_COPY
|
||||||
|
if (dc->render_op == _EVAS_RENDER_BLEND)
|
||||||
|
op = PIXMAN_OP_OVER;
|
||||||
|
|
||||||
|
pixman_image_composite(op,
|
||||||
|
src->pixman.im, dc->mask.mask->pixman.im,
|
||||||
|
dst->pixman.im,
|
||||||
|
(dst_clip_x - dst_region_x) + src_region_x,
|
||||||
|
(dst_clip_y - dst_region_y) + src_region_y,
|
||||||
|
0, 0,
|
||||||
|
dst_clip_x, dst_clip_y,
|
||||||
dst_clip_w, dst_clip_h);
|
dst_clip_w, dst_clip_h);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
# endif
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
ptr = src_data + ((dst_clip_y - dst_region_y + src_region_y) * src_w) + (dst_clip_x - dst_region_x) + src_region_x;
|
ptr = src_data + ((dst_clip_y - dst_region_y + src_region_y) * src_w) + (dst_clip_x - dst_region_x) + src_region_x;
|
||||||
|
@ -322,59 +343,59 @@ scale_rgba_in_to_out_clip_sample_internal(RGBA_Image *src, RGBA_Image *dst,
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* fill scale tables */
|
/* fill scale tables */
|
||||||
for (x = 0; x < dst_clip_w; x++)
|
for (x = 0; x < dst_clip_w; x++)
|
||||||
lin_ptr[x] = (((x + dst_clip_x - dst_region_x) * src_region_w) / dst_region_w) + src_region_x;
|
lin_ptr[x] = (((x + dst_clip_x - dst_region_x) * src_region_w) / dst_region_w) + src_region_x;
|
||||||
for (y = 0; y < dst_clip_h; y++)
|
for (y = 0; y < dst_clip_h; y++)
|
||||||
row_ptr[y] = src_data + (((((y + dst_clip_y - dst_region_y) * src_region_h) / dst_region_h)
|
row_ptr[y] = src_data + (((((y + dst_clip_y - dst_region_y) * src_region_h) / dst_region_h)
|
||||||
+ src_region_y) * src_w);
|
+ src_region_y) * src_w);
|
||||||
/* scale to dst */
|
/* scale to dst */
|
||||||
dptr = dst_ptr;
|
dptr = dst_ptr;
|
||||||
#ifdef DIRECT_SCALE
|
#ifdef DIRECT_SCALE
|
||||||
if ((!src->cache_entry.flags.alpha) &&
|
if ((!src->cache_entry.flags.alpha) &&
|
||||||
(!dst->cache_entry.flags.alpha) &&
|
(!dst->cache_entry.flags.alpha) &&
|
||||||
(!dc->mul.use))
|
(!dc->mul.use))
|
||||||
{
|
{
|
||||||
for (y = 0; y < dst_clip_h; y++)
|
for (y = 0; y < dst_clip_h; y++)
|
||||||
{
|
{
|
||||||
#ifdef EVAS_SLI
|
# ifdef EVAS_SLI
|
||||||
if (((y + dst_clip_y) % dc->sli.h) == dc->sli.y)
|
if (((y + dst_clip_y) % dc->sli.h) == dc->sli.y)
|
||||||
#endif
|
# endif
|
||||||
{
|
{
|
||||||
dst_ptr = dptr;
|
dst_ptr = dptr;
|
||||||
for (x = 0; x < dst_clip_w; x++)
|
for (x = 0; x < dst_clip_w; x++)
|
||||||
{
|
{
|
||||||
ptr = row_ptr[y] + lin_ptr[x];
|
ptr = row_ptr[y] + lin_ptr[x];
|
||||||
*dst_ptr = *ptr;
|
*dst_ptr = *ptr;
|
||||||
dst_ptr++;
|
dst_ptr++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
dptr += dst_w;
|
dptr += dst_w;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
/* a scanline buffer */
|
/* a scanline buffer */
|
||||||
buf = alloca(dst_clip_w * sizeof(DATA32));
|
buf = alloca(dst_clip_w * sizeof(DATA32));
|
||||||
for (y = 0; y < dst_clip_h; y++)
|
for (y = 0; y < dst_clip_h; y++)
|
||||||
{
|
{
|
||||||
#ifdef EVAS_SLI
|
#ifdef EVAS_SLI
|
||||||
if (((y + dst_clip_y) % dc->sli.h) == dc->sli.y)
|
if (((y + dst_clip_y) % dc->sli.h) == dc->sli.y)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
dst_ptr = buf;
|
dst_ptr = buf;
|
||||||
for (x = 0; x < dst_clip_w; x++)
|
for (x = 0; x < dst_clip_w; x++)
|
||||||
{
|
{
|
||||||
ptr = row_ptr[y] + lin_ptr[x];
|
ptr = row_ptr[y] + lin_ptr[x];
|
||||||
*dst_ptr = *ptr;
|
*dst_ptr = *ptr;
|
||||||
dst_ptr++;
|
dst_ptr++;
|
||||||
}
|
}
|
||||||
/* * blend here [clip_w *] buf -> dptr * */
|
/* * blend here [clip_w *] buf -> dptr * */
|
||||||
func(buf, NULL, dc->mul.col, dptr, dst_clip_w);
|
func(buf, NULL, dc->mul.col, dptr, dst_clip_w);
|
||||||
}
|
}
|
||||||
dptr += dst_w;
|
dptr += dst_w;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
#ifndef EVAS_COMMON_H
|
#ifndef EVAS_COMMON_H
|
||||||
#define EVAS_COMMON_H
|
#define EVAS_COMMON_H
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
//#ifdef HAVE_CONFIG_H
|
||||||
# include "config.h" /* so that EAPI in Evas.h is correctly defined */
|
#include "config.h" /* so that EAPI in Evas.h is correctly defined */
|
||||||
#endif
|
//#endif
|
||||||
|
|
||||||
#ifdef HAVE_EVIL
|
#ifdef HAVE_EVIL
|
||||||
# include <Evil.h>
|
# include <Evil.h>
|
||||||
|
@ -322,6 +322,21 @@ void *alloca (size_t);
|
||||||
#define pld(addr, off)
|
#define pld(addr, off)
|
||||||
#endif /* __ARMEL__ */
|
#endif /* __ARMEL__ */
|
||||||
|
|
||||||
|
// these here are in config.h - just here for documentation
|
||||||
|
//#ifdef __ARM_ARCH__
|
||||||
|
// *IF* you enable pixman, this determines which things pixman will do
|
||||||
|
////#define PIXMAN_FONT 1
|
||||||
|
////#define PIXMAN_RECT 1
|
||||||
|
////#define PIXMAN_LINE 1
|
||||||
|
////#define PIXMAN_POLY 1
|
||||||
|
//#define PIXMAN_IMAGE 1
|
||||||
|
//#define PIXMAN_IMAGE_SCALE_SAMPLE 1
|
||||||
|
//#endif
|
||||||
|
// not related to pixman but an alternate rotate code
|
||||||
|
//#define TILE_ROTATE 1
|
||||||
|
|
||||||
|
#define TILE_CACHE_LINE_SIZE 64
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
#define UNROLL2(op...) op op
|
#define UNROLL2(op...) op op
|
||||||
|
@ -662,6 +677,9 @@ struct _RGBA_Draw_Context
|
||||||
DATA32 col;
|
DATA32 col;
|
||||||
} mul;
|
} mul;
|
||||||
struct {
|
struct {
|
||||||
|
#ifdef HAVE_PIXMAN
|
||||||
|
pixman_image_t *pixman_color_image;
|
||||||
|
#endif
|
||||||
DATA32 col;
|
DATA32 col;
|
||||||
} col;
|
} col;
|
||||||
struct RGBA_Draw_Context_clip {
|
struct RGBA_Draw_Context_clip {
|
||||||
|
@ -1016,14 +1034,14 @@ struct _Tilebuf
|
||||||
int x, y, w, h;
|
int x, y, w, h;
|
||||||
} prev_add, prev_del;
|
} prev_add, prev_del;
|
||||||
#ifdef RECTUPDATE
|
#ifdef RECTUPDATE
|
||||||
/*
|
/*
|
||||||
Regionbuf *rb;
|
Regionbuf *rb;
|
||||||
*/
|
*/
|
||||||
#elif defined(EVAS_RECT_SPLIT)
|
#elif defined(EVAS_RECT_SPLIT)
|
||||||
int need_merge;
|
int need_merge;
|
||||||
list_t rects;
|
list_t rects;
|
||||||
#else
|
#else
|
||||||
/*
|
/*
|
||||||
struct {
|
struct {
|
||||||
int w, h;
|
int w, h;
|
||||||
Tilebuf_Tile *tiles;
|
Tilebuf_Tile *tiles;
|
||||||
|
|
|
@ -579,6 +579,8 @@ evas_software_xlib_outbuf_new_region_for_update(Outbuf *buf, int x, int y, int w
|
||||||
free(obr);
|
free(obr);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
im->cache_entry.w = w;
|
||||||
|
im->cache_entry.h = h;
|
||||||
im->cache_entry.flags.alpha |= alpha ? 1 : 0;
|
im->cache_entry.flags.alpha |= alpha ? 1 : 0;
|
||||||
evas_cache_image_surface_alloc(&im->cache_entry, w, h);
|
evas_cache_image_surface_alloc(&im->cache_entry, w, h);
|
||||||
im->extended_info = obr;
|
im->extended_info = obr;
|
||||||
|
|
Loading…
Reference in New Issue