ecore-evas-buffer: defer resize callback until pre-render

Summary:
this mimics other engines, all of which have the same mechanics due
to display server interactions. it also avoids unnecessary recalcs before
pre-render if the canvas size was changing repeatedly

fix T6924
ref D6019

Reviewers: cedric, JackDanielZ

Reviewed By: JackDanielZ

Subscribers: #committers, JackDanielZ

Tags: #efl

Maniphest Tasks: T6924

Differential Revision: https://phab.enlightenment.org/D6145
This commit is contained in:
Mike Blumenkrantz 2018-05-23 17:35:18 -04:00
parent 0f57eb8610
commit b7530726c8
2 changed files with 8 additions and 1 deletions

View File

@ -100,7 +100,8 @@ _ecore_evas_resize(Ecore_Evas *ee, int w, int h)
}
if (bdata->image)
evas_object_image_data_set(bdata->image, bdata->pixels);
if (ee->func.fn_resize) ee->func.fn_resize(ee);
else
bdata->resized = 1;
}
static void
@ -163,6 +164,11 @@ _ecore_evas_buffer_prepare(Ecore_Evas *ee)
_ecore_evas_resize(ee, w, h);
bdata->pixels = evas_object_image_data_get(bdata->image, 1);
}
else if (bdata->resized)
{
if (ee->func.fn_resize) ee->func.fn_resize(ee);
bdata->resized = 0;
}
return EINA_TRUE;
}

View File

@ -10,6 +10,7 @@ struct _Ecore_Evas_Engine_Buffer_Data {
void *(*alloc_func) (void *data, int size);
void *data;
Eina_Bool in_render : 1;
Eina_Bool resized : 1;
};
#endif /* _ECORE_EVAS_BUFFER_PRIVATE_H_ */