1. optimize evas lists a bit by keeping a "last" pointer


			
			
				devs/devilhorns/wayland_egl
			
			
		
Carsten Haitzler 22 years ago
parent c20a541305
commit 84d24d28da
  1. 2
      legacy/evas/README
  2. 6
      legacy/evas/configure.in
  3. 3
      legacy/evas/src/Evas.h
  4. 2
      legacy/evas/src/Makefile.am
  5. 89
      legacy/evas/src/evas_list.c
  6. 101
      legacy/evas/src/evas_render.c

@ -1,5 +1,5 @@
-------------------------------------------------------------------------------
E V A S - 0.0.4
E V A S - 0.0.5
-------------------------------------------------------------------------------
This is the ``E Canvas'' - a rip off of some of the other canvas's floating

@ -1,6 +1,6 @@
AC_INIT(src/Evas.h)
AM_CONFIG_HEADER(config.h)
AM_INIT_AUTOMAKE(evas, 0.0.4)
AM_INIT_AUTOMAKE(evas, 0.0.5)
AC_C_BIGENDIAN
AC_PROG_CC
AM_PROG_CC_STDC
@ -183,7 +183,9 @@ if test "x$have_gl" = "xyes"; then
else
echo "WARNING:......."
echo "no OpenGL libraries / headers found. This means no GL support will be"
echo "built into Evas. This means much slower rendering perfromance."
echo "built into Evas. Ifapplications request 3D Hardware rendering from"
echo "evas, they will be forcibly moved back to using software alpha"
ehco "rendering."
echo "Please read the config.log file for more information as to why this library"
echo "was not found."
fi

@ -17,6 +17,8 @@ struct _Evas_List
{
Evas_List prev, next;
void *data;
/* private members - DONT TOUCH */
Evas_List last;
};
/* enums */
@ -235,6 +237,7 @@ Evas_List evas_list_prepend(Evas_List list, void *data);
Evas_List evas_list_append_relative(Evas_List list, void *data, void *relative);
Evas_List evas_list_prepend_relative(Evas_List list, void *data, void *relative);
Evas_List evas_list_remove(Evas_List list, void *data);
Evas_List evas_list_remove_list(Evas_List list, Evas_List remove_list);
void * evas_list_find(Evas_List list, void *data);
Evas_List evas_list_free(Evas_List list);

@ -59,4 +59,4 @@ Evas_private.h
libevas_la_LIBADD = $(LIBS_ALL)
libevas_la_DEPENDENCIES = $(top_builddir)/config.h
libevas_la_LDFLAGS = -version-info 0:4:0
libevas_la_LDFLAGS = -version-info 0:5:0

