Enlightenment CVS committal
Author : barbieri
Project : e17
Module : libs/evas
Dir : e17/libs/evas/src/lib/canvas
Modified Files:
evas_layer.c
Log Message:
Make layer number a short and Save 8 bytes.
By having a layer as a short (16 bits) we can pack it together with
the bitfields, saving 4 bytes per sub-struct, 8 bytes in total, also
bringing the struct down from 4 to 3 cachelines on my laptop.
Rationale: layers are mostly used to differentiate groups of objects
and they stacking, usually we have few layers and we use very large or
very small numbers to make a layer be at the top or at the bottom, but
usually we don't need so many layers.
Caution: code that use values like 999999 will break, so fix your
code! I'll provide another patch to fix all the CVS using these large
values.
===================================================================
RCS file: /cvs/e/e17/libs/evas/src/lib/canvas/evas_layer.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -3 -r1.20 -r1.21
--- evas_layer.c 8 Feb 2008 22:35:19 -0000 1.20
+++ evas_layer.c 1 May 2008 06:18:21 -0000 1.21
@@ -78,7 +78,7 @@
}
Evas_Layer *
-evas_layer_find(Evas *e, int layer_num)
+evas_layer_find(Evas *e, short layer_num)
{
Evas_Object_List *list;
@@ -139,7 +139,7 @@
* @ingroup Evas_Object_Layer_Group
*/
EAPI void
-evas_object_layer_set(Evas_Object *obj, int l)
+evas_object_layer_set(Evas_Object *obj, short l)
{
Evas *e;
@@ -187,7 +187,7 @@
* @return Number of the layer.
* @ingroup Evas_Object_Layer_Group
*/
-EAPI int
+EAPI short
evas_object_layer_get(const Evas_Object *obj)
{
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs