forked from enlightenment/efl
global freeze/thaw. much more optimial for COMPLEX edjed that take a fair bit
of grunt to re-calculate. avoid caclulations until idle time by freezing and thawing appropriately pre/post render SVN revision: 7178
This commit is contained in:
parent
583791b12e
commit
fa42fa6de5
|
@ -160,7 +160,7 @@ collections {
|
||||||
to, "logo";
|
to, "logo";
|
||||||
}
|
}
|
||||||
rel2 {
|
rel2 {
|
||||||
relative, 2.0, 1.0;
|
relative, 3.0, 1.0;
|
||||||
offset, -64, -1;
|
offset, -64, -1;
|
||||||
to, "logo";
|
to, "logo";
|
||||||
}
|
}
|
||||||
|
@ -171,8 +171,8 @@ collections {
|
||||||
text, "This is a longer test string";
|
text, "This is a longer test string";
|
||||||
font, "Vera";
|
font, "Vera";
|
||||||
size, 6;
|
size, 6;
|
||||||
fit, 0 0;
|
// fit, 0 1;
|
||||||
// min, 1 1;
|
// min, 1 1;
|
||||||
align, 0.0 0.5;
|
align, 0.0 0.5;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,6 +5,8 @@ static void main_stop(void);
|
||||||
static void main_resize(Ecore_Evas *ee);
|
static void main_resize(Ecore_Evas *ee);
|
||||||
static int main_signal_exit(void *data, int ev_type, void *ev);
|
static int main_signal_exit(void *data, int ev_type, void *ev);
|
||||||
static void main_delete_request(Ecore_Evas *ee);
|
static void main_delete_request(Ecore_Evas *ee);
|
||||||
|
static void main_pre_rend(Ecore_Evas *ee);
|
||||||
|
static void main_post_rend(Ecore_Evas *ee);
|
||||||
|
|
||||||
void bg_setup(void);
|
void bg_setup(void);
|
||||||
void bg_resize(double w, double h);
|
void bg_resize(double w, double h);
|
||||||
|
@ -55,6 +57,8 @@ main_start(int argc, char **argv)
|
||||||
if (!ecore_evas) return -1;
|
if (!ecore_evas) return -1;
|
||||||
ecore_evas_callback_delete_request_set(ecore_evas, main_delete_request);
|
ecore_evas_callback_delete_request_set(ecore_evas, main_delete_request);
|
||||||
ecore_evas_callback_resize_set(ecore_evas, main_resize);
|
ecore_evas_callback_resize_set(ecore_evas, main_resize);
|
||||||
|
ecore_evas_callback_pre_render_set(ecore_evas, main_pre_rend);
|
||||||
|
ecore_evas_callback_post_render_set(ecore_evas, main_post_rend);
|
||||||
ecore_evas_title_set(ecore_evas, "Edje Test Program");
|
ecore_evas_title_set(ecore_evas, "Edje Test Program");
|
||||||
ecore_evas_name_class_set(ecore_evas, "edje", "main");
|
ecore_evas_name_class_set(ecore_evas, "edje", "main");
|
||||||
ecore_evas_show(ecore_evas);
|
ecore_evas_show(ecore_evas);
|
||||||
|
@ -95,6 +99,18 @@ main_delete_request(Ecore_Evas *ee)
|
||||||
ecore_main_loop_quit();
|
ecore_main_loop_quit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
main_pre_rend(Ecore_Evas *ee)
|
||||||
|
{
|
||||||
|
edje_thaw();
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
main_post_rend(Ecore_Evas *ee)
|
||||||
|
{
|
||||||
|
edje_freeze();
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
bg_setup(void)
|
bg_setup(void)
|
||||||
{
|
{
|
||||||
|
|
|
@ -10,6 +10,8 @@ extern "C" {
|
||||||
void edje_init (void);
|
void edje_init (void);
|
||||||
void edje_frametime_set (double t);
|
void edje_frametime_set (double t);
|
||||||
double edje_frametime_get (void);
|
double edje_frametime_get (void);
|
||||||
|
void edje_freeze (void);
|
||||||
|
void edje_thaw (void);
|
||||||
|
|
||||||
Evas_Object *edje_object_add (Evas *evas);
|
Evas_Object *edje_object_add (Evas *evas);
|
||||||
void edje_object_file_set (Evas_Object *o, const char *file, const char *part);
|
void edje_object_file_set (Evas_Object *o, const char *file, const char *part);
|
||||||
|
|
|
@ -32,7 +32,6 @@ edje_object_file_set(Evas_Object *obj, const char *file, const char *part)
|
||||||
Edje_Real_Part *rp;
|
Edje_Real_Part *rp;
|
||||||
char buf[256];
|
char buf[256];
|
||||||
|
|
||||||
printf("PART!\n");
|
|
||||||
ep = l->data;
|
ep = l->data;
|
||||||
rp = calloc(1, sizeof(Edje_Real_Part));
|
rp = calloc(1, sizeof(Edje_Real_Part));
|
||||||
if (!rp) return;
|
if (!rp) return;
|
||||||
|
|
|
@ -533,5 +533,6 @@ extern int _edje_anim_count;
|
||||||
extern Ecore_Timer *_edje_timer;
|
extern Ecore_Timer *_edje_timer;
|
||||||
extern Evas_List *_edje_animators;
|
extern Evas_List *_edje_animators;
|
||||||
extern Ejde_Text_Style _edje_text_styles[EDJE_TEXT_EFFECT_LAST];
|
extern Ejde_Text_Style _edje_text_styles[EDJE_TEXT_EFFECT_LAST];
|
||||||
|
extern Evas_List *_edje_edjes;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -18,6 +18,8 @@ static void _edje_smart_clip_unset(Evas_Object * obj);
|
||||||
|
|
||||||
static Evas_Smart *_edje_smart = NULL;
|
static Evas_Smart *_edje_smart = NULL;
|
||||||
|
|
||||||
|
Evas_List *_edje_edjes = NULL;
|
||||||
|
|
||||||
/* API Routines */
|
/* API Routines */
|
||||||
Evas_Object *
|
Evas_Object *
|
||||||
edje_object_add(Evas *evas)
|
edje_object_add(Evas *evas)
|
||||||
|
@ -56,6 +58,7 @@ _edje_smart_add(Evas_Object * obj)
|
||||||
evas_object_smart_data_set(obj, ed);
|
evas_object_smart_data_set(obj, ed);
|
||||||
ed->obj = obj;
|
ed->obj = obj;
|
||||||
evas_object_smart_member_add(ed->clipper, ed->obj);
|
evas_object_smart_member_add(ed->clipper, ed->obj);
|
||||||
|
_edje_edjes = evas_list_append(_edje_edjes, obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -67,6 +70,7 @@ _edje_smart_del(Evas_Object * obj)
|
||||||
if (!ed) return;
|
if (!ed) return;
|
||||||
_edje_clean_objects(ed);
|
_edje_clean_objects(ed);
|
||||||
_edje_unref(ed);
|
_edje_unref(ed);
|
||||||
|
_edje_edjes = evas_list_remove(_edje_edjes, obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
@ -339,7 +339,7 @@ _edje_text_recalc_apply(Edje *ed, Edje_Real_Part *ep,
|
||||||
|
|
||||||
dif = (th - sh) / 4;
|
dif = (th - sh) / 4;
|
||||||
if (dif < 1) dif = 1;
|
if (dif < 1) dif = 1;
|
||||||
while ((th < sh) && (sw >= 0.0))
|
while ((th > sh) && (sw >= 0.0))
|
||||||
{
|
{
|
||||||
size -= dif;
|
size -= dif;
|
||||||
evas_object_text_font_set(ep->object, font, size);
|
evas_object_text_font_set(ep->object, font, size);
|
||||||
|
|
|
@ -1,6 +1,24 @@
|
||||||
#include "Edje.h"
|
#include "Edje.h"
|
||||||
#include "edje_private.h"
|
#include "edje_private.h"
|
||||||
|
|
||||||
|
void
|
||||||
|
edje_freeze(void)
|
||||||
|
{
|
||||||
|
Evas_List *l;
|
||||||
|
|
||||||
|
for (l = _edje_edjes; l; l = l->next)
|
||||||
|
edje_object_freeze((Evas_Object *)(l->data));
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
edje_thaw(void)
|
||||||
|
{
|
||||||
|
Evas_List *l;
|
||||||
|
|
||||||
|
for (l = _edje_edjes; l; l = l->next)
|
||||||
|
edje_object_thaw((Evas_Object *)(l->data));
|
||||||
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
edje_object_freeze(Evas_Object *obj)
|
edje_object_freeze(Evas_Object *obj)
|
||||||
{
|
{
|
||||||
|
@ -424,7 +442,8 @@ int
|
||||||
_edje_thaw(Edje *ed)
|
_edje_thaw(Edje *ed)
|
||||||
{
|
{
|
||||||
ed->freeze--;
|
ed->freeze--;
|
||||||
if ((ed->freeze <= 0) && (ed->recalc))
|
if (ed->freeze < 0) ed->freeze = 0;
|
||||||
|
if ((ed->freeze == 0) && (ed->recalc))
|
||||||
_edje_recalc(ed);
|
_edje_recalc(ed);
|
||||||
return ed->freeze;
|
return ed->freeze;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue