예제 #1
0
Eina_Bool
_evas_render2(Eo *eo_e, Evas_Public_Data *e)
{
   double t;

   // if nothing changed at all since last render - skip this frame
   if (!e->changed) return EINA_FALSE;
   // we are still rendering while being asked to render - skip this
   if (e->rendering) return EINA_FALSE;
   // mark this canvas as a render2 canvas - not normal render
   e->render2 = EINA_TRUE;
   // check viewport size is same as output - not allowed to differ
   if ((e->output.w != e->viewport.w) || (e->output.h != e->viewport.h))
     ERR("viewport size != output size!");

   // if render threads not initted - init them - maybe move this later?
   _evas_render2_th_init();

   printf("-------------------------------------------- %p %p\n", eo_e, e);
   // wait for any previous render pass to do its thing
   t = get_time();
   evas_canvas_async_block(e);
   t = get_time() - t;
   printf("T: block wait: "); out_time(t);
   // we have to calculate smare objects before render so do that here
   t = get_time();
   evas_call_smarts_calculate(eo_e);
   t = get_time() - t;
   printf("T: smart calc: "); out_time(t);
   // call canvas callbacks saying we are in the pre-render state
   _always_call(eo_e, EVAS_CALLBACK_RENDER_PRE, NULL);
   // bock any susbequent rneders from doing this walk
   eina_lock_take(&(e->lock_objects));
   // gain a reference
   efl_ref(eo_e);
   // put into the "i'm rendering" pool
   e->rendering = EINA_TRUE;
   _rendering = eina_list_append(_rendering, eo_e);

   // call our flush pre at this point before rendering begins...
   _always_call(eo_e, EVAS_CALLBACK_RENDER_FLUSH_PRE, NULL);

   // tell main render thread to wake up and begin processing this canvas
   _evas_render2_th_main_msg_render(eo_e, e);

   return EINA_FALSE;
}
예제 #2
0
static void
_evas_render2_th_main_delete_objects_clean(Evas_Public_Data *e)
{
   Evas_Object_Protected_Data *obj;
   unsigned int i;
   double t;

   // cleanup deferred object deletion
   t = get_time();
   for (i = 0; i < e->delete_objects.count; ++i)
     {
        obj = eina_array_data_get(&e->delete_objects, i);
        evas_object_free(obj->object, 1);
     }
//   OBJS_ARRAY_CLEAN(&e->delete_objects);
   eina_array_clean(&e->delete_objects);
   t = get_time() - t;
   printf("T: object deletion: "); out_time(t);
}