patches that i said were in - commit. (see my reply emails)

also finish off a TODO item or 2


SVN revision: 23267
This commit is contained in:
Carsten Haitzler 2006-06-07 23:30:15 +00:00
parent 3a6f861ed6
commit d7eee7eee6
30 changed files with 729 additions and 1393 deletions

View File

@ -1337,7 +1337,7 @@ EAPI int ecore_x_netwm_window_state_get(Ecore_X_Window win, Ecor
EAPI void ecore_x_netwm_window_type_set(Ecore_X_Window win, Ecore_X_Window_Type type);
EAPI int ecore_x_netwm_window_type_get(Ecore_X_Window win, Ecore_X_Window_Type *type);
EAPI int ecore_x_netwm_allowed_action_isset(Ecore_X_Window win, Ecore_X_Action action);
EAPI void ecore_x_netwm_allowed_action_set(Ecore_X_Window win, Ecore_X_Action action, int on);
EAPI void ecore_x_netwm_allowed_action_set(Ecore_X_Window win, Ecore_X_Action *action, unsigned int num);
EAPI int ecore_x_netwm_allowed_action_get(Ecore_X_Window win, Ecore_X_Action **action, unsigned int *num);
EAPI void ecore_x_netwm_opacity_set(Ecore_X_Window win, unsigned int opacity);
EAPI int ecore_x_netwm_opacity_get(Ecore_X_Window win, unsigned int *opacity);

View File

@ -1074,15 +1074,26 @@ ecore_x_netwm_allowed_action_isset(Ecore_X_Window win, Ecore_X_Action action)
/* FIXME: Set complete list */
EAPI void
ecore_x_netwm_allowed_action_set(Ecore_X_Window win, Ecore_X_Action action, int on)
ecore_x_netwm_allowed_action_set(Ecore_X_Window win, Ecore_X_Action *action, unsigned int num)
{
Ecore_X_Atom atom;
Ecore_X_Atom *set;
int i;
atom = _ecore_x_netwm_action_atom_get(action);
on = (on) ? ECORE_X_PROP_LIST_ADD : ECORE_X_PROP_LIST_REMOVE;
if (!num)
{
ecore_x_window_prop_property_del(win, ECORE_X_ATOM_NET_WM_ALLOWED_ACTIONS);
return;
}
ecore_x_window_prop_atom_list_change(win, ECORE_X_ATOM_NET_WM_ALLOWED_ACTIONS,
atom, on);
set = malloc(num * sizeof(Ecore_X_Atom));
if (!set) return;
for (i = 0; i < num; i++)
set[i] = _ecore_x_netwm_action_atom_get(action[i]);
ecore_x_window_prop_atom_set(win, ECORE_X_ATOM_NET_WM_ALLOWED_ACTIONS, set, num);
free(set);
}
EAPI int

View File

@ -378,7 +378,7 @@ embryo_program_native_call_add(Embryo_Program *ep, char *name, Embryo_Cell (*fun
int i, num;
if ((ep == NULL ) || (name == NULL) || (func == NULL)) return;
if (strlen(name) > sEXPMAX) return;
if (strlen(name) > sNAMEMAX) return;
hdr = (Embryo_Header *)ep->code;
if (hdr->defsize < 1) return;

View File

@ -1694,31 +1694,31 @@ AC_ARG_ENABLE(convert-32-rgb-rot-90,
# Setting have_valgrind to "no" seems pointless, but we just need to
# put something in as the 4th parameter, so configure doesn't abort
# when valgrind.pc isn't found.
#have_valgrind="no"
#PKG_CHECK_MODULES(VALGRIND, valgrind >= 2.4.0, have_valgrind=yes, have_valgrind=no)
#AC_ARG_ENABLE(valgrind,
# [ --enable-valgrind enable valgrind fixes to stop false reports], [
# if test x"$enableval" = x"yes" ; then
# have_valgrind="yes"
# else
# have_valgrind="no"
# VALGRIND_CFLAGS=""
# VALGRIND_LIBS=""
# fi
# ], [
# have_valgrind=$have_valgrind
# ]
#)
have_valgrind="no"
PKG_CHECK_MODULES(VALGRIND, valgrind >= 2.4.0, have_valgrind=yes, have_valgrind=no)
VALGRIND_LIBS="" # dont use LIBS
#if test x$have_valgrind = "xyes"; then
# AC_DEFINE(HAVE_VALGRIND, 1, [Valgrind support])
#fi
AC_ARG_ENABLE(valgrind,
[ --enable-valgrind enable valgrind fixes to stop false reports], [
if test x"$enableval" = x"yes" ; then
have_valgrind="yes"
else
have_valgrind="no"
VALGRIND_CFLAGS=""
fi
], [
have_valgrind=$have_valgrind
]
)
if test x$have_valgrind = "xyes"; then
AC_DEFINE(HAVE_VALGRIND, 1, [Valgrind support])
fi
#####################################################################
## Fill in flags
AC_SUBST(VALGRIND_CFLAGS)
AC_SUBST(VALGRIND_LIBS)
AC_SUBST(x_cflags)
AC_SUBST(x_libs)

View File

@ -129,7 +129,6 @@ evas_object_gradient_color_add(Evas_Object *obj, int r, int g, int b, int a, int
o->engine_data,
r, g, b, a,
distance);
if (a != 255) o->cur.gradient_opaque = 0;
o->gradient_changed = 1;
o->changed = 1;
evas_object_change(obj);
@ -158,7 +157,7 @@ evas_object_gradient_colors_clear(Evas_Object *obj)
o->engine_data);
o->gradient_changed = 1;
o->changed = 1;
o->cur.gradient_opaque = 1;
o->cur.gradient_opaque = 0;
evas_object_change(obj);
}
@ -201,7 +200,6 @@ evas_object_gradient_data_set(Evas_Object *obj, void *data, int len, int has_alp
o->engine_data,
data, len, has_alpha);
o->imported_data = 1;
if (has_alpha) o->cur.gradient_opaque = 0;
o->gradient_changed = 1;
o->changed = 1;
evas_object_change(obj);
@ -235,7 +233,7 @@ evas_object_gradient_data_unset(Evas_Object *obj)
obj->layer->evas->engine.data.context,
o->engine_data);
o->imported_data = 0;
o->cur.gradient_opaque = 1;
o->cur.gradient_opaque = 0;
o->gradient_changed = 1;
o->changed = 1;
evas_object_change(obj);
@ -736,16 +734,20 @@ evas_object_gradient_render(Evas_Object *obj, void *output, void *context, void
obj->cur.render_op);
if (o->engine_data)
{
if (o->gradient_changed)
obj->layer->evas->engine.func->gradient_map(output, context, o->engine_data,
o->cur.spread);
obj->layer->evas->engine.func->gradient_draw(output, context, surface,
o->engine_data,
obj->cur.cache.geometry.x + x,
obj->cur.cache.geometry.y + y,
obj->cur.cache.geometry.w,
obj->cur.cache.geometry.h,
o->cur.angle, o->cur.spread);
o->engine_data = obj->layer->evas->engine.func->gradient_geometry_init(output, o->engine_data, o->cur.spread);
if (o->engine_data)
{
if (o->gradient_changed)
obj->layer->evas->engine.func->gradient_map(output, context, o->engine_data,
o->cur.spread);
obj->layer->evas->engine.func->gradient_draw(output, context, surface,
o->engine_data,
obj->cur.cache.geometry.x + x,
obj->cur.cache.geometry.y + y,
obj->cur.cache.geometry.w,
obj->cur.cache.geometry.h,
o->cur.angle, o->cur.spread);
}
}
}
@ -787,9 +789,6 @@ evas_object_gradient_render_pre(Evas_Object *obj)
o->changed = 1;
if (obj->cur.interpolation.color_space != obj->prev.interpolation.color_space)
o->gradient_changed = 1;
if ((obj->cur.render_op != EVAS_RENDER_COPY) &&
(obj->cur.cache.clip.a != 255))
o->cur.gradient_opaque = 0;
if (obj->cur.render_op != obj->prev.render_op)
o->changed = 1;
if (o->changed && o->engine_data)
@ -811,8 +810,10 @@ evas_object_gradient_render_pre(Evas_Object *obj)
o->engine_data = obj->layer->evas->engine.func->gradient_geometry_init(obj->layer->evas->engine.data.output, o->engine_data, o->cur.spread);
if (o->engine_data)
{
o->cur.gradient_opaque &= !(obj->layer->evas->engine.func->gradient_alpha_get(obj->layer->evas->engine.data.output, o->engine_data, o->cur.spread, obj->cur.render_op));
o->cur.gradient_opaque = !(obj->layer->evas->engine.func->gradient_alpha_get(obj->layer->evas->engine.data.output, o->engine_data, o->cur.spread, obj->cur.render_op));
}
if (obj->cur.cache.clip.a != 255)
o->cur.gradient_opaque = 0;
}
/* now figure what changed and add draw rects */
/* if it just became visible or invisible */
@ -909,9 +910,6 @@ evas_object_gradient_is_opaque(Evas_Object *obj)
/* currently fully opaque over the entire gradient it occupies */
o = (Evas_Object_Gradient *)(obj->object_data);
if (!o->engine_data) return 0;
o->cur.gradient_opaque &=
!(obj->layer->evas->engine.func->gradient_alpha_get(obj->layer->evas->engine.data.output,
o->engine_data, o->cur.spread, obj->cur.render_op));
return o->cur.gradient_opaque;
}

View File

@ -1389,6 +1389,9 @@ evas_object_image_render(Evas_Object *obj, void *output, void *context, void *su
}
o->dirty_pixels = 0;
}
o->engine_data = obj->layer->evas->engine.func->image_border_set(output, o->engine_data,
o->cur.border.l, o->cur.border.r,
o->cur.border.t, o->cur.border.b);
idx = evas_object_image_figure_x_fill(obj, o->cur.fill.x, o->cur.fill.w, &idw);
idy = evas_object_image_figure_y_fill(obj, o->cur.fill.y, o->cur.fill.h, &idh);
if (idw < 1.0) idw = 1.0;

View File

