reduce getenv calls by only getting once
we do egetvn's quite frequently and this is more costly than remembering once and getting it once... fix that in some cases.
This commit is contained in:
parent
78c26e5f8d
commit
ac6ceb0b99
|
@ -2049,9 +2049,14 @@ e_config_profile_save(void)
|
||||||
char buf[4096], buf2[4096];
|
char buf[4096], buf2[4096];
|
||||||
const char *s;
|
const char *s;
|
||||||
int ok = 0;
|
int ok = 0;
|
||||||
|
static signed char nosave = -1;
|
||||||
|
|
||||||
if ((s = getenv("E_CONF_PROFILE_NOSAVE")) && atoi(s))
|
if (nosave == -1)
|
||||||
return 1;
|
{
|
||||||
|
if ((s = getenv("E_CONF_PROFILE_NOSAVE")) && atoi(s)) nosave = 1;
|
||||||
|
else nosave = 0;
|
||||||
|
}
|
||||||
|
if (nosave == 1) return 1;
|
||||||
|
|
||||||
/* FIXME: check for other sessions fo E running */
|
/* FIXME: check for other sessions fo E running */
|
||||||
e_user_dir_concat_static(buf, "config/profile.cfg");
|
e_user_dir_concat_static(buf, "config/profile.cfg");
|
||||||
|
|
|
@ -796,11 +796,17 @@ e_pixmap_native_surface_init(E_Pixmap *cp, Evas_Native_Surface *ns)
|
||||||
if (!cp->buffer) return EINA_FALSE;
|
if (!cp->buffer) return EINA_FALSE;
|
||||||
if (cp->buffer->dmabuf_buffer)
|
if (cp->buffer->dmabuf_buffer)
|
||||||
{
|
{
|
||||||
|
static signed char use_hw_planes = -1;
|
||||||
ns->type = EVAS_NATIVE_SURFACE_WL_DMABUF;
|
ns->type = EVAS_NATIVE_SURFACE_WL_DMABUF;
|
||||||
|
|
||||||
ns->data.wl_dmabuf.attr = &cp->buffer->dmabuf_buffer->attributes;
|
ns->data.wl_dmabuf.attr = &cp->buffer->dmabuf_buffer->attributes;
|
||||||
ns->data.wl_dmabuf.resource = cp->buffer->resource;
|
ns->data.wl_dmabuf.resource = cp->buffer->resource;
|
||||||
if (getenv("E_USE_HARDWARE_PLANES"))
|
if (use_hw_planes == -1)
|
||||||
|
{
|
||||||
|
if (getenv("E_USE_HARDWARE_PLANES")) use_hw_planes = 1;
|
||||||
|
else use_hw_planes = 0;
|
||||||
|
}
|
||||||
|
if (use_hw_planes)
|
||||||
{
|
{
|
||||||
ns->data.wl_dmabuf.scanout.handler = _e_pixmap_scanout_handler;
|
ns->data.wl_dmabuf.scanout.handler = _e_pixmap_scanout_handler;
|
||||||
ns->data.wl_dmabuf.scanout.data = cp->buffer;
|
ns->data.wl_dmabuf.scanout.data = cp->buffer;
|
||||||
|
|
Loading…
Reference in New Issue