Enlightenment CVS committal

Author  : rephorm
Project : e17
Module  : apps/e

Dir     : e17/apps/e/src/bin


Modified Files:
        e_spectrum.c 


Log Message:

move spectrum redraw to an idler so it gets called at most once per render.
no more performance issue there... :)

===================================================================
RCS file: /cvs/e/e17/apps/e/src/bin/e_spectrum.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
--- e_spectrum.c        14 Aug 2006 04:38:49 -0000      1.1
+++ e_spectrum.c        14 Aug 2006 05:21:16 -0000      1.2
@@ -14,8 +14,11 @@
   E_Color_Component mode; 
 
   E_Color *cv;
+  int draw_queued;
 };
 
+static int _e_spectrum_redraw(void *d);
+
 static void
 _e_spectrum_smart_add(Evas_Object *o)
 {
@@ -33,6 +36,8 @@
   evas_object_image_size_set(sp->o_spectrum, sp->iw, sp->ih);
   evas_object_image_alpha_set(sp->o_spectrum, 1);
 
+  ecore_idler_add(_e_spectrum_redraw, sp);
+
   evas_object_smart_member_add(sp->o_spectrum, o);
 }
 
@@ -243,16 +248,16 @@
   if (b) *b = bb;
 }
 
-void
-_e_spectrum_update(E_Spectrum *sp)
+static int
+_e_spectrum_redraw(void *d)
 {
+  E_Spectrum *sp = d;
+  int *data;
   int i, j;
   int r, g, b;
-  int *data;
   float vx, vy, vz;
-  if (!sp || !sp->cv) return;
 
-  //printf("UPDATE SPECTRUM\n");
+  if (!sp->draw_queued) return 1;
   data = evas_object_image_data_get(sp->o_spectrum, 1);
   if (!data) return;
 
@@ -292,8 +297,17 @@
 
   evas_object_image_data_set(sp->o_spectrum, data);
   evas_object_image_data_update_add(sp->o_spectrum, 0, 0, sp->iw, sp->ih);
+  sp->draw_queued = 0;
+  return 1;
 }
 
+static void
+_e_spectrum_update(E_Spectrum *sp)
+{
+  if (!sp || !sp->cv) return;
+
+  sp->draw_queued = 1;
+}
 
 Evas_Object *
 e_spectrum_add(Evas *e)



-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to