@ -15,14 +15,31 @@ evas_list_append(Evas_List list, void *data)
new_l->next = NULL;
new_l->prev = NULL;
new_l->data = data;
if (!list) return new_l;
for (l = list; l; l = l->next)
if (!list)
{
new_l->last = new_l;
return new_l;
}
if (list->last)
{
if (!l->next)
l = list->last;
l->next = new_l;
new_l->prev = l;
list->last = new_l;
return list;
}
else
{
for (l = list; l; l = l->next)
{
l->next = new_l;
new_l->prev = l;
return list;
if (!l->next)
{
l->next = new_l;
new_l->prev = l;
list->last = new_l;
return list;
}
}
}
return list;
@ -37,9 +54,15 @@ evas_list_prepend(Evas_List list, void *data)
new_l->next = NULL;
new_l->prev = NULL;
new_l->data = data;
if (!list) return new_l;
if (!list)
{
new_l->last = new_l;
return new_l;
}
new_l->next = list;
list->prev = new_l;
new_l->last = list->last;
list->last = NULL;
return new_l;
}
@ -65,6 +88,8 @@ evas_list_append_relative(Evas_List list, void *data, void *relative)
}
l->next = new_l;
new_l->prev = l;
if (!new_l->next)
list->last = new_l;
return list;
}
}
@ -92,9 +117,22 @@ evas_list_prepend_relative(Evas_List list, void *data, void *relative)
l->prev->next = new_l;
l->prev = new_l;
if (new_l->prev)
return list;
{
if (!new_l->next)
list->last = new_l;
return list;
}
else
return new_l;
{
if (!new_l->next)
new_l->last = new_l;
else
{
new_l->last = list->last;
list->last = NULL;
}
return new_l;
}
}
}
return evas_list_prepend(list, data);
@ -117,7 +155,13 @@ evas_list_remove(Evas_List list, void *data)
return_l = list;
}
else
return_l = l->next;
{
return_l = l->next;
if (return_l)
return_l->last = list->last;
}
if (l == list->last)
list->last = l->prev;
free(l);
return return_l;
}
@ -125,6 +169,31 @@ evas_list_remove(Evas_List list, void *data)
return list;
}
Evas_List
evas_list_remove_list(Evas_List list, Evas_List remove_list)
{
Evas_List return_l;
if (!remove_list) return list;
if (remove_list->next)
remove_list->next->prev = remove_list->prev;
if (remove_list->prev)
{
remove_list->prev->next = remove_list->next;
return_l = list;
}
else
{
return_l = remove_list->next;
if (return_l)
return_l->last = list->last;
}
if (remove_list == list->last)
list->last = remove_list->prev;
free(remove_list);
return return_l;
}
void *
evas_list_find(Evas_List list, void *data)
{

@ -1004,7 +1004,8 @@ evas_render_updates(Evas e)
void *fn;
oo = o;
fn = func_text_font_new(e->current.display, oo->current.font, oo->current.size);
fn = func_text_font_new(e->current.display, oo->current.font,
(oo->current.size * (double)e->current.drawable_width) / e->current.viewport.w);
if (fn)
{
func_text_draw(fn,
@ -1013,8 +1014,12 @@ evas_render_updates(Evas e)
e->current.drawable,
e->current.drawable_width,
e->current.drawable_height,
o->current.x,
o->current.y,
(o->current.x *
(double)e->current.drawable_width) /
e->current.viewport.w,
(o->current.y *
(double)e->current.drawable_height) /
e->current.viewport.h,
oo->current.text,
oo->current.r,
oo->current.g,
@ -1035,10 +1040,18 @@ evas_render_updates(Evas e)
e->current.drawable,
e->current.drawable_width,
e->current.drawable_height,
o->current.x,
o->current.y,
o->current.w,
o->current.h,
(o->current.x *
(double)e->current.drawable_width) /
e->current.viewport.w,
(o->current.y *
(double)e->current.drawable_height) /
e->current.viewport.h,
(o->current.w *
(double)e->current.drawable_width) /
e->current.viewport.w,
(o->current.h *
(double)e->current.drawable_height) /
e->current.viewport.h,
oo->current.r,
oo->current.g,
oo->current.b,
@ -1055,10 +1068,18 @@ evas_render_updates(Evas e)
e->current.drawable,
e->current.drawable_width,
e->current.drawable_height,
oo->current.x1,
oo->current.y1,
oo->current.x2,
oo->current.y2,
(oo->current.x1 *
(double)e->current.drawable_width) /
e->current.viewport.w,
(oo->current.y1 *
(double)e->current.drawable_height) /
e->current.viewport.h,
(oo->current.x2 *
(double)e->current.drawable_width) /
e->current.viewport.w,
(oo->current.y2 *
(double)e->current.drawable_height) /
e->current.viewport.h,
oo->current.r,
oo->current.g,
oo->current.b,
@ -1077,10 +1098,18 @@ evas_render_updates(Evas e)
e->current.drawable,
e->current.drawable_width,
e->current.drawable_height,
o->current.x,
o->current.y,
o->current.w,
o->current.h,
(o->current.x *
(double)e->current.drawable_width) /
e->current.viewport.w,
(o->current.y *
(double)e->current.drawable_height) /
e->current.viewport.h,
(o->current.w *
(double)e->current.drawable_width) /
e->current.viewport.w,
(o->current.h *
(double)e->current.drawable_height) /
e->current.viewport.h,
oo->current.angle);
}
break;
@ -1091,16 +1120,38 @@ evas_render_updates(Evas e)
oo = o;
if (oo->current.points)
func_poly_draw(e->current.display,
e->current.image,
e->current.drawable,
e->current.drawable_width,
e->current.drawable_height,
oo->current.points,
oo->current.r,
oo->current.g,
oo->current.b,
oo->current.a);
{
Evas_List points = NULL, pl;
for (pl = oo->current.points; pl; pl = pl->next)
{
Evas_Point p1, p2;
p1 = pl->data;
p2 = malloc(sizeof(struct _Evas_Point));
p2->x = (p1->x *
(double)e->current.drawable_width) /
e->current.viewport.w,
p2->y = (p1->y *
(double)e->current.drawable_height) /
e->current.viewport.h,
points = evas_list_append(points, p2);
}
func_poly_draw(e->current.display,
e->current.image,
e->current.drawable,
e->current.drawable_width,
e->current.drawable_height,
points,
oo->current.r,
oo->current.g,
oo->current.b,
oo->current.a);
for (pl = points; pl; pl = pl->next)
free(pl->data);
evas_list_free(points);
}
}
break;
default:

Loading…
Cancel
Save