allow the "limit compositor framerate to fixed e framerate" to be optional
SVN revision: 45754
This commit is contained in:
parent
75f18e5c48
commit
fd3c1e4f2a
|
@ -34,6 +34,7 @@ struct _E_Comp
|
||||||
Eina_Inlist *wins;
|
Eina_Inlist *wins;
|
||||||
Eina_List *updates;
|
Eina_List *updates;
|
||||||
Ecore_Animator *render_animator;
|
Ecore_Animator *render_animator;
|
||||||
|
Ecore_Job *update_job;
|
||||||
int render_overflow;
|
int render_overflow;
|
||||||
|
|
||||||
Eina_Bool gl : 1;
|
Eina_Bool gl : 1;
|
||||||
|
@ -317,9 +318,8 @@ _e_mod_comp_pre_swap(void *data, Evas *e)
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
_e_mod_comp_cb_animator(void *data)
|
_e_mod_comp_cb_update(E_Comp *c)
|
||||||
{
|
{
|
||||||
E_Comp *c = data;
|
|
||||||
E_Comp_Win *cw;
|
E_Comp_Win *cw;
|
||||||
Eina_List *new_updates = NULL; // for failed pixmap fetches - get them next frame
|
Eina_List *new_updates = NULL; // for failed pixmap fetches - get them next frame
|
||||||
|
|
||||||
|
@ -332,6 +332,7 @@ _e_mod_comp_cb_animator(void *data)
|
||||||
if (cw->update)
|
if (cw->update)
|
||||||
new_updates = eina_list_append(new_updates, cw);
|
new_updates = eina_list_append(new_updates, cw);
|
||||||
}
|
}
|
||||||
|
if (_comp_mod->conf->lock_fps)
|
||||||
ecore_evas_manual_render(c->ee);
|
ecore_evas_manual_render(c->ee);
|
||||||
if (c->grabbed)
|
if (c->grabbed)
|
||||||
{
|
{
|
||||||
|
@ -341,23 +342,48 @@ _e_mod_comp_cb_animator(void *data)
|
||||||
if (new_updates) _e_mod_comp_render_queue(c);
|
if (new_updates) _e_mod_comp_render_queue(c);
|
||||||
c->updates = new_updates;
|
c->updates = new_updates;
|
||||||
c->render_overflow--;
|
c->render_overflow--;
|
||||||
|
c->update_job = NULL;
|
||||||
if (c->render_overflow == 0)
|
if (c->render_overflow == 0)
|
||||||
{
|
{
|
||||||
c->render_animator = NULL;
|
if (c->render_animator) c->render_animator = NULL;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_e_mod_comp_cb_job(void *data)
|
||||||
|
{
|
||||||
|
_e_mod_comp_cb_update(data);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
_e_mod_comp_cb_animator(void *data)
|
||||||
|
{
|
||||||
|
return _e_mod_comp_cb_update(data);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_e_mod_comp_render_queue(E_Comp *c)
|
_e_mod_comp_render_queue(E_Comp *c)
|
||||||
{
|
{
|
||||||
|
if (_comp_mod->conf->lock_fps)
|
||||||
|
{
|
||||||
if (c->render_animator)
|
if (c->render_animator)
|
||||||
{
|
{
|
||||||
c->render_overflow = 10;
|
c->render_overflow = 10;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
c->render_animator = ecore_animator_add(_e_mod_comp_cb_animator, c);
|
c->render_animator = ecore_animator_add(_e_mod_comp_cb_animator, c);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (c->update_job)
|
||||||
|
{
|
||||||
|
ecore_job_del(c->update_job);
|
||||||
|
c->render_overflow = 0;
|
||||||
|
}
|
||||||
|
c->update_job = ecore_job_add(_e_mod_comp_cb_job, c);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -399,6 +425,20 @@ _e_mod_comp_win_damage_find(Ecore_X_Damage damage)
|
||||||
return cw;
|
return cw;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static Eina_Bool
|
||||||
|
_e_mod_comp_win_do_shadow(E_Comp_Win *cw)
|
||||||
|
{
|
||||||
|
if (cw->shaped) return 0;
|
||||||
|
if (cw->argb)
|
||||||
|
{
|
||||||
|
if (!cw->bd) return 0;
|
||||||
|
if ((cw->bd->client.border.name) &&
|
||||||
|
(!strcmp(cw->bd->client.border.name, "borderless")))
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
static E_Comp_Win *
|
static E_Comp_Win *
|
||||||
_e_mod_comp_win_add(E_Comp *c, Ecore_X_Window win)
|
_e_mod_comp_win_add(E_Comp *c, Ecore_X_Window win)
|
||||||
{
|
{
|
||||||
|
@ -608,7 +648,7 @@ _e_mod_comp_win_show(E_Comp_Win *cw)
|
||||||
{
|
{
|
||||||
if (_comp_mod->conf->use_shadow)
|
if (_comp_mod->conf->use_shadow)
|
||||||
{
|
{
|
||||||
if ((!cw->argb) && (!cw->shaped))
|
if (_e_mod_comp_win_do_shadow(cw))
|
||||||
{
|
{
|
||||||
int ok = 0;
|
int ok = 0;
|
||||||
char buf[PATH_MAX];
|
char buf[PATH_MAX];
|
||||||
|
@ -1042,7 +1082,7 @@ _e_mod_comp_add(E_Manager *man)
|
||||||
if (!c->ee)
|
if (!c->ee)
|
||||||
c->ee = ecore_evas_software_x11_new(NULL, c->win, 0, 0, man->w, man->h);
|
c->ee = ecore_evas_software_x11_new(NULL, c->win, 0, 0, man->w, man->h);
|
||||||
|
|
||||||
ecore_evas_manual_render_set(c->ee, 1);
|
ecore_evas_manual_render_set(c->ee, _comp_mod->conf->lock_fps);
|
||||||
c->evas = ecore_evas_get(c->ee);
|
c->evas = ecore_evas_get(c->ee);
|
||||||
ecore_evas_show(c->ee);
|
ecore_evas_show(c->ee);
|
||||||
|
|
||||||
|
@ -1099,6 +1139,7 @@ _e_mod_comp_del(E_Comp *c)
|
||||||
ecore_x_composite_render_window_disable(c->win);
|
ecore_x_composite_render_window_disable(c->win);
|
||||||
if (c->man->num == 0) e_alert_composite_win = 0;
|
if (c->man->num == 0) e_alert_composite_win = 0;
|
||||||
if (c->render_animator) ecore_animator_del(c->render_animator);
|
if (c->render_animator) ecore_animator_del(c->render_animator);
|
||||||
|
if (c->update_job) ecore_job_del(c->update_job);
|
||||||
free(c);
|
free(c);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1161,13 +1202,14 @@ e_mod_comp_shadow_set(void)
|
||||||
{
|
{
|
||||||
E_Comp_Win *cw;
|
E_Comp_Win *cw;
|
||||||
|
|
||||||
|
ecore_evas_manual_render_set(c->ee, _comp_mod->conf->lock_fps);
|
||||||
EINA_INLIST_FOREACH(c->wins, cw)
|
EINA_INLIST_FOREACH(c->wins, cw)
|
||||||
{
|
{
|
||||||
if (evas_object_visible_get(cw->obj) && (cw->shobj))
|
if (evas_object_visible_get(cw->obj) && (cw->shobj))
|
||||||
{
|
{
|
||||||
if (_comp_mod->conf->use_shadow)
|
if (_comp_mod->conf->use_shadow)
|
||||||
{
|
{
|
||||||
if ((!cw->argb) && (!cw->shaped))
|
if (_e_mod_comp_win_do_shadow(cw))
|
||||||
{
|
{
|
||||||
int ok = 0;
|
int ok = 0;
|
||||||
char buf[PATH_MAX];
|
char buf[PATH_MAX];
|
||||||
|
|
|
@ -9,6 +9,7 @@ struct _E_Config_Dialog_Data
|
||||||
int use_shadow;
|
int use_shadow;
|
||||||
int engine;
|
int engine;
|
||||||
int texture_from_pixmap;
|
int texture_from_pixmap;
|
||||||
|
int lock_fps;
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Protos */
|
/* Protos */
|
||||||
|
@ -56,6 +57,7 @@ _create_data(E_Config_Dialog *cfd)
|
||||||
(cfdata->engine != E_EVAS_ENGINE_GL_X11))
|
(cfdata->engine != E_EVAS_ENGINE_GL_X11))
|
||||||
cfdata->engine = E_EVAS_ENGINE_SOFTWARE_X11;
|
cfdata->engine = E_EVAS_ENGINE_SOFTWARE_X11;
|
||||||
cfdata->texture_from_pixmap = _comp_mod->conf->texture_from_pixmap;
|
cfdata->texture_from_pixmap = _comp_mod->conf->texture_from_pixmap;
|
||||||
|
cfdata->lock_fps = _comp_mod->conf->lock_fps;
|
||||||
return cfdata;
|
return cfdata;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -76,9 +78,11 @@ _basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cf
|
||||||
o = e_widget_list_add(evas, 0, 0);
|
o = e_widget_list_add(evas, 0, 0);
|
||||||
ot = e_widget_table_add(evas, 1);
|
ot = e_widget_table_add(evas, 1);
|
||||||
|
|
||||||
of = e_widget_framelist_add(evas, _("Shadow"), 0);
|
of = e_widget_framelist_add(evas, _("General"), 0);
|
||||||
e_widget_framelist_content_align_set(of, 0.5, 0.0);
|
e_widget_framelist_content_align_set(of, 0.5, 0.0);
|
||||||
ob = e_widget_check_add(evas, _("Enabled"), &(cfdata->use_shadow));
|
ob = e_widget_check_add(evas, _("Shadow"), &(cfdata->use_shadow));
|
||||||
|
e_widget_framelist_object_append(of, ob);
|
||||||
|
ob = e_widget_check_add(evas, _("Limit FPS"), &(cfdata->lock_fps));
|
||||||
e_widget_framelist_object_append(of, ob);
|
e_widget_framelist_object_append(of, ob);
|
||||||
e_widget_table_object_append(ot, of, 0, 0, 1, 1, 1, 1, 1, 1);
|
e_widget_table_object_append(ot, of, 0, 0, 1, 1, 1, 1, 1, 1);
|
||||||
|
|
||||||
|
@ -100,7 +104,7 @@ _basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cf
|
||||||
|
|
||||||
e_widget_table_object_append(ot, of, 0, 1, 1, 1, 1, 1, 1, 1);
|
e_widget_table_object_append(ot, of, 0, 1, 1, 1, 1, 1, 1, 1);
|
||||||
|
|
||||||
of = e_widget_framelist_add(evas, _("GL Options"), 0);
|
of = e_widget_framelist_add(evas, _("OpenGL Options"), 0);
|
||||||
e_widget_framelist_content_align_set(of, 0.5, 0.0);
|
e_widget_framelist_content_align_set(of, 0.5, 0.0);
|
||||||
ob = e_widget_check_add(evas, _("Texture from Pixmap"), &(cfdata->texture_from_pixmap));
|
ob = e_widget_check_add(evas, _("Texture from Pixmap"), &(cfdata->texture_from_pixmap));
|
||||||
e_widget_framelist_object_append(of, ob);
|
e_widget_framelist_object_append(of, ob);
|
||||||
|
@ -114,9 +118,11 @@ _basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cf
|
||||||
static int
|
static int
|
||||||
_basic_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
|
_basic_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
|
||||||
{
|
{
|
||||||
if (_comp_mod->conf->use_shadow != cfdata->use_shadow)
|
if ((_comp_mod->conf->use_shadow != cfdata->use_shadow) ||
|
||||||
|
(cfdata->lock_fps != _comp_mod->conf->lock_fps))
|
||||||
{
|
{
|
||||||
_comp_mod->conf->use_shadow = cfdata->use_shadow;
|
_comp_mod->conf->use_shadow = cfdata->use_shadow;
|
||||||
|
_comp_mod->conf->lock_fps = cfdata->lock_fps;
|
||||||
e_mod_comp_shadow_set();
|
e_mod_comp_shadow_set();
|
||||||
}
|
}
|
||||||
if ((_comp_mod->conf->engine != cfdata->engine) ||
|
if ((_comp_mod->conf->engine != cfdata->engine) ||
|
||||||
|
|
|
@ -34,6 +34,7 @@ e_modapi_init(E_Module *m)
|
||||||
E_CONFIG_VAL(D, T, shadow_file, STR);
|
E_CONFIG_VAL(D, T, shadow_file, STR);
|
||||||
E_CONFIG_VAL(D, T, engine, INT);
|
E_CONFIG_VAL(D, T, engine, INT);
|
||||||
E_CONFIG_VAL(D, T, texture_from_pixmap, UCHAR);
|
E_CONFIG_VAL(D, T, texture_from_pixmap, UCHAR);
|
||||||
|
E_CONFIG_VAL(D, T, lock_fps, UCHAR);
|
||||||
|
|
||||||
mod->conf = e_config_domain_load("module.comp", mod->conf_edd);
|
mod->conf = e_config_domain_load("module.comp", mod->conf_edd);
|
||||||
if (!mod->conf)
|
if (!mod->conf)
|
||||||
|
@ -43,6 +44,7 @@ e_modapi_init(E_Module *m)
|
||||||
mod->conf->shadow_file = NULL;
|
mod->conf->shadow_file = NULL;
|
||||||
mod->conf->engine = E_EVAS_ENGINE_SOFTWARE_X11;
|
mod->conf->engine = E_EVAS_ENGINE_SOFTWARE_X11;
|
||||||
mod->conf->texture_from_pixmap = 0;
|
mod->conf->texture_from_pixmap = 0;
|
||||||
|
mod->conf->lock_fps = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
_comp_mod = mod;
|
_comp_mod = mod;
|
||||||
|
|
|
@ -11,6 +11,7 @@ struct _Config
|
||||||
const char *shadow_file;
|
const char *shadow_file;
|
||||||
int engine;
|
int engine;
|
||||||
unsigned char texture_from_pixmap;
|
unsigned char texture_from_pixmap;
|
||||||
|
unsigned char lock_fps;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _Mod
|
struct _Mod
|
||||||
|
|
Loading…
Reference in New Issue