Exemplo n.º 1
0
static Eina_Bool
_animate_cb(void *data)
{
	Evas_Object *obj = (Evas_Object *)data;
	evas_object_image_pixels_dirty_set(obj, EINA_TRUE);
	return EINA_TRUE;
}
Exemplo n.º 2
0
static void
win_resize_cb(void *data, Evas *e , Evas_Object *obj , void *event_info)
{
	appdata_s *ad = data;

	if(ad->evas_gl_surface)
	{
		cairo_surface_destroy(ad->surface);
		cairo_destroy(ad->cairo);
		cairo_device_destroy(ad->cairo_device);
		evas_gl_surface_destroy(ad->evas_gl, ad->evas_gl_surface);
		ad->evas_gl_surface = NULL;
	}

	evas_object_geometry_get(obj, NULL, NULL, &ad->width, &ad->height);
	evas_object_image_size_set(ad->img, ad->width, ad->height);
	evas_object_resize(ad->img, ad->width, ad->height);
	evas_object_show(ad->img);

	if(!ad->evas_gl_surface)
	{
		Evas_Native_Surface ns;
		ad->evas_gl_surface = evas_gl_surface_create(ad->evas_gl, ad->evas_gl_config, ad->width, ad->height);
		evas_gl_native_surface_get(ad->evas_gl, ad->evas_gl_surface, &ns);
		evas_object_image_native_surface_set(ad->img, &ns);
		evas_object_image_pixels_dirty_set (ad->img, EINA_TRUE);

		ad->cairo_device = (cairo_device_t *)cairo_evas_gl_device_create (ad->evas_gl, ad->evas_gl_context);
		cairo_gl_device_set_thread_aware(ad->cairo_device, 0);
		ad->surface = (cairo_surface_t *)cairo_gl_surface_create_for_evas_gl(ad->cairo_device, ad->evas_gl_surface, ad->evas_gl_config, ad->width, ad->height);
		ad->cairo = cairo_create (ad->surface);
	}
}
Exemplo n.º 3
0
static Eina_Bool
mainloop_evas_anim_cb( void *p_opaque )
{
    vout_display_t *vd = p_opaque;
    vout_display_sys_t *sys = vd->sys;
    evas_object_image_pixels_dirty_set( sys->p_evas, 1 );

    sys->p_anim = NULL;
    return false;
}
Exemplo n.º 4
0
static Eina_Bool
_emotion_frame_anim(void *data)
{
   Evas_Object *obj = data;
   Smart_Data *sd;

   E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, EINA_FALSE);

   evas_object_image_pixels_dirty_set(sd->obj, 1);
   evas_object_smart_callback_call(obj, SIG_FRAME_DECODE, NULL);
   sd->anim = NULL;

   return EINA_FALSE;
}
Exemplo n.º 5
0
static void
_evas_gl_preload_main_loop_wakeup(void)
{
   Evas_GL_Texture_Async_Preload *async;
   evas_gl_make_current_cb cb = async_gl_make_current;
   void *data = async_engine_data;
   Eina_Bool running = async_loader_running;

   if (running) evas_gl_preload_render_lock(cb, data);
   EINA_LIST_FREE(async_loader_todie, async)
     {
        Eo *target;

        if (async->tex)
          {
             EINA_LIST_FREE(async->tex->targets, target)
               evas_object_image_pixels_dirty_set(target, EINA_TRUE);
          }
        async->im->cache_entry.flags.preload_done = 0;
        if (async->tex)
          {
             async->tex->was_preloaded = EINA_TRUE;

             async->tex->ptt->allocations = 
               eina_list_remove(async->tex->ptt->allocations,
                                async->tex->aptt);
             eina_rectangle_pool_release(async->tex->aptt);
             async->tex->aptt = NULL;
             pt_unref(async->tex->ptt);
             async->tex->ptt = NULL;

             evas_gl_common_texture_free(async->tex, EINA_FALSE);
          }
#ifdef EVAS_CSERVE2
        if (evas_cache2_image_cached(&async->im->cache_entry))
          evas_cache2_image_close(&async->im->cache_entry);
        else
#endif
        evas_cache_image_drop(&async->im->cache_entry);
        free(async);
     }
Exemplo n.º 6
0
static int
EvasDeinitMainloopCb( vout_display_t *vd )
{
    vout_display_sys_t *sys = vd->sys;

    if( sys->p_anim )
    {
        ecore_animator_del( sys->p_anim );
        sys->p_anim = NULL;
    }

    evas_object_event_callback_del_full( sys->p_evas, EVAS_CALLBACK_IMAGE_RESIZE,
                                         EvasResizeCb, vd );

    evas_object_event_callback_del_full( sys->p_evas, EVAS_CALLBACK_MOUSE_DOWN,
                                         EventMouseDownCb, vd );
    evas_object_event_callback_del_full( sys->p_evas, EVAS_CALLBACK_MOUSE_UP,
                                         EvasMouseUpCb, vd );
    evas_object_event_callback_del_full( sys->p_evas, EVAS_CALLBACK_MOUSE_MOVE,
                                         EvasMouseMoveCb, vd );
    evas_object_event_callback_del_full( sys->p_evas, EVAS_CALLBACK_MULTI_DOWN,
                                         EvasMultiDownCb, vd );
    evas_object_event_callback_del_full( sys->p_evas, EVAS_CALLBACK_MULTI_UP,
                                         EvasMultiUpCb, vd );
    evas_object_event_callback_del_full( sys->p_evas, EVAS_CALLBACK_MULTI_MOVE,
                                         EvasMultiMoveCb, vd );
#ifdef HAVE_EVAS_CALLBACK_KEY_UP
    evas_object_event_callback_del_full( sys->p_evas, EVAS_CALLBACK_KEY_UP,
                                         EvasKeyUpCb, vd );
#endif

    if( !sys->b_evas_changed )
    {
        evas_object_image_data_set( sys->p_evas, NULL );
        evas_object_image_pixels_dirty_set( sys->p_evas, 0 );
    }

    return 0;
}
Exemplo n.º 7
0
static int
EvasDisplayMainloopCb( vout_display_t *vd )
{
    vout_display_sys_t *sys = vd->sys;

    if( sys->b_evas_changed || sys->pf_set_data( vd ) )
        return -1;

    evas_object_image_data_update_add( sys->p_evas, 0, 0,
                                       sys->i_width, sys->i_height );
    evas_object_image_pixels_dirty_set( sys->p_evas, 0 );

    if( !sys->p_anim )
        sys->p_anim = ecore_animator_add( mainloop_evas_anim_cb, vd );

    if( sys->p_current_buffer )
        BUFFER_FIFO_PUSH( sys->p_current_buffer );

    sys->p_current_buffer = sys->p_new_buffer;
    sys->p_new_buffer = NULL;
    return 0;
}
Exemplo n.º 8
0
bool EflResources::copyResource( Evas_Object* const _image
                               , std::string const& _path
                               , bool const         _keep_aspect
                               , int                _width
                               , int                _height ) const
{
    bool result( true );
    Evas_Object* object = nullptr;

    if( 0 != preloaded_images__.count( _path ) )
        object = preloaded_images__.find( _path )->second;
    else
    {
        object = preloaded_images__.find( IMG_DIR "/placeholder.png" )->second;
        LOGGER( "Could not find file among preloaded images: " + _path );
        result = false;
    }

    int src_w = 0;
    int src_h = 0;

    evas_object_image_size_get( object
                              , &src_w
                              , &src_h );
    evas_object_image_size_set( _image
                              , src_w
                              , src_h );
    evas_object_image_alpha_set( _image
                               , evas_object_image_alpha_get( object ) );
    evas_object_image_data_set( _image
                              , evas_object_image_data_get( object
                                                          , 0 ) );


    if( _keep_aspect )
    {
        if( 0 == _width || 0 == _height )
        {
            evas_object_geometry_get( _image
                                    , nullptr
                                    , nullptr
                                    , &_width
                                    , &_height );
        }

        int new_w = 0;
        int new_h = 0;
        Utility::calculateImageSize( _width
                                   , _height
                                   , src_w
                                   , src_h
                                   , new_w
                                   , new_h );
        evas_object_resize( _image
                          , new_w
                          , new_h );
    }

    evas_object_image_pixels_dirty_set( _image
                                      , 1 );
    return result;
}