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

Re: [E-devel] Multithreaded Program - Problem with Evas - Refreshing a canvas



On Wed, 27 Sep 2006 12:00:02 +0200 "Seb Dev" <sebdev@gmail.com> babbled:

> Hello list,

EFL is not threadsafe. you cannto use ecore, evas, imlib2, etc. across multiple
threads.

> I develop a multi-threaded program.
> One thread receives some bitmaps (saved in BUFFER_FILE file) and send an
> ecore_event.
> 
>   imlib_save_image(TEMP_BUFFER_FILE);
> 
>  *//Envoi signal pour rafraichir la fenetre evas*
>   event = ecore_event_add(MY_EVENT_TYPE, toto, NULL, NULL);
>     *if*(!event){exit(0);}
> 
> 
> This event is handled by the second thread in order to display them on a
> evas canvas (which is defined in the second thread).
> 
> *//Handler creation*
>   MY_EVENT_TYPE = ecore_event_type_new();
>   handler = ecore_event_handler_add(MY_EVENT_TYPE, callback_resfresh, NULL);
>   *if*(!handler){exit(0);}
> 
> 
>  int callback_resfresh(void *data, int type, void *ev)
> {
> 	refresh();
> 	*return* 1;
> }
> 
> 
> Here is below the function for refreshing the canvas (function defined in
> the second thread) :
> 
> void refresh(void)
> {
>    *if*(tmp){evas_object_del(tmp);}
>    tmp = evas_object_image_add(evas);
> 
>    evas_image_cache_flush(evas);
>    evas_image_cache_reload (evas);
> 
>    evas_object_image_file_set(tmp, TEMP_BUFFER_FILE, NULL);
>    evas_object_move(tmp, 0, 0);
>    evas_object_resize(tmp, win_w, win_h);
>    evas_object_image_fill_set(tmp, 0, 0, win_w, win_h);
>    evas_object_layer_set(tmp,50);
> 
>    evas_object_show(tmp);
>    *//evas_render(evas);*
> }
> 
> 
> My problem : the canvas is refreshed only when the mouse is focused and
> moving on the canvas and I don't understand why.
> 
> 
> If some of you have an idea to solve this problem, thanks a lot for your
> response.
> 
> Seb Dev
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share your
> opinions on IT & business topics through brief surveys -- and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> enlightenment-devel mailing list
> enlightenment-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
> 


-- 
------------- Codito, ergo sum - "I code, therefore I am" --------------
The Rasterman (Carsten Haitzler)    raster@rasterman.com
裸好多
Tokyo, Japan (東京 日本)