@ -325,8 +325,22 @@ evas_object_above_get(Evas_Object *obj)
return NULL;
MAGIC_CHECK_END();
if (obj->smart.parent)
return (Evas_Object *)(((Evas_Object_List *)(obj))->next);
return evas_object_above_get_internal(obj);
{
do
{
obj = (Evas_Object *)(((Evas_Object_List *)(obj))->next);
if ((obj) && (!obj->delete_me)) return obj;
}
while (obj);
return NULL;
}
obj = evas_object_above_get_internal(obj);
while (obj)
{
if (!obj->delete_me) return obj;
obj = evas_object_above_get_internal(obj);
}
return NULL;
}
/**
@ -342,8 +356,22 @@ evas_object_below_get(Evas_Object *obj)
return NULL;
MAGIC_CHECK_END();
if (obj->smart.parent)
return (Evas_Object *)(((Evas_Object_List *)(obj))->prev);
return evas_object_below_get_internal(obj);
{
do
{
obj = (Evas_Object *)(((Evas_Object_List *)(obj))->prev);
if ((obj) && (!obj->delete_me)) return obj;
}
while (obj);
return NULL;
}
obj = evas_object_below_get_internal(obj);
while (obj)
{
if (!obj->delete_me) return obj;
obj = evas_object_below_get_internal(obj);
}
return NULL;
}
/**
@ -359,7 +387,16 @@ evas_object_bottom_get(Evas *e)
return NULL;
MAGIC_CHECK_END();
if (e->layers)
return e->layers->objects;
{
Evas_Object *obj;
obj = e->layers->objects;
while (obj)
{
if (!obj->delete_me) return obj;
obj = evas_object_above_get_internal(obj);
}
}
return NULL;
}
@ -372,7 +409,7 @@ evas_object_bottom_get(Evas *e)
EAPI Evas_Object *
evas_object_top_get(Evas *e)
{
Evas_Object *obj2 = NULL;
Evas_Object *obj = NULL;
Evas_Object_List *list;
Evas_Layer *layer;
@ -389,8 +426,14 @@ evas_object_top_get(Evas *e)
list = (Evas_Object_List *) layer->objects;
if (!list) return NULL;
obj2 = (Evas_Object *) list->last;
if (!obj2) return NULL;
obj = (Evas_Object *) list->last;
if (!obj) return NULL;
return obj2;
while (obj)
{
if (!obj->delete_me) return obj;
obj = evas_object_below_get_internal(obj);
}
return obj;
}

View File

@ -1 +1,186 @@
#include "evas_common.h"
void
evas_common_convert_hsv_to_rgb(float h, float s, float v, int *r, int *g, int *b)
{
int i;
float f;
v *= 255;
if (s == 0)
{
if (r) *r = v;
if (g) *g = v;
if (b) *b = v;
return;
}
h /= 60;
i = h;
f = h - i;
s *= v;
f *= s;
s = v - s;
switch (i)
{
case 1:
if (r) *r = v - f; if (g) *g = v; if (b) *b = s;
return;
case 2:
if (r) *r = s; if (g) *g = v; if (b) *b = s + f;
return;
case 3:
if (r) *r = s; if (g) *g = v - f; if (b) *b = v;
return;
case 4:
if (r) *r = s + f; if (g) *g = s; if (b) *b = v;
return;
case 5:
if (r) *r = v; if (g) *g = s; if (b) *b = v - f;
return;
default:
if (r) *r = v; if (g) *g = s + f; if (b) *b = s;
break;
}
}
void
evas_common_convert_rgb_to_hsv(int r, int g, int b, float *h, float *s, float *v)
{
int max, min, d = r - g;
//set min to MIN(g,r)
d = (d & (~(d >> 8)));
min = r - d;
//set max to MAX(g,r)
max = g + d;
//set min to MIN(b,min)
d = min - b;
min -= (d & (~(d >> 8)));
//set max to MAX(max,b)
d = b - max;
max += (d & (~(d >> 8)));
d = max - min;
if (v) *v = (max / 255.0);
if (!(max & d))
{
if (s) *s = 0;
if (h) *h = 0;
return;
}
if (s) *s = (d / (float)max);
if (r == max)
{
if (h)
{
*h = 60 * ((g - b) / (float)d);
if (*h < 0) *h += 360;
}
return;
}
if (g == max)
{
if (h)
{
*h = 120 + (60 * ((b - r) / (float)d));
if (*h < 0) *h += 360;
}
return;
}
if (h)
{
*h = 240 + (60 * ((r - g) / (float)d));
if (*h < 0) *h += 360;
}
}
void
evas_common_convert_hsv_to_rgb_int(int h, int s, int v, int *r, int *g, int *b)
{
int i, f;
if (!s)
{
*r = *g = *b = v;
return;
}
i = h / 255;
f = h - (i * 255);
s = (v * s) / 255;
f = (s * f) / 255;
s = v - s;
switch (i)
{
case 1:
*r = v - f; *g = v; *b = s;
return;
case 2:
*r = s; *g = v; *b = s + f;
return;
case 3:
*r = s; *g = v - f; *b = v;
return;
case 4:
*r = s + f; *g = s; *b = v;
return;
case 5:
*r = v; *g = s; *b = v - f;
return;
default:
*r = v; *g = s + f; *b = s;
break;
}
}
void
evas_common_convert_rgb_to_hsv_int(int r, int g, int b, int *h, int *s, int *v)
{
int min, max, d = r - g;
d = (d & (~(d >> 8)));
min = r - d;
max = g + d;
d = min - b;
min -= (d & (~(d >> 8)));
d = b - max;
max += (d & (~(d >> 8)));
d = max - min;
*v = max;
if (!(max & d))
{
*s = *h = 0;
return;
}
*s = ((d * 255) / max);
if (r == max)
{
*h = (((g - b) * 255) / d);
if (*h < 0) *h += 1530;
return;
}
if (g == max)
{
*h = 510 + (((b - r) * 255) / d);
if (*h < 0) *h += 1530;
return;
}
*h = 1020 + (((r - g) * 255) / d);
if (*h < 0) *h += 1530;
}

View File

@ -237,12 +237,12 @@ static int
angular_has_alpha(RGBA_Gradient *gr, int spread, int op)
{
if (!gr || (gr->type.geometer != &angular)) return 0;
if (gr->map.has_alpha)
if (gr->has_alpha | gr->map.has_alpha)
return 1;
if ( (op == _EVAS_RENDER_COPY) || (op == _EVAS_RENDER_COPY_REL) ||
(op == _EVAS_RENDER_MASK) || (op == _EVAS_RENDER_MUL) )
return 0;
if ((int)angular_data.an > 0)
if ((int)angular_data.an >= 0)
return 1;
if ( ((spread == _EVAS_TEXTURE_RESTRICT) ||
(spread == _EVAS_TEXTURE_RESTRICT_REFLECT) ||
@ -259,7 +259,7 @@ angular_has_mask(RGBA_Gradient *gr, int spread, int op)
if ( (op == _EVAS_RENDER_COPY) || (op == _EVAS_RENDER_COPY_REL) ||
(op == _EVAS_RENDER_MASK) || (op == _EVAS_RENDER_MUL) )
{
if ((int)angular_data.an > 0)
if ((int)angular_data.an >= 0)
return 1;
if ( ((spread == _EVAS_TEXTURE_RESTRICT) ||
(spread == _EVAS_TEXTURE_RESTRICT_REFLECT) ||
@ -469,6 +469,21 @@ angular_get_fill_func(RGBA_Gradient *gr, int spread, int op, unsigned char aa)
return sfunc;
}
#define SETUP_ANGULAR_FILL \
if (gdata->sx != gdata->s) \
{ \
axx = (gdata->s * axx) / gdata->sx; \
axy = (gdata->s * axy) / gdata->sx; \
} \
if (gdata->sy != gdata->s) \
{ \
ayy = (gdata->s * ayy) / gdata->sy; \
ayx = (gdata->s * ayx) / gdata->sy; \
} \
xx = (axx * x) + (axy * y); \
yy = (ayx * x) + (ayy * y);
static void
angular_reflect(DATA32 *map, int map_len, DATA32 *dst, DATA8 *mask, int dst_len,
int x, int y, int axx, int axy, int ayx, int ayy, void *params_data)
@ -479,19 +494,7 @@ angular_reflect(DATA32 *map, int map_len, DATA32 *dst, DATA8 *mask, int dst_len,
int ss = (gdata->s) << 16;
float off = gdata->off * (map_len - 1);
if (gdata->sx != gdata->s)
{
axx = (gdata->s * axx) / gdata->sx;
axy = (gdata->s * axy) / gdata->sx;
}
if (gdata->sy != gdata->s)
{
ayy = (gdata->s * ayy) / gdata->sy;
ayx = (gdata->s * ayx) / gdata->sy;
}
xx = (axx * x) + (axy * y);
yy = (ayx * x) + (ayy * y);
SETUP_ANGULAR_FILL
while (dst < dst_end)
{
@ -523,19 +526,7 @@ angular_reflect_aa(DATA32 *map, int map_len, DATA32 *dst, DATA8 *mask, int dst_l
int ss = (gdata->s) << 16;
float off = gdata->off * (map_len - 1);
if (gdata->sx != gdata->s)
{
axx = (gdata->s * axx) / gdata->sx;
axy = (gdata->s * axy) / gdata->sx;
}
if (gdata->sy != gdata->s)
{
ayy = (gdata->s * ayy) / gdata->sy;
ayx = (gdata->s * ayx) / gdata->sy;
}
xx = (axx * x) + (axy * y);
yy = (ayx * x) + (ayy * y);
SETUP_ANGULAR_FILL
while (dst < dst_end)
{
@ -571,19 +562,7 @@ angular_reflect_annulus(DATA32 *map, int map_len, DATA32 *dst, DATA8 *mask, int
int r1 = gdata->s, r0 = gdata->an * r1;
float off = gdata->off * (map_len - 1);
if (gdata->sx != gdata->s)
{
axx = (gdata->s * axx) / gdata->sx;
axy = (gdata->s * axy) / gdata->sx;
}
if (gdata->sy != gdata->s)
{
ayy = (gdata->s * ayy) / gdata->sy;
ayx = (gdata->s * ayx) / gdata->sy;
}
xx = (axx * x) + (axy * y);
yy = (ayx * x) + (ayy * y);
SETUP_ANGULAR_FILL
while (dst < dst_end)
{
@ -623,19 +602,7 @@ angular_reflect_aa_annulus(DATA32 *map, int map_len, DATA32 *dst, DATA8 *mask, i
int rr0 = r0 << 16, rr1 = r1 << 16;
float off = gdata->off * (map_len - 1);
if (gdata->sx != gdata->s)
{
axx = (gdata->s * axx) / gdata->sx;
axy = (gdata->s * axy) / gdata->sx;
}
if (gdata->sy != gdata->s)
{
ayy = (gdata->s * ayy) / gdata->sy;
ayx = (gdata->s * ayx) / gdata->sy;
}
xx = (axx * x) + (axy * y);
yy = (ayx * x) + (ayy * y);
SETUP_ANGULAR_FILL
while (dst < dst_end)
{
@ -689,19 +656,7 @@ angular_reflect_masked_annulus(DATA32 *map, int map_len, DATA32 *dst, DATA8 *mas
int r1 = gdata->s, r0 = gdata->an * r1;
float off = gdata->off * (map_len - 1);
if (gdata->sx != gdata->s)
{
axx = (gdata->s * axx) / gdata->sx;
axy = (gdata->s * axy) / gdata->sx;
}
if (gdata->sy != gdata->s)
{
ayy = (gdata->s * ayy) / gdata->sy;
ayx = (gdata->s * ayx) / gdata->sy;
}
xx = (axx * x) + (axy * y);
yy = (ayx * x) + (ayy * y);
SETUP_ANGULAR_FILL
while (dst < dst_end)
{
@ -740,19 +695,7 @@ angular_reflect_aa_masked_annulus(DATA32 *map, int map_len, DATA32 *dst, DATA8 *
int rr0 = r0 << 16, rr1 = r1 << 16;
float off = gdata->off * (map_len - 1);
if (gdata->sx != gdata->s)
{
axx = (gdata->s * axx) / gdata->sx;
axy = (gdata->s * axy) / gdata->sx;
}
if (gdata->sy != gdata->s)
{
ayy = (gdata->s * ayy) / gdata->sy;
ayx = (gdata->s * ayx) / gdata->sy;
}
xx = (axx * x) + (axy * y);
yy = (ayx * x) + (ayy * y);
SETUP_ANGULAR_FILL
while (dst < dst_end)
{
@ -798,19 +741,7 @@ angular_repeat(DATA32 *map, int map_len, DATA32 *dst, DATA8 *mask, int dst_len,
int ss = (gdata->s) << 16;
float off = gdata->off * (map_len - 1);
if (gdata->sx != gdata->s)
{
axx = (gdata->s * axx) / gdata->sx;
axy = (gdata->s * axy) / gdata->sx;
}
if (gdata->sy != gdata->s)
{
ayy = (gdata->s * ayy) / gdata->sy;
ayx = (gdata->s * ayx) / gdata->sy;
}
xx = (axx * x) + (axy * y);
yy = (ayx * x) + (ayy * y);
SETUP_ANGULAR_FILL
while (dst < dst_end)
{
@ -836,19 +767,7 @@ angular_repeat_aa(DATA32 *map, int map_len, DATA32 *dst, DATA8 *mask, int dst_le
int ss = (gdata->s) << 16;
float off = gdata->off * (map_len - 1);
if (gdata->sx != gdata->s)
{
axx = (gdata->s * axx) / gdata->sx;
axy = (gdata->s * axy) / gdata->sx;
}
if (gdata->sy != gdata->s)
{
ayy = (gdata->s * ayy) / gdata->sy;
ayx = (gdata->s * ayx) / gdata->sy;
}
xx = (axx * x) + (axy * y);
yy = (ayx * x) + (ayy * y);
SETUP_ANGULAR_FILL
while (dst < dst_end)
{
@ -880,19 +799,7 @@ angular_repeat_annulus(DATA32 *map, int map_len, DATA32 *dst, DATA8 *mask, int d
int r1 = gdata->s, r0 = gdata->an * r1;
float off = gdata->off * (map_len - 1);
if (gdata->sx != gdata->s)
{
axx = (gdata->s * axx) / gdata->sx;
axy = (gdata->s * axy) / gdata->sx;
}
if (gdata->sy != gdata->s)
{
ayy = (gdata->s * ayy) / gdata->sy;
ayx = (gdata->s * ayx) / gdata->sy;
}
xx = (axx * x) + (axy * y);
yy = (ayx * x) + (ayy * y);
SETUP_ANGULAR_FILL
while (dst < dst_end)
{
@ -926,19 +833,7 @@ angular_repeat_aa_annulus(DATA32 *map, int map_len, DATA32 *dst, DATA8 *mask, in
int rr0 = r0 << 16, rr1 = r1 << 16;
float off = gdata->off * (map_len - 1);
if (gdata->sx != gdata->s)
{
axx = (gdata->s * axx) / gdata->sx;
axy = (gdata->s * axy) / gdata->sx;
}
if (gdata->sy != gdata->s)
{
ayy = (gdata->s * ayy) / gdata->sy;
ayx = (gdata->s * ayx) / gdata->sy;
}
xx = (axx * x) + (axy * y);
yy = (ayx * x) + (ayy * y);
SETUP_ANGULAR_FILL
while (dst < dst_end)
{
@ -989,19 +884,7 @@ angular_repeat_masked_annulus(DATA32 *map, int map_len, DATA32 *dst, DATA8 *mask
int r1 = gdata->s, r0 = gdata->an * r1;
float off = gdata->off * (map_len - 1);
if (gdata->sx != gdata->s)
{
axx = (gdata->s * axx) / gdata->sx;
axy = (gdata->s * axy) / gdata->sx;
}
if (gdata->sy != gdata->s)
{
ayy = (gdata->s * ayy) / gdata->sy;
ayx = (gdata->s * ayx) / gdata->sy;
}
xx = (axx * x) + (axy * y);
yy = (ayx * x) + (ayy * y);
SETUP_ANGULAR_FILL
while (dst < dst_end)
{
@ -1035,19 +918,7 @@ angular_repeat_aa_masked_annulus(DATA32 *map, int map_len, DATA32 *dst, DATA8 *m
int rr0 = r0 << 16, rr1 = r1 << 16;
float off = gdata->off * (map_len - 1);
if (gdata->sx != gdata->s)
{
axx = (gdata->s * axx) / gdata->sx;
axy = (gdata->s * axy) / gdata->sx;
}
if (gdata->sy != gdata->s)
{
ayy = (gdata->s * ayy) / gdata->sy;
ayx = (gdata->s * ayx) / gdata->sy;
}
xx = (axx * x) + (axy * y);
yy = (ayx * x) + (ayy * y);
SETUP_ANGULAR_FILL
while (dst < dst_end)
{
@ -1088,19 +959,7 @@ angular_restrict_reflect(DATA32 *map, int map_len, DATA32 *dst, DATA8 *mask, int
int ss = (gdata->s) << 16;
float off = gdata->off * (map_len - 1);
if (gdata->sx != gdata->s)
{
axx = (gdata->s * axx) / gdata->sx;
axy = (gdata->s * axy) / gdata->sx;
}
if (gdata->sy != gdata->s)
{
ayy = (gdata->s * ayy) / gdata->sy;
ayx = (gdata->s * ayx) / gdata->sy;
}
xx = (axx * x) + (axy * y);
yy = (ayx * x) + (ayy * y);
SETUP_ANGULAR_FILL
while (dst < dst_end)
{
@ -1137,19 +996,7 @@ angular_restrict_reflect_aa(DATA32 *map, int map_len, DATA32 *dst, DATA8 *mask,
int ss = (gdata->s) << 16;
float off = gdata->off * (map_len - 1);
if (gdata->sx != gdata->s)
{
axx = (gdata->s * axx) / gdata->sx;
axy = (gdata->s * axy) / gdata->sx;
}
if (gdata->sy != gdata->s)
{
ayy = (gdata->s * ayy) / gdata->sy;
ayx = (gdata->s * ayx) / gdata->sy;
}
xx = (axx * x) + (axy * y);
yy = (ayx * x) + (ayy * y);
SETUP_ANGULAR_FILL
while (dst < dst_end)
{
@ -1193,19 +1040,7 @@ angular_restrict_reflect_masked(DATA32 *map, int map_len, DATA32 *dst, DATA8 *ma
int ss = (gdata->s) << 16;
float off = gdata->off * (map_len - 1);
if (gdata->sx != gdata->s)
{
axx = (gdata->s * axx) / gdata->sx;
axy = (gdata->s * axy) / gdata->sx;
}
if (gdata->sy != gdata->s)
{
ayy = (gdata->s * ayy) / gdata->sy;
ayx = (gdata->s * ayx) / gdata->sy;
}
xx = (axx * x) + (axy * y);
yy = (ayx * x) + (ayy * y);
SETUP_ANGULAR_FILL
while (dst < dst_end)
{
@ -1241,19 +1076,7 @@ angular_restrict_reflect_aa_masked(DATA32 *map, int map_len, DATA32 *dst, DATA8
int ss = (gdata->s) << 16;
float off = gdata->off * (map_len - 1);
if (gdata->sx != gdata->s)
{
axx = (gdata->s * axx) / gdata->sx;
axy = (gdata->s * axy) / gdata->sx;
}
if (gdata->sy != gdata->s)
{
ayy = (gdata->s * ayy) / gdata->sy;
ayx = (gdata->s * ayx) / gdata->sy;
}
xx = (axx * x) + (axy * y);
yy = (ayx * x) + (ayy * y);
SETUP_ANGULAR_FILL
while (dst < dst_end)
{
@ -1298,19 +1121,7 @@ angular_restrict_reflect_annulus(DATA32 *map, int map_len, DATA32 *dst, DATA8 *m
int r1 = gdata->s, r0 = gdata->an * r1;
float off = gdata->off * (map_len - 1);
if (gdata->sx != gdata->s)
{
axx = (gdata->s * axx) / gdata->sx;
axy = (gdata->s * axy) / gdata->sx;
}
if (gdata->sy != gdata->s)
{
ayy = (gdata->s * ayy) / gdata->sy;
ayx = (gdata->s * ayx) / gdata->sy;
}
xx = (axx * x) + (axy * y);
yy = (ayx * x) + (ayy * y);
SETUP_ANGULAR_FILL
while (dst < dst_end)
{
@ -1354,19 +1165,7 @@ angular_restrict_reflect_aa_annulus(DATA32 *map, int map_len, DATA32 *dst, DATA8
int rr0 = r0 << 16, rr1 = r1 << 16;
float off = gdata->off * (map_len - 1);
if (gdata->sx != gdata->s)
{
axx = (gdata->s * axx) / gdata->sx;
axy = (gdata->s * axy) / gdata->sx;
}
if (gdata->sy != gdata->s)
{
ayy = (gdata->s * ayy) / gdata->sy;
ayx = (gdata->s * ayx) / gdata->sy;
}
xx = (axx * x) + (axy * y);
yy = (ayx * x) + (ayy * y);
SETUP_ANGULAR_FILL
while (dst < dst_end)
{
@ -1428,19 +1227,7 @@ angular_restrict_reflect_masked_annulus(DATA32 *map, int map_len, DATA32 *dst, D
int r1 = gdata->s, r0 = gdata->an * r1;
float off = gdata->off * (map_len - 1);
if (gdata->sx != gdata->s)
{
axx = (gdata->s * axx) / gdata->sx;
axy = (gdata->s * axy) / gdata->sx;
}
if (gdata->sy != gdata->s)
{
ayy = (gdata->s * ayy) / gdata->sy;
ayx = (gdata->s * ayx) / gdata->sy;
}
xx = (axx * x) + (axy * y);
yy = (ayx * x) + (ayy * y);
SETUP_ANGULAR_FILL
while (dst < dst_end)
{
@ -1484,19 +1271,7 @@ angular_restrict_reflect_aa_masked_annulus(DATA32 *map, int map_len, DATA32 *dst
int rr0 = r0 << 16, rr1 = r1 << 16;
float off = gdata->off * (map_len - 1);
if (gdata->sx != gdata->s)
{
axx = (gdata->s * axx) / gdata->sx;
axy = (gdata->s * axy) / gdata->sx;
}
if (gdata->sy != gdata->s)
{
ayy = (gdata->s * ayy) / gdata->sy;
ayx = (gdata->s * ayx) / gdata->sy;
}
xx = (axx * x) + (axy * y);
yy = (ayx * x) + (ayy * y);
SETUP_ANGULAR_FILL
while (dst < dst_end)
{
@ -1549,19 +1324,7 @@ angular_restrict_repeat(DATA32 *map, int map_len, DATA32 *dst, DATA8 *mask, int
int ss = (gdata->s) << 16;
float off = gdata->off * (map_len - 1);
if (gdata->sx != gdata->s)
{
axx = (gdata->s * axx) / gdata->sx;
axy = (gdata->s * axy) / gdata->sx;
}
if (gdata->sy != gdata->s)
{
ayy = (gdata->s * ayy) / gdata->sy;
ayx = (gdata->s * ayx) / gdata->sy;
}
xx = (axx * x) + (axy * y);
yy = (ayx * x) + (ayy * y);
SETUP_ANGULAR_FILL
while (dst < dst_end)
{
@ -1592,19 +1355,7 @@ angular_restrict_repeat_aa(DATA32 *map, int map_len, DATA32 *dst, DATA8 *mask, i
int ss = (gdata->s) << 16;
float off = gdata->off * (map_len - 1);
if (gdata->sx != gdata->s)
{
axx = (gdata->s * axx) / gdata->sx;
axy = (gdata->s * axy) / gdata->sx;
}
if (gdata->sy != gdata->s)
{
ayy = (gdata->s * ayy) / gdata->sy;
ayx = (gdata->s * ayx) / gdata->sy;
}
xx = (axx * x) + (axy * y);
yy = (ayx * x) + (ayy * y);
SETUP_ANGULAR_FILL
while (dst < dst_end)
{
@ -1644,19 +1395,7 @@ angular_restrict_repeat_masked(DATA32 *map, int map_len, DATA32 *dst, DATA8 *mas
int ss = (gdata->s) << 16;
float off = gdata->off * (map_len - 1);
if (gdata->sx != gdata->s)
{
axx = (gdata->s * axx) / gdata->sx;
axy = (gdata->s * axy) / gdata->sx;
}
if (gdata->sy != gdata->s)
{
ayy = (gdata->s * ayy) / gdata->sy;
ayx = (gdata->s * ayx) / gdata->sy;
}
xx = (axx * x) + (axy * y);
yy = (ayx * x) + (ayy * y);
SETUP_ANGULAR_FILL
while (dst < dst_end)
{
@ -1686,19 +1425,7 @@ angular_restrict_repeat_aa_masked(DATA32 *map, int map_len, DATA32 *dst, DATA8 *
int ss = (gdata->s) << 16;
float off = gdata->off * (map_len - 1);
if (gdata->sx != gdata->s)
{
axx = (gdata->s * axx) / gdata->sx;
axy = (gdata->s * axy) / gdata->sx;
}
if (gdata->sy != gdata->s)
{
ayy = (gdata->s * ayy) / gdata->sy;
ayx = (gdata->s * ayx) / gdata->sy;
}
xx = (axx * x) + (axy * y);
yy = (ayx * x) + (ayy * y);
SETUP_ANGULAR_FILL
while (dst < dst_end)
{
@ -1739,19 +1466,7 @@ angular_restrict_repeat_annulus(DATA32 *map, int map_len, DATA32 *dst, DATA8 *ma
int r1 = gdata->s, r0 = gdata->an * r1;
float off = gdata->off * (map_len - 1);
if (gdata->sx != gdata->s)
{
axx = (gdata->s * axx) / gdata->sx;
axy = (gdata->s * axy) / gdata->sx;
}
if (gdata->sy != gdata->s)
{
ayy = (gdata->s * ayy) / gdata->sy;
ayx = (gdata->s * ayx) / gdata->sy;
}
xx = (axx * x) + (axy * y);
yy = (ayx * x) + (ayy * y);
SETUP_ANGULAR_FILL
while (dst < dst_end)
{
@ -1789,19 +1504,7 @@ angular_restrict_repeat_aa_annulus(DATA32 *map, int map_len, DATA32 *dst, DATA8
int rr0 = r0 << 16, rr1 = r1 << 16;
float off = gdata->off * (map_len - 1);
if (gdata->sx != gdata->s)
{
axx = (gdata->s * axx) / gdata->sx;
axy = (gdata->s * axy) / gdata->sx;
}
if (gdata->sy != gdata->s)
{
ayy = (gdata->s * ayy) / gdata->sy;
ayx = (gdata->s * ayx) / gdata->sy;
}
xx = (axx * x) + (axy * y);
yy = (ayx * x) + (ayy * y);
SETUP_ANGULAR_FILL
while (dst < dst_end)
{
@ -1859,19 +1562,7 @@ angular_restrict_repeat_masked_annulus(DATA32 *map, int map_len, DATA32 *dst, DA
int r1 = gdata->s, r0 = gdata->an * r1;
float off = gdata->off * (map_len - 1);
if (gdata->sx != gdata->s)
{
axx = (gdata->s * axx) / gdata->sx;
axy = (gdata->s * axy) / gdata->sx;
}
if (gdata->sy != gdata->s)
{
ayy = (gdata->s * ayy) / gdata->sy;
ayx = (gdata->s * ayx) / gdata->sy;
}
xx = (axx * x) + (axy * y);
yy = (ayx * x) + (ayy * y);
SETUP_ANGULAR_FILL
while (dst < dst_end)
{
@ -1909,19 +1600,7 @@ angular_restrict_repeat_aa_masked_annulus(DATA32 *map, int map_len, DATA32 *dst,
int rr0 = r0 << 16, rr1 = r1 << 16;
float off = gdata->off * (map_len - 1);
if (gdata->sx != gdata->s)
{
axx = (gdata->s * axx) / gdata->sx;
axy = (gdata->s * axy) / gdata->sx;
}
if (gdata->sy != gdata->s)
{
ayy = (gdata->s * ayy) / gdata->sy;
ayx = (gdata->s * ayx) / gdata->sy;
}
xx = (axx * x) + (axy * y);
yy = (ayx * x) + (ayy * y);
SETUP_ANGULAR_FILL
while (dst < dst_end)
{
@ -1969,19 +1648,7 @@ angular_pad(DATA32 *map, int map_len, DATA32 *dst, DATA8 *mask, int dst_len,
int xx, yy;
int ss = (gdata->s) << 16;
if (gdata->sx != gdata->s)
{
axx = (gdata->s * axx) / gdata->sx;
axy = (gdata->s * axy) / gdata->sx;
}
if (gdata->sy != gdata->s)
{
ayy = (gdata->s * ayy) / gdata->sy;
ayx = (gdata->s * ayx) / gdata->sy;
}
xx = (axx * x) + (axy * y);
yy = (ayx * x) + (ayy * y);
SETUP_ANGULAR_FILL
while (dst < dst_end)
{
@ -2004,19 +1671,7 @@ angular_pad_aa(DATA32 *map, int map_len, DATA32 *dst, DATA8 *mask, int dst_len,
int xx, yy;
int ss = (gdata->s) << 16;
if (gdata->sx != gdata->s)
{
axx = (gdata->s * axx) / gdata->sx;
axy = (gdata->s * axy) / gdata->sx;
}
if (gdata->sy != gdata->s)
{
ayy = (gdata->s * ayy) / gdata->sy;
ayx = (gdata->s * ayx) / gdata->sy;
}
xx = (axx * x) + (axy * y);
yy = (ayx * x) + (ayy * y);
SETUP_ANGULAR_FILL
while (dst < dst_end)
{
@ -2042,19 +1697,7 @@ angular_pad_annulus(DATA32 *map, int map_len, DATA32 *dst, DATA8 *mask, int dst_
int ss = (gdata->s) << 16;
int r1 = gdata->s, r0 = gdata->an * r1;
if (gdata->sx != gdata->s)
{
axx = (gdata->s * axx) / gdata->sx;
axy = (gdata->s * axy) / gdata->sx;
}
if (gdata->sy != gdata->s)
{
ayy = (gdata->s * ayy) / gdata->sy;
ayx = (gdata->s * ayx) / gdata->sy;
}
xx = (axx * x) + (axy * y);
yy = (ayx * x) + (ayy * y);
SETUP_ANGULAR_FILL
while (dst < dst_end)
{
@ -2086,19 +1729,7 @@ angular_pad_aa_annulus(DATA32 *map, int map_len, DATA32 *dst, DATA8 *mask, int d
int r1 = gdata->s, r0 = gdata->an * r1;
int rr0 = r0 << 16, rr1 = r1 << 16;
if (gdata->sx != gdata->s)
{
axx = (gdata->s * axx) / gdata->sx;
axy = (gdata->s * axy) / gdata->sx;
}
if (gdata->sy != gdata->s)
{
ayy = (gdata->s * ayy) / gdata->sy;
ayx = (gdata->s * ayx) / gdata->sy;
}
xx = (axx * x) + (axy * y);
yy = (ayx * x) + (ayy * y);
SETUP_ANGULAR_FILL
while (dst < dst_end)
{
@ -2142,19 +1773,7 @@ angular_pad_masked_annulus(DATA32 *map, int map_len, DATA32 *dst, DATA8 *mask, i
int ss = (gdata->s) << 16;
int r1 = gdata->s, r0 = gdata->an * r1;
if (gdata->sx != gdata->s)
{
axx = (gdata->s * axx) / gdata->sx;
axy = (gdata->s * axy) / gdata->sx;
}
if (gdata->sy != gdata->s)
{
ayy = (gdata->s * ayy) / gdata->sy;
ayx = (gdata->s * ayx) / gdata->sy;
}
xx = (axx * x) + (axy * y);
yy = (ayx * x) + (ayy * y);
SETUP_ANGULAR_FILL
while (dst < dst_end)
{
@ -2186,19 +1805,7 @@ angular_pad_aa_masked_annulus(DATA32 *map, int map_len, DATA32 *dst, DATA8 *mask
int r1 = gdata->s, r0 = gdata->an * r1;
int rr0 = r0 << 16, rr1 = r1 << 16;
if (gdata->sx != gdata->s)
{
axx = (gdata->s * axx) / gdata->sx;
axy = (gdata->s * axy) / gdata->sx;
}
if (gdata->sy != gdata->s)
{
ayy = (gdata->s * ayy) / gdata->sy;
ayx = (gdata->s * ayx) / gdata->sy;
}
xx = (axx * x) + (axy * y);
yy = (ayx * x) + (ayy * y);
SETUP_ANGULAR_FILL
while (dst < dst_end)
{

View File

@ -218,7 +218,7 @@ static int
linear_has_alpha(RGBA_Gradient *gr, int spread, int op)
{
if (!gr || (gr->type.geometer != &linear)) return 0;
if (gr->map.has_alpha)
if (gr->has_alpha | gr->map.has_alpha)
return 1;
if ( (op == _EVAS_RENDER_COPY) || (op == _EVAS_RENDER_COPY_REL) ||
(op == _EVAS_RENDER_MASK) || (op == _EVAS_RENDER_MUL) )

View File

@ -101,6 +101,7 @@ evas_common_gradient_colors_clear(RGBA_Gradient *gr)
gr->colors = NULL;
gr->ncolors = 0;
gr->len = 0;
gr->has_alpha = 0;
}
}
@ -165,7 +166,7 @@ evas_common_gradient_data_set(RGBA_Gradient *gr, DATA32 *data, int len, int alph
if (gr->map.data) free(gr->map.data);
gr->map.data = NULL;
gr->map.len = 0;
gr->map.has_alpha = 1;
gr->map.has_alpha = 0;
}
void
@ -175,12 +176,12 @@ evas_common_gradient_data_unset(RGBA_Gradient *gr)
if (!gr->imported_data) return;
gr->data = NULL;
gr->len = 0;
gr->has_alpha = 1;
gr->has_alpha = 0;
gr->imported_data = 0;
if (gr->map.data) free(gr->map.data);
gr->map.data = NULL;
gr->map.len = 0;
gr->map.has_alpha = 1;
gr->map.has_alpha = 0;
}
void
@ -276,6 +277,7 @@ evas_common_gradient_draw(RGBA_Image *dst, RGBA_Draw_Context *dc,
RGBA_Gfx_Func bfunc;
int len;
int xin, yin, xoff, yoff;
int clx, cly, clw, clh;
int axx, axy, ayx, ayy;
DATA32 *pdst, *dst_end, *buf, *map;
RGBA_Image *argb_buf, *alpha_buf = NULL;
@ -290,47 +292,19 @@ evas_common_gradient_draw(RGBA_Image *dst, RGBA_Draw_Context *dc,
return;
if ((w < 1) || (h < 1))
return;
if (!(RECTS_INTERSECT(x, y, w, h, 0, 0, dst->image->w, dst->image->h)))
return;
xin = x; yin = y;
if (x < 0)
{
w += x;
x = 0;
}
if (y < 0)
{
h += y;
y = 0;
}
if ((w <= 0) || (h <= 0)) return;
if ((x + w) > dst->image->w) w = dst->image->w - x;
if ((y + h) > dst->image->h) h = dst->image->h - y;
if ((w <= 0) || (h <= 0)) return;
clx = 0; cly = 0; clw = dst->image->w; clh = dst->image->h;
if ((clw < 1) || (clh < 1)) return;
if (dc->clip.use)
{
if (dc->clip.x > x)
{
w += x - dc->clip.x;
x = dc->clip.x;
}
if (dc->clip.y > y)
{
h += y - dc->clip.y;
y = dc->clip.y;
}
if ((w <= 0) || (h <= 0)) return;
if ((dc->clip.x + dc->clip.w) < (x + w))
w = dc->clip.x + dc->clip.w - x;
if ((dc->clip.y + dc->clip.h) < (y + h))
h = dc->clip.y + dc->clip.h - y;
}
if ((w <= 0) || (h <= 0)) return;
RECTS_CLIP_TO_RECT(clx,cly,clw,clh, dc->clip.x,dc->clip.y,dc->clip.w,dc->clip.h);
if ((clw < 1) || (clh < 1)) return;
xoff = (xin - x) - gr->fill.x;
yoff = (yin - y) - gr->fill.y;
xin = x; yin = y;
RECTS_CLIP_TO_RECT(x,y,w,h, clx,cly,clw,clh);
if ((w < 1) || (h < 1)) return;
xoff = (x - xin) - gr->fill.x;
yoff = (y - yin) - gr->fill.y;
argb_buf = evas_common_image_line_buffer_obtain(w);
if (!argb_buf)
@ -377,9 +351,9 @@ evas_common_gradient_draw(RGBA_Image *dst, RGBA_Draw_Context *dc,
while (pdst < dst_end)
{
evas_common_cpu_end_opt();
gfunc(map, len, buf, mask, w, xoff, yoff, axx, axy, ayx, ayy, gdata);
bfunc(buf, mask, 0, pdst, w);
evas_common_cpu_end_opt();
pdst += dst->image->w;
yoff++;
}
@ -389,7 +363,6 @@ evas_common_gradient_draw(RGBA_Image *dst, RGBA_Draw_Context *dc,
evas_common_image_alpha_line_buffer_release();
}
static void
evas_common_gradient_map_argb(RGBA_Draw_Context *dc, RGBA_Gradient *gr, int spread)
{
@ -752,6 +725,7 @@ evas_common_gradient_map(RGBA_Draw_Context *dc, RGBA_Gradient *gr, int spread)
evas_common_gradient_map_argb(dc, gr, spread);
}
/*
void
evas_common_convert_hsv_to_rgb(float h, float s, float v, int *r, int *g, int *b)
{
@ -926,4 +900,4 @@ evas_common_convert_rgb_to_hsv_int(int r, int g, int b, int *h, int *s, int *v)
if (*h < 0) *h += 1530;
}
*/

