[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [E-devel] E CVS: apps/e rephorm



On Mon, Aug 14, 2006 at 02:27:03PM +0900, Carsten Haitzler wrote:
> noo noo! use an ecore job! idlers run continually after entering idle! :)
> 

Raster and I talked about this on IRC, but as a heads up to everyone else:

First a quick overiview.

Ecore_Idle_Enterers
  run when we go idle. generally this will be AFTER evas' render (which
  is also an idle enterer, but is generally added before any others)

Ecore_Idlers
  get run continuously while idle.

Ecore_Idle_Exiters
  run just before events start getting processed again

Ecore_Jobs
  run "later". basically, an event is added that calls the job. any
  events already in the queue by the time the current event gets
  processed will be dealt with before the job runs.


For the spectrum object, I needed to rebuild the image data whenever the
currently selected color changed (e.g. dragging in one of the csliders, or
editing one of the text entries). On change, i called a spectrum_update
function, which then created an Ecore_Job to do the actual draw.

I was assuming that if we got several change events quickly, they would
get processed before the job ran, giving us a single draw. e.g.

Change Event > Update > Add Job > (Several other change events whose
updates do nothing) > Draw


But, this wasn't the case. What I actually got was Change > Add Job >
Draw > Change > Add Job > Draw. That is, a draw immediately after the
change occured. 

Idlers, enterers and exiters all occured AFTER evas rendered, so the
state was always one event behind.

I finally ended up using a short timer (.001 sec), which works. (Draw is
delayed long enough for successive quick change events to do nothing).

So, if anyone else is doing a smart object that needs to draw itself, do
something like this for now. Eventually we'll add pre/post_render
callbacks to evas (which would be a more appropriate place to do such a
thing).

rephorm.

> On Mon, 14 Aug 2006 01:21:16 -0400 (EDT) Enlightenment CVS
> <noreply@fitx-00.ewr.caosity.org> babbled:
> 
> > 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... :)