View File

@ -166,12 +166,12 @@ static int
radial_has_alpha(RGBA_Gradient *gr, int spread, int op)
{
if (!gr || (gr->type.geometer != &radial)) return 0;
if (gr->map.has_alpha)
if (gr->has_alpha | gr->map.has_alpha)
return 1;
if ( (op == _EVAS_RENDER_COPY) || (op == _EVAS_RENDER_COPY_REL) ||
(op == _EVAS_RENDER_MASK) || (op == _EVAS_RENDER_MUL) )
return 0;
if ((int)radial_data.r0 > 0)
if (radial_data.r0 > 0)
return 1;
if ( (spread == _EVAS_TEXTURE_RESTRICT) ||
(spread == _EVAS_TEXTURE_RESTRICT_REFLECT) ||
@ -187,7 +187,7 @@ radial_has_mask(RGBA_Gradient *gr, int spread, int op)
if ( (op == _EVAS_RENDER_COPY) || (op == _EVAS_RENDER_COPY_REL) ||
(op == _EVAS_RENDER_MASK) || (op == _EVAS_RENDER_MUL) )
{
if ((int)radial_data.r0 > 0)
if (radial_data.r0 > 0)
return 1;
if ( (spread == _EVAS_TEXTURE_RESTRICT) ||
(spread == _EVAS_TEXTURE_RESTRICT_REFLECT) ||
@ -340,6 +340,23 @@ radial_get_fill_func(RGBA_Gradient *gr, int spread, int op, unsigned char aa)
return sfunc;
}
#define SETUP_RADIAL_FILL \
if (gdata->sx != gdata->s) \
{ \
axx = (gdata->s * axx) / gdata->sx; \
axy = (gdata->s * axy) / gdata->sx; \
} \
if (gdata->sy != gdata->s) \
{ \
ayy = (gdata->s * ayy) / gdata->sy; \
ayx = (gdata->s * ayx) / gdata->sy; \
} \
xx = (axx * x) + (axy * y); \
yy = (ayx * x) + (ayy * y); \
rr0 = gdata->r0 * gdata->s; \
rr0 <<= 16;
static void
radial_reflect(DATA32 *map, int map_len, DATA32 *dst, DATA8 *mask, int dst_len,
int x, int y, int axx, int axy, int ayx, int ayy, void *params_data)
@ -349,23 +366,7 @@ radial_reflect(DATA32 *map, int map_len, DATA32 *dst, DATA8 *mask, int dst_len,
int xx, yy, rr0;
int off = gdata->off * (map_len - 1);
if (gdata->sx != gdata->s)
{
axx = (gdata->s * axx) / gdata->sx;
axy = (gdata->s * axy) / gdata->sx;
}
if (gdata->sy != gdata->s)
{
ayy = (gdata->s * ayy) / gdata->sy;
ayx = (gdata->s * ayx) / gdata->sy;
}
ayx += (0.070710678 * ayx);
axx += (0.070710678 * axx);
xx = (axx * x) + (axy * y);
yy = (ayx * x) + (ayy * y);
rr0 = gdata->r0 * gdata->s;
rr0 <<= 16;
SETUP_RADIAL_FILL
while (dst < dst_end)
{
@ -401,23 +402,7 @@ radial_reflect_aa(DATA32 *map, int map_len, DATA32 *dst, DATA8 *mask, int dst_le
int xx, yy, rr0;
int off = gdata->off * (map_len - 1);
if (gdata->sx != gdata->s)
{
axx = (gdata->s * axx) / gdata->sx;
axy = (gdata->s * axy) / gdata->sx;
}
if (gdata->sy != gdata->s)
{
ayy = (gdata->s * ayy) / gdata->sy;
ayx = (gdata->s * ayx) / gdata->sy;
}
ayx += (0.070710678 * ayx);
axx += (0.070710678 * axx);
xx = (axx * x) + (axy * y);
yy = (ayx * x) + (ayy * y);
rr0 = gdata->r0 * gdata->s;
rr0 <<= 16;
SETUP_RADIAL_FILL
while (dst < dst_end)
{
@ -458,23 +443,7 @@ radial_reflect_masked(DATA32 *map, int map_len, DATA32 *dst, DATA8 *mask, int ds
int xx, yy, rr0;
int off = gdata->off * (map_len - 1);
if (gdata->sx != gdata->s)
{
axx = (gdata->s * axx) / gdata->sx;
axy = (gdata->s * axy) / gdata->sx;
}
if (gdata->sy != gdata->s)
{
ayy = (gdata->s * ayy) / gdata->sy;
ayx = (gdata->s * ayx) / gdata->sy;
}
ayx += (0.070710678 * ayx);
axx += (0.070710678 * axx);
xx = (axx * x) + (axy * y);
yy = (ayx * x) + (ayy * y);
rr0 = gdata->r0 * gdata->s;
rr0 <<= 16;
SETUP_RADIAL_FILL
while (dst < dst_end)
{
@ -510,23 +479,7 @@ radial_reflect_aa_masked(DATA32 *map, int map_len, DATA32 *dst, DATA8 *mask, int
int xx, yy, rr0;
int off = gdata->off * (map_len - 1);
if (gdata->sx != gdata->s)
{
axx = (gdata->s * axx) / gdata->sx;
axy = (gdata->s * axy) / gdata->sx;
}
if (gdata->sy != gdata->s)
{
ayy = (gdata->s * ayy) / gdata->sy;
ayx = (gdata->s * ayx) / gdata->sy;
}
ayx += (0.070710678 * ayx);
axx += (0.070710678 * axx);
xx = (axx * x) + (axy * y);
yy = (ayx * x) + (ayy * y);
rr0 = gdata->r0 * gdata->s;
rr0 <<= 16;
SETUP_RADIAL_FILL
while (dst < dst_end)
{
@ -567,23 +520,7 @@ radial_repeat(DATA32 *map, int map_len, DATA32 *dst, DATA8 *mask, int dst_len,
int xx, yy, rr0;
int off = gdata->off * (map_len - 1);
if (gdata->sx != gdata->s)
{
axx = (gdata->s * axx) / gdata->sx;
axy = (gdata->s * axy) / gdata->sx;
}
if (gdata->sy != gdata->s)
{
ayy = (gdata->s * ayy) / gdata->sy;
ayx = (gdata->s * ayx) / gdata->sy;
}
ayx += (0.070710678 * ayx);
axx += (0.070710678 * axx);
xx = (axx * x) + (axy * y);
yy = (ayx * x) + (ayy * y);
rr0 = gdata->r0 * gdata->s;
rr0 <<= 16;
SETUP_RADIAL_FILL
while (dst < dst_end)
{
@ -613,23 +550,7 @@ radial_repeat_aa(DATA32 *map, int map_len, DATA32 *dst, DATA8 *mask, int dst_len
int xx, yy, rr0;
int off = gdata->off * (map_len - 1);
if (gdata->sx != gdata->s)
{
axx = (gdata->s * axx) / gdata->sx;
axy = (gdata->s * axy) / gdata->sx;
}
if (gdata->sy != gdata->s)
{
ayy = (gdata->s * ayy) / gdata->sy;
ayx = (gdata->s * ayx) / gdata->sy;
}
ayx += (0.070710678 * ayx);
axx += (0.070710678 * axx);
xx = (axx * x) + (axy * y);
yy = (ayx * x) + (ayy * y);
rr0 = gdata->r0 * gdata->s;
rr0 <<= 16;
SETUP_RADIAL_FILL
while (dst < dst_end)
{
@ -666,23 +587,7 @@ radial_repeat_masked(DATA32 *map, int map_len, DATA32 *dst, DATA8 *mask, int dst
int xx, yy, rr0;
int off = gdata->off * (map_len - 1);
if (gdata->sx != gdata->s)
{
axx = (gdata->s * axx) / gdata->sx;
axy = (gdata->s * axy) / gdata->sx;
}
if (gdata->sy != gdata->s)
{
ayy = (gdata->s * ayy) / gdata->sy;
ayx = (gdata->s * ayx) / gdata->sy;
}
ayx += (0.070710678 * ayx);
axx += (0.070710678 * axx);
xx = (axx * x) + (axy * y);
yy = (ayx * x) + (ayy * y);
rr0 = gdata->r0 * gdata->s;
rr0 <<= 16;
SETUP_RADIAL_FILL
while (dst < dst_end)
{
@ -712,23 +617,7 @@ radial_repeat_aa_masked(DATA32 *map, int map_len, DATA32 *dst, DATA8 *mask, int
int xx, yy, rr0;
int off = gdata->off * (map_len - 1);
if (gdata->sx != gdata->s)
{
axx = (gdata->s * axx) / gdata->sx;
axy = (gdata->s * axy) / gdata->sx;
}
if (gdata->sy != gdata->s)
{
ayy = (gdata->s * ayy) / gdata->sy;
ayx = (gdata->s * ayx) / gdata->sy;
}
ayx += (0.070710678 * ayx);
axx += (0.070710678 * axx);
xx = (axx * x) + (axy * y);
yy = (ayx * x) + (ayy * y);
rr0 = gdata->r0 * gdata->s;
rr0 <<= 16;
SETUP_RADIAL_FILL
while (dst < dst_end)
{
@ -765,23 +654,7 @@ radial_restrict_reflect(DATA32 *map, int map_len, DATA32 *dst, DATA8 *mask, int
int xx, yy, rr0;
int off = gdata->off * (map_len - 1);
if (gdata->sx != gdata->s)
{
axx = (gdata->s * axx) / gdata->sx;
axy = (gdata->s * axy) / gdata->sx;
}
if (gdata->sy != gdata->s)
{
ayy = (gdata->s * ayy) / gdata->sy;
ayx = (gdata->s * ayx) / gdata->sy;
}
ayx += (0.070710678 * ayx);
axx += (0.070710678 * axx);
xx = (axx * x) + (axy * y);
yy = (ayx * x) + (ayy * y);
rr0 = gdata->r0 * gdata->s;
rr0 <<= 16;
SETUP_RADIAL_FILL
while (dst < dst_end)
{
@ -817,23 +690,7 @@ radial_restrict_reflect_aa(DATA32 *map, int map_len, DATA32 *dst, DATA8 *mask, i
int xx, yy, rr0;
int off = gdata->off * (map_len - 1);
if (gdata->sx != gdata->s)
{
axx = (gdata->s * axx) / gdata->sx;
axy = (gdata->s * axy) / gdata->sx;
}
if (gdata->sy != gdata->s)
{
ayy = (gdata->s * ayy) / gdata->sy;
ayx = (gdata->s * ayx) / gdata->sy;
}
ayx += (0.070710678 * ayx);
axx += (0.070710678 * axx);
xx = (axx * x) + (axy * y);
yy = (ayx * x) + (ayy * y);
rr0 = gdata->r0 * gdata->s;
rr0 <<= 16;
SETUP_RADIAL_FILL
while (dst < dst_end)
{
@ -876,23 +733,7 @@ radial_restrict_reflect_masked(DATA32 *map, int map_len, DATA32 *dst, DATA8 *mas
int xx, yy, rr0;
int off = gdata->off * (map_len - 1);
if (gdata->sx != gdata->s)
{
axx = (gdata->s * axx) / gdata->sx;
axy = (gdata->s * axy) / gdata->sx;
}
if (gdata->sy != gdata->s)
{
ayy = (gdata->s * ayy) / gdata->sy;
ayx = (gdata->s * ayx) / gdata->sy;
}
ayx += (0.070710678 * ayx);
axx += (0.070710678 * axx);
xx = (axx * x) + (axy * y);
yy = (ayx * x) + (ayy * y);
rr0 = gdata->r0 * gdata->s;
rr0 <<= 16;
SETUP_RADIAL_FILL
while (dst < dst_end)
{
@ -928,23 +769,7 @@ radial_restrict_reflect_aa_masked(DATA32 *map, int map_len, DATA32 *dst, DATA8 *
int xx, yy, rr0;
int off = gdata->off * (map_len - 1);
if (gdata->sx != gdata->s)
{
axx = (gdata->s * axx) / gdata->sx;
axy = (gdata->s * axy) / gdata->sx;
}
if (gdata->sy != gdata->s)
{
ayy = (gdata->s * ayy) / gdata->sy;
ayx = (gdata->s * ayx) / gdata->sy;
}
ayx += (0.070710678 * ayx);
axx += (0.070710678 * axx);
xx = (axx * x) + (axy * y);
yy = (ayx * x) + (ayy * y);
rr0 = gdata->r0 * gdata->s;
rr0 <<= 16;
SETUP_RADIAL_FILL
while (dst < dst_end)
{
@ -987,23 +812,7 @@ radial_restrict_repeat(DATA32 *map, int map_len, DATA32 *dst, DATA8 *mask, int d
int xx, yy, rr0;
int off = gdata->off * (map_len - 1);
if (gdata->sx != gdata->s)
{
axx = (gdata->s * axx) / gdata->sx;
axy = (gdata->s * axy) / gdata->sx;
}
if (gdata->sy != gdata->s)
{
ayy = (gdata->s * ayy) / gdata->sy;
ayx = (gdata->s * ayx) / gdata->sy;
}
ayx += (0.070710678 * ayx);
axx += (0.070710678 * axx);
xx = (axx * x) + (axy * y);
yy = (ayx * x) + (ayy * y);
rr0 = gdata->r0 * gdata->s;
rr0 <<= 16;
SETUP_RADIAL_FILL
while (dst < dst_end)
{
@ -1033,23 +842,7 @@ radial_restrict_repeat_aa(DATA32 *map, int map_len, DATA32 *dst, DATA8 *mask, in
int xx, yy, rr0;
int off = gdata->off * (map_len - 1);
if (gdata->sx != gdata->s)
{
axx = (gdata->s * axx) / gdata->sx;
axy = (gdata->s * axy) / gdata->sx;
}
if (gdata->sy != gdata->s)
{
ayy = (gdata->s * ayy) / gdata->sy;
ayx = (gdata->s * ayx) / gdata->sy;
}
ayx += (0.070710678 * ayx);
axx += (0.070710678 * axx);
xx = (axx * x) + (axy * y);
yy = (ayx * x) + (ayy * y);
rr0 = gdata->r0 * gdata->s;
rr0 <<= 16;
SETUP_RADIAL_FILL
while (dst < dst_end)
{
@ -1088,23 +881,7 @@ radial_restrict_repeat_masked(DATA32 *map, int map_len, DATA32 *dst, DATA8 *mask
int xx, yy, rr0;
int off = gdata->off * (map_len - 1);
if (gdata->sx != gdata->s)
{
axx = (gdata->s * axx) / gdata->sx;
axy = (gdata->s * axy) / gdata->sx;
}
if (gdata->sy != gdata->s)
{
ayy = (gdata->s * ayy) / gdata->sy;
ayx = (gdata->s * ayx) / gdata->sy;
}
ayx += (0.070710678 * ayx);
axx += (0.070710678 * axx);
xx = (axx * x) + (axy * y);
yy = (ayx * x) + (ayy * y);
rr0 = gdata->r0 * gdata->s;
rr0 <<= 16;
SETUP_RADIAL_FILL
while (dst < dst_end)
{
@ -1134,23 +911,7 @@ radial_restrict_repeat_aa_masked(DATA32 *map, int map_len, DATA32 *dst, DATA8 *m
int xx, yy, rr0;
int off = gdata->off * (map_len - 1);
if (gdata->sx != gdata->s)
{
axx = (gdata->s * axx) / gdata->sx;
axy = (gdata->s * axy) / gdata->sx;
}
if (gdata->sy != gdata->s)
{
ayy = (gdata->s * ayy) / gdata->sy;
ayx = (gdata->s * ayx) / gdata->sy;
}
ayx += (0.070710678 * ayx);
axx += (0.070710678 * axx);
xx = (axx * x) + (axy * y);
yy = (ayx * x) + (ayy * y);
rr0 = gdata->r0 * gdata->s;
rr0 <<= 16;
SETUP_RADIAL_FILL
while (dst < dst_end)
{
@ -1188,23 +949,7 @@ radial_pad(DATA32 *map, int map_len, DATA32 *dst, DATA8 *mask, int dst_len,
Radial_Data *gdata = (Radial_Data *)params_data;
int xx, yy, rr0;
if (gdata->sx != gdata->s)
{
axx = (gdata->s * axx) / gdata->sx;
axy = (gdata->s * axy) / gdata->sx;
}
if (gdata->sy != gdata->s)
{
ayy = (gdata->s * ayy) / gdata->sy;
ayx = (gdata->s * ayx) / gdata->sy;
}
ayx += (0.070710678 * ayx);
axx += (0.070710678 * axx);
xx = (axx * x) + (axy * y);
yy = (ayx * x) + (ayy * y);
rr0 = gdata->r0 * gdata->s;
rr0 <<= 16;
SETUP_RADIAL_FILL
while (dst < dst_end)
{
@ -1231,23 +976,7 @@ radial_pad_aa(DATA32 *map, int map_len, DATA32 *dst, DATA8 *mask, int dst_len,
Radial_Data *gdata = (Radial_Data *)params_data;
int xx, yy, rr0;
if (gdata->sx != gdata->s)
{
axx = (gdata->s * axx) / gdata->sx;
axy = (gdata->s * axy) / gdata->sx;
}
if (gdata->sy != gdata->s)
{
ayy = (gdata->s * ayy) / gdata->sy;
ayx = (gdata->s * ayx) / gdata->sy;
}
ayx += (0.070710678 * ayx);
axx += (0.070710678 * axx);
xx = (axx * x) + (axy * y);
yy = (ayx * x) + (ayy * y);
rr0 = gdata->r0 * gdata->s;
rr0 <<= 16;
SETUP_RADIAL_FILL
while (dst < dst_end)
{
@ -1284,23 +1013,7 @@ radial_pad_masked(DATA32 *map, int map_len, DATA32 *dst, DATA8 *mask, int dst_le
Radial_Data *gdata = (Radial_Data *)params_data;
int xx, yy, rr0;
if (gdata->sx != gdata->s)
{
axx = (gdata->s * axx) / gdata->sx;
axy = (gdata->s * axy) / gdata->sx;
}
if (gdata->sy != gdata->s)
{
ayy = (gdata->s * ayy) / gdata->sy;
ayx = (gdata->s * ayx) / gdata->sy;
}
ayx += (0.070710678 * ayx);
axx += (0.070710678 * axx);
xx = (axx * x) + (axy * y);
yy = (ayx * x) + (ayy * y);
rr0 = gdata->r0 * gdata->s;
rr0 <<= 16;
SETUP_RADIAL_FILL
while (dst < dst_end)
{
@ -1327,23 +1040,7 @@ radial_pad_aa_masked(DATA32 *map, int map_len, DATA32 *dst, DATA8 *mask, int dst
Radial_Data *gdata = (Radial_Data *)params_data;
int xx, yy, rr0;
if (gdata->sx != gdata->s)
{
axx = (gdata->s * axx) / gdata->sx;
axy = (gdata->s * axy) / gdata->sx;
}
if (gdata->sy != gdata->s)
{
ayy = (gdata->s * ayy) / gdata->sy;
ayx = (gdata->s * ayx) / gdata->sy;
}
ayx += (0.070710678 * ayx);
axx += (0.070710678 * axx);
xx = (axx * x) + (axy * y);
yy = (ayx * x) + (ayy * y);
rr0 = gdata->r0 * gdata->s;
rr0 <<= 16;
SETUP_RADIAL_FILL
while (dst < dst_end)
{

View File

@ -166,12 +166,12 @@ static int
rectangular_has_alpha(RGBA_Gradient *gr, int spread, int op)
{
if (!gr || (gr->type.geometer != &rectangular)) return 0;
if (gr->map.has_alpha)
if (gr->has_alpha | gr->map.has_alpha)
return 1;
if ( (op == _EVAS_RENDER_COPY) || (op == _EVAS_RENDER_COPY_REL) ||
(op == _EVAS_RENDER_MASK) || (op == _EVAS_RENDER_MUL) )
return 0;
if ((int)rectangular_data.r0 > 0)
if (rectangular_data.r0 > 0)
return 1;
if ( (spread == _EVAS_TEXTURE_RESTRICT) ||
(spread == _EVAS_TEXTURE_RESTRICT_REFLECT) ||
@ -187,7 +187,7 @@ rectangular_has_mask(RGBA_Gradient *gr, int spread, int op)
if ( (op == _EVAS_RENDER_COPY) || (op == _EVAS_RENDER_COPY_REL) ||
(op == _EVAS_RENDER_MASK) || (op == _EVAS_RENDER_MUL) )
{
if ((int)rectangular_data.r0 > 0)
if (rectangular_data.r0 > 0)
return 1;
if ( (spread == _EVAS_TEXTURE_RESTRICT) ||
(spread == _EVAS_TEXTURE_RESTRICT_REFLECT) ||
@ -370,6 +370,22 @@ rectangular_get_fill_func(RGBA_Gradient *gr, int spread, int op, unsigned char a
MOV_R2P(mmd, d, mmz)
#endif
#define SETUP_RECT_FILL \
if (gdata->sx != gdata->s) \
{ \
axx = (gdata->s * axx) / gdata->sx; \
axy = (gdata->s * axy) / gdata->sx; \
} \
if (gdata->sy != gdata->s) \
{ \
ayy = (gdata->s * ayy) / gdata->sy; \
ayx = (gdata->s * ayx) / gdata->sy; \
} \
xx = (axx * x) + (axy * y); \
yy = (ayx * x) + (ayy * y); \
rr0 = gdata->r0 * gdata->s; \
rr0 <<= 16;
static void
rectangular_reflect(DATA32 *map, int map_len, DATA32 *dst, DATA8 *mask, int dst_len,
int x, int y, int axx, int axy, int ayx, int ayy, void *params_data)
@ -379,23 +395,7 @@ rectangular_reflect(DATA32 *map, int map_len, DATA32 *dst, DATA8 *mask, int dst_
int xx, yy, rr0;
int off = gdata->off * (map_len - 1);
if (gdata->sx != gdata->s)
{
axx = (gdata->s * axx) / gdata->sx;
axy = (gdata->s * axy) / gdata->sx;
}
if (gdata->sy != gdata->s)
{
ayy = (gdata->s * ayy) / gdata->sy;
ayx = (gdata->s * ayx) / gdata->sy;
}
ayx += (0.070710678 * ayx);
axx += (0.070710678 * axx);
xx = (axx * x) + (axy * y);
yy = (ayx * x) + (ayy * y);
rr0 = gdata->r0 * gdata->s;
rr0 <<= 16;
SETUP_RECT_FILL
while (dst < dst_end)
{
@ -435,23 +435,7 @@ rectangular_reflect_aa(DATA32 *map, int map_len, DATA32 *dst, DATA8 *mask, int d
int xx, yy, rr0;
int off = gdata->off * (map_len - 1);
if (gdata->sx != gdata->s)
{
axx = (gdata->s * axx) / gdata->sx;
axy = (gdata->s * axy) / gdata->sx;
}
if (gdata->sy != gdata->s)
{
ayy = (gdata->s * ayy) / gdata->sy;
ayx = (gdata->s * ayx) / gdata->sy;
}
ayx += (0.070710678 * ayx);
axx += (0.070710678 * axx);
xx = (axx * x) + (axy * y);
yy = (ayx * x) + (ayy * y);
rr0 = gdata->r0 * gdata->s;
rr0 <<= 16;
SETUP_RECT_FILL
#ifdef BUILD_MMX
pxor_r2r(mm0, mm0);
@ -513,23 +497,7 @@ rectangular_reflect_masked(DATA32 *map, int map_len, DATA32 *dst, DATA8 *mask, i
int xx, yy, rr0;
int off = gdata->off * (map_len - 1);
if (gdata->sx != gdata->s)
{
axx = (gdata->s * axx) / gdata->sx;
axy = (gdata->s * axy) / gdata->sx;
}
if (gdata->sy != gdata->s)
{
ayy = (gdata->s * ayy) / gdata->sy;
ayx = (gdata->s * ayx) / gdata->sy;
}
ayx += (0.070710678 * ayx);
axx += (0.070710678 * axx);
xx = (axx * x) + (axy * y);
yy = (ayx * x) + (ayy * y);
rr0 = gdata->r0 * gdata->s;
rr0 <<= 16;
SETUP_RECT_FILL
while (dst < dst_end)
{
@ -569,23 +537,7 @@ rectangular_reflect_aa_masked(DATA32 *map, int map_len, DATA32 *dst, DATA8 *mask
int xx, yy, rr0;
int off = gdata->off * (map_len - 1);
if (gdata->sx != gdata->s)
{
axx = (gdata->s * axx) / gdata->sx;
axy = (gdata->s * axy) / gdata->sx;
}
if (gdata->sy != gdata->s)
{
ayy = (gdata->s * ayy) / gdata->sy;
ayx = (gdata->s * ayx) / gdata->sy;
}
ayx += (0.070710678 * ayx);
axx += (0.070710678 * axx);
xx = (axx * x) + (axy * y);
yy = (ayx * x) + (ayy * y);
rr0 = gdata->r0 * gdata->s;
rr0 <<= 16;
SETUP_RECT_FILL
#ifdef BUILD_MMX
pxor_r2r(mm0, mm0);
@ -639,23 +591,7 @@ rectangular_repeat(DATA32 *map, int map_len, DATA32 *dst, DATA8 *mask, int dst_l
int xx, yy, rr0;
int off = gdata->off * (map_len - 1);
if (gdata->sx != gdata->s)
{
axx = (gdata->s * axx) / gdata->sx;
axy = (gdata->s * axy) / gdata->sx;
}
if (gdata->sy != gdata->s)
{
ayy = (gdata->s * ayy) / gdata->sy;
ayx = (gdata->s * ayx) / gdata->sy;
}
ayx += (0.070710678 * ayx);
axx += (0.070710678 * axx);
xx = (axx * x) + (axy * y);
yy = (ayx * x) + (ayy * y);
rr0 = gdata->r0 * gdata->s;
rr0 <<= 16;
SETUP_RECT_FILL
while (dst < dst_end)
{
@ -689,23 +625,7 @@ rectangular_repeat_aa(DATA32 *map, int map_len, DATA32 *dst, DATA8 *mask, int ds
int xx, yy, rr0;
int off = gdata->off * (map_len - 1);
if (gdata->sx != gdata->s)
{
axx = (gdata->s * axx) / gdata->sx;
axy = (gdata->s * axy) / gdata->sx;
}
if (gdata->sy != gdata->s)
{
ayy = (gdata->s * ayy) / gdata->sy;
ayx = (gdata->s * ayx) / gdata->sy;
}
ayx += (0.070710678 * ayx);
axx += (0.070710678 * axx);
xx = (axx * x) + (axy * y);
yy = (ayx * x) + (ayy * y);
rr0 = gdata->r0 * gdata->s;
rr0 <<= 16;
SETUP_RECT_FILL
#ifdef BUILD_MMX
pxor_r2r(mm0, mm0);
@ -769,23 +689,7 @@ rectangular_repeat_masked(DATA32 *map, int map_len, DATA32 *dst, DATA8 *mask, in
int xx, yy, rr0;
int off = gdata->off * (map_len - 1);
if (gdata->sx != gdata->s)
{
axx = (gdata->s * axx) / gdata->sx;
axy = (gdata->s * axy) / gdata->sx;
}
if (gdata->sy != gdata->s)
{
ayy = (gdata->s * ayy) / gdata->sy;
ayx = (gdata->s * ayx) / gdata->sy;
}
ayx += (0.070710678 * ayx);
axx += (0.070710678 * axx);
xx = (axx * x) + (axy * y);
yy = (ayx * x) + (ayy * y);
rr0 = gdata->r0 * gdata->s;
rr0 <<= 16;
SETUP_RECT_FILL
while (dst < dst_end)
{
@ -819,23 +723,7 @@ rectangular_repeat_aa_masked(DATA32 *map, int map_len, DATA32 *dst, DATA8 *mask,
int xx, yy, rr0;
int off = gdata->off * (map_len - 1);
if (gdata->sx != gdata->s)
{
axx = (gdata->s * axx) / gdata->sx;
axy = (gdata->s * axy) / gdata->sx;
}
if (gdata->sy != gdata->s)
{
ayy = (gdata->s * ayy) / gdata->sy;
ayx = (gdata->s * ayx) / gdata->sy;
}
ayx += (0.070710678 * ayx);
axx += (0.070710678 * axx);
xx = (axx * x) + (axy * y);
yy = (ayx * x) + (ayy * y);
rr0 = gdata->r0 * gdata->s;
rr0 <<= 16;
SETUP_RECT_FILL
#ifdef BUILD_MMX
pxor_r2r(mm0, mm0);
@ -891,23 +779,7 @@ rectangular_restrict_reflect(DATA32 *map, int map_len, DATA32 *dst, DATA8 *mask,
int xx, yy, rr0;
int off = gdata->off * (map_len - 1);
if (gdata->sx != gdata->s)
{
axx = (gdata->s * axx) / gdata->sx;
axy = (gdata->s * axy) / gdata->sx;
}
if (gdata->sy != gdata->s)
{
ayy = (gdata->s * ayy) / gdata->sy;
ayx = (gdata->s * ayx) / gdata->sy;
}
ayx += (0.070710678 * ayx);
axx += (0.070710678 * axx);
xx = (axx * x) + (axy * y);
yy = (ayx * x) + (ayy * y);
rr0 = gdata->r0 * gdata->s;
rr0 <<= 16;
SETUP_RECT_FILL
while (dst < dst_end)
{
@ -947,23 +819,7 @@ rectangular_restrict_reflect_aa(DATA32 *map, int map_len, DATA32 *dst, DATA8 *ma
int xx, yy, rr0;
int off = gdata->off * (map_len - 1);
if (gdata->sx != gdata->s)
{
axx = (gdata->s * axx) / gdata->sx;
axy = (gdata->s * axy) / gdata->sx;
}
if (gdata->sy != gdata->s)
{
ayy = (gdata->s * ayy) / gdata->sy;
ayx = (gdata->s * ayx) / gdata->sy;
}
ayx += (0.070710678 * ayx);
axx += (0.070710678 * axx);
xx = (axx * x) + (axy * y);
yy = (ayx * x) + (ayy * y);
rr0 = gdata->r0 * gdata->s;
rr0 <<= 16;
SETUP_RECT_FILL
#ifdef BUILD_MMX
pxor_r2r(mm0, mm0);
@ -1034,23 +890,7 @@ rectangular_restrict_reflect_masked(DATA32 *map, int map_len, DATA32 *dst, DATA8
int xx, yy, rr0;
int off = gdata->off * (map_len - 1);
if (gdata->sx != gdata->s)
{
axx = (gdata->s * axx) / gdata->sx;
axy = (gdata->s * axy) / gdata->sx;
}
if (gdata->sy != gdata->s)
{
ayy = (gdata->s * ayy) / gdata->sy;
ayx = (gdata->s * ayx) / gdata->sy;
}
ayx += (0.070710678 * ayx);
axx += (0.070710678 * axx);
xx = (axx * x) + (axy * y);
yy = (ayx * x) + (ayy * y);
rr0 = gdata->r0 * gdata->s;
rr0 <<= 16;
SETUP_RECT_FILL
while (dst < dst_end)
{
@ -1090,23 +930,7 @@ rectangular_restrict_reflect_aa_masked(DATA32 *map, int map_len, DATA32 *dst, DA
int xx, yy, rr0;
int off = gdata->off * (map_len - 1);
if (gdata->sx != gdata->s)
{
axx = (gdata->s * axx) / gdata->sx;
axy = (gdata->s * axy) / gdata->sx;
}
if (gdata->sy != gdata->s)
{
ayy = (gdata->s * ayy) / gdata->sy;
ayx = (gdata->s * ayx) / gdata->sy;
}
ayx += (0.070710678 * ayx);
axx += (0.070710678 * axx);
xx = (axx * x) + (axy * y);
yy = (ayx * x) + (ayy * y);
rr0 = gdata->r0 * gdata->s;
rr0 <<= 16;
SETUP_RECT_FILL
#ifdef BUILD_MMX
pxor_r2r(mm0, mm0);
@ -1162,21 +986,7 @@ rectangular_restrict_repeat(DATA32 *map, int map_len, DATA32 *dst, DATA8 *mask,
int xx, yy, rr0;
int off = gdata->off * (map_len - 1);
if (gdata->sx != gdata->s)
{
axx = (gdata->s * axx) / gdata->sx;
axy = (gdata->s * axy) / gdata->sx;
}
if (gdata->sy != gdata->s)
{
ayy = (gdata->s * ayy) / gdata->sy;
ayx = (gdata->s * ayx) / gdata->sy;
}
xx = (axx * x) + (axy * y);
yy = (ayx * x) + (ayy * y);
rr0 = gdata->r0 * gdata->s;
rr0 <<= 16;
SETUP_RECT_FILL
while (dst < dst_end)
{
@ -1206,21 +1016,7 @@ rectangular_restrict_repeat_aa(DATA32 *map, int map_len, DATA32 *dst, DATA8 *mas
int xx, yy, rr0;
int off = gdata->off * (map_len - 1);
if (gdata->sx != gdata->s)
{
axx = (gdata->s * axx) / gdata->sx;
axy = (gdata->s * axy) / gdata->sx;
}
if (gdata->sy != gdata->s)
{
ayy = (gdata->s * ayy) / gdata->sy;
ayx = (gdata->s * ayx) / gdata->sy;
}
xx = (axx * x) + (axy * y);
yy = (ayx * x) + (ayy * y);
rr0 = gdata->r0 * gdata->s;
rr0 <<= 16;
SETUP_RECT_FILL
#ifdef BUILD_MMX
pxor_r2r(mm0, mm0);
@ -1288,21 +1084,7 @@ rectangular_restrict_repeat_masked(DATA32 *map, int map_len, DATA32 *dst, DATA8
int xx, yy, rr0;
int off = gdata->off * (map_len - 1);
if (gdata->sx != gdata->s)
{
axx = (gdata->s * axx) / gdata->sx;
axy = (gdata->s * axy) / gdata->sx;
}
if (gdata->sy != gdata->s)
{
ayy = (gdata->s * ayy) / gdata->sy;
ayx = (gdata->s * ayx) / gdata->sy;
}
xx = (axx * x) + (axy * y);
yy = (ayx * x) + (ayy * y);
rr0 = gdata->r0 * gdata->s;
rr0 <<= 16;
SETUP_RECT_FILL
while (dst < dst_end)
{
@ -1332,21 +1114,7 @@ rectangular_restrict_repeat_aa_masked(DATA32 *map, int map_len, DATA32 *dst, DAT
int xx, yy, rr0;
int off = gdata->off * (map_len - 1);
if (gdata->sx != gdata->s)
{
axx = (gdata->s * axx) / gdata->sx;
axy = (gdata->s * axy) / gdata->sx;
}
if (gdata->sy != gdata->s)
{
ayy = (gdata->s * ayy) / gdata->sy;
ayx = (gdata->s * ayx) / gdata->sy;
}
xx = (axx * x) + (axy * y);
yy = (ayx * x) + (ayy * y);
rr0 = gdata->r0 * gdata->s;
rr0 <<= 16;
SETUP_RECT_FILL
#ifdef BUILD_MMX
pxor_r2r(mm0, mm0);
@ -1400,23 +1168,7 @@ rectangular_pad(DATA32 *map, int map_len, DATA32 *dst, DATA8 *mask, int dst_len,
Rectangular_Data *gdata = (Rectangular_Data *)params_data;
int xx, yy, rr0;
if (gdata->sx != gdata->s)
{
axx = (gdata->s * axx) / gdata->sx;
axy = (gdata->s * axy) / gdata->sx;
}
if (gdata->sy != gdata->s)
{
ayy = (gdata->s * ayy) / gdata->sy;
ayx = (gdata->s * ayx) / gdata->sy;
}
ayx += (0.070710678 * ayx);
axx += (0.070710678 * axx);
xx = (axx * x) + (axy * y);
yy = (ayx * x) + (ayy * y);
rr0 = gdata->r0 * gdata->s;
rr0 <<= 16;
SETUP_RECT_FILL
while (dst < dst_end)
{
@ -1447,23 +1199,7 @@ rectangular_pad_aa(DATA32 *map, int map_len, DATA32 *dst, DATA8 *mask, int dst_l
Rectangular_Data *gdata = (Rectangular_Data *)params_data;
int xx, yy, rr0;
if (gdata->sx != gdata->s)
{
axx = (gdata->s * axx) / gdata->sx;
axy = (gdata->s * axy) / gdata->sx;
}
if (gdata->sy != gdata->s)
{
ayy = (gdata->s * ayy) / gdata->sy;
ayx = (gdata->s * ayx) / gdata->sy;
}
ayx += (0.070710678 * ayx);
axx += (0.070710678 * axx);
xx = (axx * x) + (axy * y);
yy = (ayx * x) + (ayy * y);
rr0 = gdata->r0 * gdata->s;
rr0 <<= 16;
SETUP_RECT_FILL
#ifdef BUILD_MMX
pxor_r2r(mm0, mm0);
@ -1513,26 +1249,9 @@ rectangular_pad_masked(DATA32 *map, int map_len, DATA32 *dst, DATA8 *mask, int d
{
DATA32 *dst_end = dst + dst_len;
Rectangular_Data *gdata = (Rectangular_Data *)params_data;
int xx, yy, rr0;
if (gdata->sx != gdata->s)
{
axx = (gdata->s * axx) / gdata->sx;
axy = (gdata->s * axy) / gdata->sx;
}
if (gdata->sy != gdata->s)
{
ayy = (gdata->s * ayy) / gdata->sy;
ayx = (gdata->s * ayx) / gdata->sy;
}
ayx += (0.070710678 * ayx);
axx += (0.070710678 * axx);
xx = (axx * x) + (axy * y);
yy = (ayx * x) + (ayy * y);
rr0 = gdata->r0 * gdata->s;
rr0 <<= 16;
SETUP_RECT_FILL
while (dst < dst_end)
{
@ -1561,26 +1280,9 @@ rectangular_pad_aa_masked(DATA32 *map, int map_len, DATA32 *dst, DATA8 *mask, in
{
DATA32 *dst_end = dst + dst_len;
Rectangular_Data *gdata = (Rectangular_Data *)params_data;
int xx, yy, rr0;
if (gdata->sx != gdata->s)
{
axx = (gdata->s * axx) / gdata->sx;
axy = (gdata->s * axy) / gdata->sx;
}
if (gdata->sy != gdata->s)
{
ayy = (gdata->s * ayy) / gdata->sy;
ayx = (gdata->s * ayx) / gdata->sy;
}
ayx += (0.070710678 * ayx);
axx += (0.070710678 * axx);
xx = (axx * x) + (axy * y);
yy = (ayx * x) + (ayy * y);
rr0 = gdata->r0 * gdata->s;
rr0 <<= 16;
SETUP_RECT_FILL
#ifdef BUILD_MMX
pxor_r2r(mm0, mm0);

View File

@ -146,7 +146,7 @@ sinusoidal_has_alpha(RGBA_Gradient *gr, int spread, int op)
{
if (!gr || (gr->type.geometer != &sinusoidal)) return 0;
if (gr->map.has_alpha)
if (gr->has_alpha | gr->map.has_alpha)
return 1;
if ( (op == _EVAS_RENDER_COPY) || (op == _EVAS_RENDER_COPY_REL) ||
(op == _EVAS_RENDER_MASK) || (op == _EVAS_RENDER_MUL) )
@ -265,6 +265,14 @@ sinusoidal_get_fill_func(RGBA_Gradient *gr, int spread, int op, unsigned char aa
return sfunc;
}
#define SETUP_SINU_FILL \
a00 = gdata->sp * (axx / 65536.0); \
a01 = gdata->sp * (axy / 65536.0); \
a10 = ayx / 65536.0; \
a11 = ayy / 65536.0; \
xf = (a00 * x) + (a01 * y); \
yf = (a10 * x) + (a11 * y);
static void
sinusoidal_reflect(DATA32 *map, int map_len, DATA32 *dst, DATA8 *mask, int dst_len,
int x, int y, int axx, int axy, int ayx, int ayy, void *params_data)
@ -275,13 +283,7 @@ sinusoidal_reflect(DATA32 *map, int map_len, DATA32 *dst, DATA8 *mask, int dst_l
float a00, a01, a10, a11;
float off = gdata->off * (map_len - 1);
a00 = gdata->sp * (axx / 65536.0);
a01 = gdata->sp * (axy / 65536.0);
a10 = ayx / 65536.0;
a11 = ayy / 65536.0;
xf = (a00 * x) + (a01 * y);
yf = (a10 * x) + (a11 * y);
SETUP_SINU_FILL
while (dst < dst_end)
{
@ -310,13 +312,7 @@ sinusoidal_reflect_aa(DATA32 *map, int map_len, DATA32 *dst, DATA8 *mask, int ds
float a00, a01, a10, a11;
float off = gdata->off * (map_len - 1);
a00 = gdata->sp * (axx / 65536.0);
a01 = gdata->sp * (axy / 65536.0);
a10 = ayx / 65536.0;
a11 = ayy / 65536.0;
xf = (a00 * x) + (a01 * y);
yf = (a10 * x) + (a11 * y);
SETUP_SINU_FILL
while (dst < dst_end)
{
@ -353,13 +349,7 @@ sinusoidal_repeat(DATA32 *map, int map_len, DATA32 *dst, DATA8 *mask, int dst_le
float a00, a01, a10, a11;
float off = gdata->off * (map_len - 1);
a00 = gdata->sp * (axx / 65536.0);
a01 = gdata->sp * (axy / 65536.0);
a10 = ayx / 65536.0;
a11 = ayy / 65536.0;
xf = (a00 * x) + (a01 * y);
yf = (a10 * x) + (a11 * y);
SETUP_SINU_FILL
while (dst < dst_end)
{
@ -382,13 +372,7 @@ sinusoidal_repeat_aa(DATA32 *map, int map_len, DATA32 *dst, DATA8 *mask, int dst
float a00, a01, a10, a11;
float off = gdata->off * (map_len - 1);
a00 = gdata->sp * (axx / 65536.0);
a01 = gdata->sp * (axy / 65536.0);
a10 = ayx / 65536.0;
a11 = ayy / 65536.0;
xf = (a00 * x) + (a01 * y);
yf = (a10 * x) + (a11 * y);
SETUP_SINU_FILL
while (dst < dst_end)
{
@ -421,13 +405,7 @@ sinusoidal_restrict_reflect(DATA32 *map, int map_len, DATA32 *dst, DATA8 *mask,
float a00, a01, a10, a11;
float off = gdata->off * (map_len - 1);
a00 = gdata->sp * (axx / 65536.0);
a01 = gdata->sp * (axy / 65536.0);
a10 = ayx / 65536.0;
a11 = ayy / 65536.0;
xf = (a00 * x) + (a01 * y);
yf = (a10 * x) + (a11 * y);
SETUP_SINU_FILL
while (dst < dst_end)
{
@ -462,13 +440,7 @@ sinusoidal_restrict_reflect_aa(DATA32 *map, int map_len, DATA32 *dst, DATA8 *mas
float a00, a01, a10, a11;
float off = gdata->off * (map_len - 1);
a00 = gdata->sp * (axx / 65536.0);
a01 = gdata->sp * (axy / 65536.0);
a10 = ayx / 65536.0;
a11 = ayy / 65536.0;
xf = (a00 * x) + (a01 * y);
yf = (a10 * x) + (a11 * y);
SETUP_SINU_FILL
while (dst < dst_end)
{
@ -519,13 +491,7 @@ sinusoidal_restrict_reflect_masked(DATA32 *map, int map_len, DATA32 *dst, DATA8
float a00, a01, a10, a11;
float off = gdata->off * (map_len - 1);
a00 = gdata->sp * (axx / 65536.0);
a01 = gdata->sp * (axy / 65536.0);
a10 = ayx / 65536.0;
a11 = ayy / 65536.0;
xf = (a00 * x) + (a01 * y);
yf = (a10 * x) + (a11 * y);
SETUP_SINU_FILL
while (dst < dst_end)
{
@ -560,13 +526,7 @@ sinusoidal_restrict_reflect_aa_masked(DATA32 *map, int map_len, DATA32 *dst, DAT
float a00, a01, a10, a11;
float off = gdata->off * (map_len - 1);
a00 = gdata->sp * (axx / 65536.0);
a01 = gdata->sp * (axy / 65536.0);
a10 = ayx / 65536.0;
a11 = ayy / 65536.0;
xf = (a00 * x) + (a01 * y);
yf = (a10 * x) + (a11 * y);
SETUP_SINU_FILL
while (dst < dst_end)
{
@ -611,13 +571,7 @@ sinusoidal_restrict_repeat(DATA32 *map, int map_len, DATA32 *dst, DATA8 *mask, i
float a00, a01, a10, a11;
float off = gdata->off * (map_len - 1);
a00 = gdata->sp * (axx / 65536.0);
a01 = gdata->sp * (axy / 65536.0);
a10 = ayx / 65536.0;
a11 = ayy / 65536.0;
xf = (a00 * x) + (a01 * y);
yf = (a10 * x) + (a11 * y);
SETUP_SINU_FILL
while (dst < dst_end)
{
@ -646,13 +600,7 @@ sinusoidal_restrict_repeat_aa(DATA32 *map, int map_len, DATA32 *dst, DATA8 *mask
float a00, a01, a10, a11;
float off = gdata->off * (map_len - 1);
a00 = gdata->sp * (axx / 65536.0);
a01 = gdata->sp * (axy / 65536.0);
a10 = ayx / 65536.0;
a11 = ayy / 65536.0;
xf = (a00 * x) + (a01 * y);
yf = (a10 * x) + (a11 * y);
SETUP_SINU_FILL
while (dst < dst_end)
{
@ -699,13 +647,7 @@ sinusoidal_restrict_repeat_masked(DATA32 *map, int map_len, DATA32 *dst, DATA8 *
float a00, a01, a10, a11;
float off = gdata->off * (map_len - 1);
a00 = gdata->sp * (axx / 65536.0);
a01 = gdata->sp * (axy / 65536.0);
a10 = ayx / 65536.0;
a11 = ayy / 65536.0;
xf = (a00 * x) + (a01 * y);
yf = (a10 * x) + (a11 * y);
SETUP_SINU_FILL
while (dst < dst_end)
{
@ -734,13 +676,7 @@ sinusoidal_restrict_repeat_aa_masked(DATA32 *map, int map_len, DATA32 *dst, DATA
float a00, a01, a10, a11;
float off = gdata->off * (map_len - 1);
a00 = gdata->sp * (axx / 65536.0);
a01 = gdata->sp * (axy / 65536.0);
a10 = ayx / 65536.0;
a11 = ayy / 65536.0;
xf = (a00 * x) + (a01 * y);
yf = (a10 * x) + (a11 * y);
SETUP_SINU_FILL
while (dst < dst_end)
{
@ -780,13 +716,7 @@ sinusoidal_pad(DATA32 *map, int map_len, DATA32 *dst, DATA8 *mask, int dst_len,
float xf, yf, sa = gdata->sa;
float a00, a01, a10, a11;
a00 = gdata->sp * (axx / 65536.0);
a01 = gdata->sp * (axy / 65536.0);
a10 = ayx / 65536.0;
a11 = ayy / 65536.0;
xf = (a00 * x) + (a01 * y);
yf = (a10 * x) + (a11 * y);
SETUP_SINU_FILL
while (dst < dst_end)
{
@ -810,13 +740,7 @@ sinusoidal_pad_aa(DATA32 *map, int map_len, DATA32 *dst, DATA8 *mask, int dst_le
float xf, yf, sa = gdata->sa;
float a00, a01, a10, a11;
a00 = gdata->sp * (axx / 65536.0);
a01 = gdata->sp * (axy / 65536.0);
a10 = ayx / 65536.0;
a11 = ayy / 65536.0;
xf = (a00 * x) + (a01 * y);
yf = (a10 * x) + (a11 * y);
SETUP_SINU_FILL
while (dst < dst_end)
{

View File

@ -750,6 +750,7 @@ evas_common_scale_rgba_span(DATA32 *src, int src_len, DATA32 mul_col, DATA32 *ds
if (evas_common_cpu_has_feature(CPU_FEATURE_MMX))
{
evas_common_scale_rgba_span_mmx(src, src_len, mul_col, dst, dst_len);
evas_common_cpu_end_opt();
return;
}
#endif

View File

@ -570,6 +570,8 @@ struct _Evas_Func
void *(*image_data_put) (void *data, void *image, DATA32 *image_data);
void *(*image_alpha_set) (void *data, void *image, int has_alpha);
int (*image_alpha_get) (void *data, void *image);
void *(*image_border_set) (void *data, void *image, int l, int r, int t, int b);
void (*image_border_get) (void *data, void *image, int *l, int *r, int *t, int *b);
void (*image_draw) (void *data, void *context, void *surface, void *image, int src_x, int src_y, int src_w, int src_h, int dst_x, int dst_y, int dst_w, int dst_h, int smooth);
char *(*image_comment_get) (void *data, void *image, char *key);
char *(*image_format_get) (void *data, void *image);

View File

@ -69,6 +69,8 @@ static void *eng_image_data_get(void *data, void *image, int to_write, DATA32 **
static void *eng_image_data_put(void *data, void *image, DATA32 *image_data);
static void *eng_image_alpha_set(void *data, void *image, int has_alpha);
static int eng_image_alpha_get(void *data, void *image);
static void *eng_image_border_set(void *data, void *image, int l, int r, int t, int b);
static void eng_image_border_get(void *data, void *image, int *l, int *r, int *t, int *b);
static void eng_image_draw(void *data, void *context, void *surface, void *image, int src_x, int src_y, int src_w, int src_h, int dst_x, int dst_y, int dst_w, int dst_h, int smooth);
static char *eng_image_comment_get(void *data, void *image, char *key);
static char *eng_image_format_get(void *data, void *image);
@ -173,6 +175,8 @@ static Evas_Func eng_func =
eng_image_data_put,
eng_image_alpha_set,
eng_image_alpha_get,
eng_image_border_set,
eng_image_border_get,
eng_image_draw,
eng_image_comment_get,
eng_image_format_get,
@ -1036,6 +1040,24 @@ eng_image_alpha_get(void *data, void *image)
return 0;
}
static void *
eng_image_border_set(void *data, void *image, int l, int r, int t, int b)
{
Render_Engine *re;
re = (Render_Engine *)data;
return image;
}
static void
eng_image_border_get(void *data, void *image, int *l, int *r, int *t, int *b)
{
Render_Engine *re;
re = (Render_Engine *)data;
return;
}
static void
eng_image_draw(void *data, void *context, void *surface, void *image, int src_x, int src_y, int src_w, int src_h, int dst_x, int dst_y, int dst_w, int dst_h, int smooth)
{

View File

@ -69,6 +69,8 @@ static Evas_Func evas_engine_directfb_func = {
evas_engine_directfb_image_data_put,
evas_engine_directfb_image_alpha_set,
evas_engine_directfb_image_alpha_get,
evas_engine_directfb_image_border_set,
evas_engine_directfb_image_border_get,
evas_engine_directfb_image_draw,
evas_engine_directfb_image_comment_get,
evas_engine_directfb_image_format_get,

View File

@ -268,6 +268,22 @@ evas_engine_directfb_image_alpha_get(void *data, void *image)
return 0;
}
void *
evas_engine_directfb_image_border_set(void *data, void *image, int l, int r, int t, int b)
{
return image;
}
void
evas_engine_directfb_image_border_get(void *data, void *image, int *l, int *r, int *t, int *b)
{
Render_Engine *re;
RGBA_Image *im;
re = (Render_Engine *) data;
im = image;
}
void
evas_engine_directfb_image_draw(void *data, void *context, void *surface,
void *image, int src_region_x, int src_region_y,

View File

@ -30,6 +30,12 @@ void *evas_engine_directfb_image_alpha_set(void *data,
int has_alpha);
int evas_engine_directfb_image_alpha_get(void *data,
void *image);
void *evas_engine_directfb_image_border_set(void *data,
void *image,
int l, int r, int t, int b);
void evas_engine_directfb_image_border_get(void *data,
void *image,
int *l, int *r, int *t, int *b);
void evas_engine_directfb_image_draw(void *data, void *context,
void *surface, void *image,
int src_x, int src_y,

View File

@ -69,6 +69,8 @@ static void *eng_image_data_get(void *data, void *image, int to_write, DATA32 **
static void *eng_image_data_put(void *data, void *image, DATA32 *image_data);
static void *eng_image_alpha_set(void *data, void *image, int has_alpha);
static int eng_image_alpha_get(void *data, void *image);
static void *eng_image_border_set(void *data, void *image, int l, int r, int t, int b);
static void eng_image_border_get(void *data, void *image, int *l, int *r, int *t, int *b);
static void eng_image_draw(void *data, void *context, void *surface, void *image, int src_x, int src_y, int src_w, int src_h, int dst_x, int dst_y, int dst_w, int dst_h, int smooth);
static char *eng_image_comment_get(void *data, void *image, char *key);
static char *eng_image_format_get(void *data, void *image);
@ -179,6 +181,8 @@ static Evas_Func eng_func =
eng_image_data_put,
eng_image_alpha_set,
eng_image_alpha_get,
eng_image_border_set,
eng_image_border_get,
eng_image_draw,
eng_image_comment_get,
eng_image_format_get,
@ -998,6 +1002,24 @@ eng_image_alpha_get(void *data, void *image)
return 0;
}
static void *
eng_image_border_set(void *data, void *image, int l, int r, int t, int b)
{
Render_Engine *re;
re = (Render_Engine *)data;
return image;
}
static void
eng_image_border_get(void *data, void *image, int *l, int *r, int *t, int *b)
{
Render_Engine *re;
re = (Render_Engine *)data;
}
static void
eng_image_draw(void *data, void *context, void *surface, void *image, int src_x, int src_y, int src_w, int src_h, int dst_x, int dst_y, int dst_w, int dst_h, int smooth)
{

View File

@ -248,14 +248,12 @@ static void
eng_gradient_map(void *data, void *context, void *gradient, int spread)
{
evas_common_gradient_map(context, gradient, spread);
evas_common_cpu_end_opt();
}
static void
eng_gradient_draw(void *data, void *context, void *surface, void *gradient, int x, int y, int w, int h, double angle, int spread)
{
evas_common_gradient_draw(surface, context, x, y, w, h, gradient, angle, spread);
evas_common_cpu_end_opt();
}
static void *
@ -423,6 +421,23 @@ eng_image_alpha_get(void *data, void *image)
return 0;
}
static void *
eng_image_border_set(void *data, void *image, int l, int r, int t, int b)
{
RGBA_Image *im;
im = image;
return im;
}
static void
eng_image_border_get(void *data, void *image, int *l, int *r, int *t, int *b)
{
RGBA_Image *im;
im = image;
}
static void
eng_image_draw(void *data, void *context, void *surface, void *image, int src_x, int src_y, int src_w, int src_h, int dst_x, int dst_y, int dst_w, int dst_h, int smooth)
{
@ -723,6 +738,8 @@ static Evas_Func func =
eng_image_data_put,
eng_image_alpha_set,
eng_image_alpha_get,
eng_image_border_set,
eng_image_border_get,
eng_image_draw,
eng_image_comment_get,
eng_image_format_get,

View File

@ -76,6 +76,8 @@ static void *eng_image_data_get(void *data, void *image, int to_write, DATA32 **
static void *eng_image_data_put(void *data, void *image, DATA32 *image_data);
static void *eng_image_alpha_set(void *data, void *image, int has_alpha);
static int eng_image_alpha_get(void *data, void *image);
static void *eng_image_border_set(void *data, void *image, int l, int r, int t, int b);
static void eng_image_border_get(void *data, void *image, int *l, int *r, int *t, int *b);
static void eng_image_draw(void *data, void *context, void *surface, void *image, int src_x, int src_y, int src_w, int src_h, int dst_x, int dst_y, int dst_w, int dst_h, int smooth);
static const char *eng_image_comment_get(void *data, void *image, char *key);
static char *eng_image_format_get(void *data, void *image);
@ -657,6 +659,21 @@ eng_image_alpha_get(void *data, void *image)
return _xre_image_alpha_get((XR_Image *)image);
}
static void *
eng_image_border_set(void *data, void *image, int l, int r, int t, int b)
{
if (!image) return image;
_xre_image_border_set((XR_Image *)image, l, r, t, b);
return image;
}
static void
eng_image_border_get(void *data, void *image, int *l, int *r, int *t, int *b)
{
if (!image) return;
_xre_image_border_get((XR_Image *)image, l, r, t, b);
}
static void
eng_image_draw(void *data, void *context, void *surface, void *image, int src_x, int src_y, int src_w, int src_h, int dst_x, int dst_y, int dst_w, int dst_h, int smooth)
{
@ -793,6 +810,8 @@ module_open(Evas_Module *em)
ORD(image_data_put);
ORD(image_alpha_set);
ORD(image_alpha_get);
ORD(image_border_set);
ORD(image_border_get);
ORD(image_draw);
ORD(image_comment_get);
ORD(image_format_get);

View File

@ -55,6 +55,7 @@ struct _Xrender_Surface
Picture pic;
unsigned char alpha : 1;
unsigned char allocated : 1;
unsigned char bordered : 1;
};
/* ximage support calls (ximage vs xshmimage, cache etc.) */
@ -117,6 +118,8 @@ XR_Image *_xre_image_data_find(void *data);
void _xre_image_data_put(XR_Image *im, void *data);
void _xre_image_alpha_set(XR_Image *im, int alpha);
int _xre_image_alpha_get(XR_Image *im);
void _xre_image_border_set(XR_Image *im, int l, int r, int t, int b);
void _xre_image_border_get(XR_Image *im, int *l, int *r, int *t, int *b);
void _xre_image_surface_gen(XR_Image *im);
void _xre_image_cache_set(int size);
int _xre_image_cache_get(void);

View File

@ -164,7 +164,7 @@ void
_xre_gradient_draw(Xrender_Surface *rs, RGBA_Draw_Context *dc, XR_Gradient *gr, int x, int y, int w, int h, double angle, int spread)
{
RGBA_Image *im;
int mul_use;
int mul_use;
if ((w <= 0) || (h <= 0)) return;
if (!rs || !dc || !gr) return;

View File

@ -471,6 +471,29 @@ _xre_image_alpha_get(XR_Image *im)
return im->alpha;
}
void
_xre_image_border_set(XR_Image *im, int l, int r, int t, int b)
{
if (!im) return;
_xre_image_surface_gen(im);
if (l < 1) l = 0;
if (r < 1) r = 0;
if (t < 1) t = 0;
if (b < 1) b = 0;
if (im->surface)
{
if (l | r | t | b)
im->surface->bordered = 1;
else
im->surface->bordered = 0;
}
}
void
_xre_image_border_get(XR_Image *im, int *l, int *r, int *t, int *b)
{
}
void
_xre_image_surface_gen(XR_Image *im)
{

View File

@ -336,18 +336,34 @@ void
_xr_render_surface_composite(Xrender_Surface *srs, Xrender_Surface *drs, RGBA_Draw_Context *dc, int sx, int sy, int sw, int sh, int x, int y, int w, int h, int smooth)
{
Xrender_Surface *trs = NULL;
XTransform xf;
XTransform xf, id;
XRenderPictureAttributes att;
Picture mask;
int r, g, b, a, op;
int sf;
int e;
if ((sw <= 0) || (sh <= 0) || (w <= 0) || (h <= 0)) return;
e = 0;
if ((sw != w) || (sh != h))
e = 1;
att.clip_mask = None;
XRenderChangePicture(srs->xinf->disp, srs->pic, CPClipMask, &att);
XRenderChangePicture(srs->xinf->disp, drs->pic, CPClipMask, &att);
id.matrix[0][0] = 1 << 16;
id.matrix[0][1] = 0;
id.matrix[0][2] = 0;
id.matrix[1][0] = 0;
id.matrix[1][1] = 1 << 16;
id.matrix[1][2] = 0;
id.matrix[2][0] = 0;
id.matrix[2][1] = 0;
id.matrix[2][2] = 1 << 16;
op = PictOpSrc;
if (srs->alpha) op = PictOpOver;
mask = None;
@ -367,86 +383,57 @@ _xr_render_surface_composite(Xrender_Surface *srs, Xrender_Surface *drs, RGBA_Dr
srs->xinf->mul_b = b;
srs->xinf->mul_a = a;
_xr_render_surface_solid_rectangle_set(srs->xinf->mul,
r,
g,
b,
a,
r, g, b, a,
0, 0, 1, 1);
}
att.component_alpha = 1;
op = PictOpOver;
mask = srs->xinf->mul->pic;
XRenderChangePicture(srs->xinf->disp, mask, CPComponentAlpha, &att);
if ((r == g == b == 0xff) && (a != 0xff))
{
att.component_alpha = 0;
XRenderChangePicture(srs->xinf->disp, mask, CPComponentAlpha, &att);
}
else
{
xf.matrix[0][0] = 1 << 16;
xf.matrix[0][1] = 0;
xf.matrix[0][2] = 0;
xf.matrix[1][0] = 0;
xf.matrix[1][1] = 1 << 16;
xf.matrix[1][2] = 0;
xf.matrix[2][0] = 0;
xf.matrix[2][1] = 0;
xf.matrix[2][2] = 1 << 16;
if ((srs->alpha) || (a != 0xff))
trs = _xr_render_surface_new(srs->xinf, sw + 1, sh + 1,
// trs = _xr_render_surface_new(srs->xinf, sw, sh,
trs = _xr_render_surface_new(srs->xinf, sw + e, sh + e,
srs->xinf->fmt32, 1);
else
trs = _xr_render_surface_new(srs->xinf, sw + 1, sh + 1,
// trs = _xr_render_surface_new(srs->xinf, sw, sh,
trs = _xr_render_surface_new(srs->xinf, sw + e, sh + e,
srs->fmt, srs->alpha);
XRenderSetPictureTransform(srs->xinf->disp, srs->pic, &xf);
if (!trs) return;
att.component_alpha = 1;
XRenderChangePicture(srs->xinf->disp, mask, CPComponentAlpha, &att);
XRenderSetPictureTransform(srs->xinf->disp, srs->pic, &id);
XRenderComposite(srs->xinf->disp, PictOpSrc, srs->pic, mask,
trs->pic, sx, sy, 0, 0, 0, 0, sw, sh);
/* fill right and bottom pixel so interpolation works right */
XRenderComposite(srs->xinf->disp, PictOpSrc, srs->pic, mask,
trs->pic, sx + sw, sy, 0, 0, sw, 0, 1, sh);
XRenderComposite(srs->xinf->disp, PictOpSrc, srs->pic, mask,
trs->pic, sx, sy + sh, 0, 0, 0, sh, sw + 1, 1);
// XRenderComposite(srs->xinf->disp, PictOpSrc, srs->pic, mask,
// trs->pic, sx + sw, sy + sh, 0, 0, sw, sh, 1, 1);
mask = 0;
if (e)
{
XRenderComposite(srs->xinf->disp, PictOpSrc, srs->pic, mask,
trs->pic, sx + sw - 1, sy, 0, 0, sw, 0, 1, sh);
XRenderComposite(srs->xinf->disp, PictOpSrc, srs->pic, mask,
trs->pic, sx, sy + sh - 1, 0, 0, 0, sh, sw, 1);
XRenderComposite(srs->xinf->disp, PictOpSrc, srs->pic, mask,
trs->pic, sx + sw - 1, sy + sh - 1, 0, 0, sw, sh, 1, 1);
}
mask = None;
}
}
}
/*
sf = MAX(sw, sh);
#define BMAX 26
if (sf <= 8 ) sf = 1 << (BMAX - 3);
else if (sf <= 16 ) sf = 1 << (BMAX - 4);
else if (sf <= 32 ) sf = 1 << (BMAX - 5);
else if (sf <= 64 ) sf = 1 << (BMAX - 6);
else if (sf <= 128 ) sf = 1 << (BMAX - 7);
else if (sf <= 256 ) sf = 1 << (BMAX - 8);
else if (sf <= 512 ) sf = 1 << (BMAX - 9);
else if (sf <= 1024 ) sf = 1 << (BMAX - 10);
else if (sf <= 2048 ) sf = 1 << (BMAX - 11);
else if (sf <= 4096 ) sf = 1 << (BMAX - 12);
else if (sf <= 8192 ) sf = 1 << (BMAX - 13);
else if (sf <= 16384) sf = 1 << (BMAX - 14);
else sf = 1 << (BMAX - 15);
*/
// xf.matrix[0][0] = (sf * sw) / w;
xf.matrix[0][0] = (sw << 16) / w;
xf.matrix[0][1] = 0;
xf.matrix[0][2] = 0;
xf.matrix[1][0] = 0;
// xf.matrix[1][1] = (sf * sh) / h;
xf.matrix[1][1] = (sh << 16) / h;
xf.matrix[1][2] = 0;
xf.matrix[2][0] = 0;
xf.matrix[2][1] = 0;
xf.matrix[2][2] = 1 << 16;
// xf.matrix[2][2] = sf;
_xr_render_surface_clips_set(drs, dc, x, y, w, h);
if (trs)
@ -463,18 +450,45 @@ _xr_render_surface_composite(Xrender_Surface *srs, Xrender_Surface *drs, RGBA_Dr
}
else
{
if (smooth)
XRenderSetPictureFilter(srs->xinf->disp, srs->pic, "best", NULL, 0);
else
XRenderSetPictureFilter(srs->xinf->disp, srs->pic, "nearest", NULL, 0);
XRenderSetPictureTransform(srs->xinf->disp, srs->pic, &xf);
XRenderComposite(srs->xinf->disp, op, srs->pic, mask, drs->pic,
// (sx * w) / sw,
// (sy * h) / sh,
((sx * w) + (sw / 2)) / sw,
((sy * h) + (sh / 2)) / sh,
0, 0, x, y, w, h);
if (srs->bordered && e)
{
trs = _xr_render_surface_new(srs->xinf, sw + 1, sh + 1,
srs->fmt, srs->alpha);
if (!trs) return;
XRenderSetPictureTransform(srs->xinf->disp, srs->pic, &id);
XRenderComposite(srs->xinf->disp, PictOpSrc, srs->pic, None,
trs->pic, sx, sy, 0, 0, 0, 0, sw, sh);
XRenderComposite(srs->xinf->disp, PictOpSrc, srs->pic, None,
trs->pic, sx + sw - 1, sy, 0, 0, sw, 0, 1, sh);
XRenderComposite(srs->xinf->disp, PictOpSrc, srs->pic, None,
trs->pic, sx, sy + sh - 1, 0, 0, 0, sh, sw, 1);
XRenderComposite(srs->xinf->disp, PictOpSrc, srs->pic, None,
trs->pic, sx + sw - 1, sy + sh - 1, 0, 0, sw, sh, 1, 1);
if (smooth)
XRenderSetPictureFilter(trs->xinf->disp, trs->pic, "best", NULL, 0);
else
XRenderSetPictureFilter(trs->xinf->disp, trs->pic, "nearest", NULL, 0);
XRenderSetPictureTransform(trs->xinf->disp, trs->pic, &xf);
XRenderComposite(trs->xinf->disp, op, trs->pic, mask, drs->pic,
0, 0, 0, 0, x, y, w, h);
_xr_render_surface_free(trs);
}
else
{
if (smooth)
XRenderSetPictureFilter(srs->xinf->disp, srs->pic, "best", NULL, 0);
else
XRenderSetPictureFilter(srs->xinf->disp, srs->pic, "nearest", NULL, 0);
XRenderSetPictureTransform(srs->xinf->disp, srs->pic, &xf);
XRenderComposite(srs->xinf->disp, op, srs->pic, mask, drs->pic,
((sx * w) + (sw / 2)) / sw,
((sy * h) + (sh / 2)) / sh,
0, 0, x, y, w, h);
}
}
}

View File

@ -79,6 +79,8 @@ static void *eng_image_data_get(void *data, void *image, int to_write, DATA32 **
static void *eng_image_data_put(void *data, void *image, DATA32 *image_data);
static void *eng_image_alpha_set(void *data, void *image, int has_alpha);
static int eng_image_alpha_get(void *data, void *image);
static void *eng_image_border_set(void *data, void *image, int l, int r, int t, int b);
static void eng_image_border_get(void *data, void *image, int *l, int *r, int *t, int *b);
static void eng_image_draw(void *data, void *context, void *surface, void *image, int src_x, int src_y, int src_w, int src_h, int dst_x, int dst_y, int dst_w, int dst_h, int smooth);
static char *eng_image_comment_get(void *data, void *image, char *key);
static char *eng_image_format_get(void *data, void *image);
@ -667,6 +669,21 @@ eng_image_alpha_get(void *data, void *image)
return _xre_image_alpha_get((XR_Image *)image);
}
static void *
eng_image_border_set(void *data, void *image, int l, int r, int t, int b)
{
if (!image) return image;
_xre_image_border_set((XR_Image *)image, l, r, t, b);
return image;
}
static void
eng_image_border_get(void *data, void *image, int *l, int *r, int *t, int *b)
{
if (!image) return;
_xre_image_border_get((XR_Image *)image, l, r, t, b);
}
static void
eng_image_draw(void *data, void *context, void *surface, void *image, int src_x, int src_y, int src_w, int src_h, int dst_x, int dst_y, int dst_w, int dst_h, int smooth)
{
@ -803,6 +820,8 @@ module_open(Evas_Module *em)
ORD(image_data_put);
ORD(image_alpha_set);
ORD(image_alpha_get);
ORD(image_border_set);
ORD(image_border_get);
ORD(image_draw);
ORD(image_comment_get);
ORD(image_format_get);

View File

@ -61,6 +61,7 @@ struct _XCBrender_Surface
XCBRenderPICTURE pic;
unsigned char alpha : 1;
unsigned char allocated : 1;
unsigned char bordered : 1;
};
/* ximage support calls (ximage vs xshmimage, cache etc.) */
@ -123,6 +124,8 @@ XR_Image *_xre_image_data_find(void *data);
void _xre_image_data_put(XR_Image *im, void *data);
void _xre_image_alpha_set(XR_Image *im, int alpha);
int _xre_image_alpha_get(XR_Image *im);
void _xre_image_border_set(XR_Image *im, int l, int r, int t, int b);
void _xre_image_border_get(XR_Image *im, int *l, int *r, int *t, int *b);
void _xre_image_surface_gen(XR_Image *im);
void _xre_image_cache_set(int size);
int _xre_image_cache_get(void);

View File

@ -475,6 +475,29 @@ _xre_image_alpha_get(XR_Image *im)
return im->alpha;
}
void
_xre_image_border_set(XR_Image *im, int l, int r, int t, int b)
{
if (!im) return;
_xre_image_surface_gen(im);
if (l < 1) l = 0;
if (r < 1) r = 0;
if (t < 1) t = 0;
if (b < 1) b = 0;
if (im->surface)
{
if (l | r | t | b)
im->surface->bordered = 1;
else
im->surface->bordered = 0;
}
}
void
_xre_image_border_get(XR_Image *im, int *l, int *r, int *t, int *b)
{
}
void
_xre_image_surface_gen(XR_Image *im)
{