simplify comp mirror creation, update related fixme

This commit is contained in:
Mike Blumenkrantz 2013-04-19 09:59:39 +01:00
parent 711f91f1f6
commit 5654d4ea4b
1 changed files with 16 additions and 27 deletions

View File

@ -1907,6 +1907,7 @@ static Evas_Object *
_e_comp_win_mirror_add(E_Comp_Win *cw) _e_comp_win_mirror_add(E_Comp_Win *cw)
{ {
Evas_Object *o; Evas_Object *o;
int w, h;
if (!cw->c) return NULL; if (!cw->c) return NULL;
@ -1919,9 +1920,8 @@ _e_comp_win_mirror_add(E_Comp_Win *cw)
if ((cw->pixmap) && (cw->pw > 0) && (cw->ph > 0)) if ((cw->pixmap) && (cw->pw > 0) && (cw->ph > 0))
{ {
unsigned int *pix; unsigned int *pix = NULL;
Eina_Bool alpha; Eina_Bool alpha, argb = EINA_FALSE;
int w, h;
alpha = evas_object_image_alpha_get(cw->obj); alpha = evas_object_image_alpha_get(cw->obj);
evas_object_image_size_get(cw->obj, &w, &h); evas_object_image_size_get(cw->obj, &w, &h);
@ -1929,13 +1929,7 @@ _e_comp_win_mirror_add(E_Comp_Win *cw)
evas_object_image_alpha_set(o, alpha); evas_object_image_alpha_set(o, alpha);
if (cw->shaped) if (cw->shaped)
{ pix = evas_object_image_data_get(cw->obj, 0);
pix = evas_object_image_data_get(cw->obj, 0);
evas_object_image_data_set(o, pix);
evas_object_image_size_set(o, w, h);
evas_object_image_data_set(o, pix);
evas_object_image_data_update_add(o, 0, 0, w, h);
}
else else
{ {
if (cw->native) if (cw->native)
@ -1946,37 +1940,32 @@ _e_comp_win_mirror_add(E_Comp_Win *cw)
ns.type = EVAS_NATIVE_SURFACE_X11; ns.type = EVAS_NATIVE_SURFACE_X11;
ns.data.x11.visual = cw->vis; ns.data.x11.visual = cw->vis;
ns.data.x11.pixmap = cw->pixmap; ns.data.x11.pixmap = cw->pixmap;
evas_object_image_size_set(o, w, h);
evas_object_image_native_surface_set(o, &ns); evas_object_image_native_surface_set(o, &ns);
evas_object_image_data_update_add(o, 0, 0, w, h);
} }
else if (cw->xim) else if (cw->xim)
{ {
if (ecore_x_image_is_argb32_get(cw->xim)) argb = ecore_x_image_is_argb32_get(cw->xim);
{ if (argb)
pix = ecore_x_image_data_get(cw->xim, NULL, NULL, NULL); pix = ecore_x_image_data_get(cw->xim, NULL, NULL, NULL);
evas_object_image_data_set(o, pix);
evas_object_image_size_set(o, w, h);
}
else else
{ pix = evas_object_image_data_get(cw->obj, EINA_FALSE);
pix = evas_object_image_data_get(cw->obj, EINA_TRUE);
evas_object_image_data_set(o, pix);
evas_object_image_size_set(o, w, h);
evas_object_image_data_set(cw->obj, pix);
}
evas_object_image_data_update_add(o, 0, 0, w, h);
} }
} }
if (pix && (!argb))
{
evas_object_image_data_set(o, pix);
evas_object_image_data_set(cw->obj, pix);
}
evas_object_image_size_set(o, w, h); evas_object_image_size_set(o, w, h);
evas_object_image_data_update_add(o, 0, 0, w, h);
} }
else if (cw->real_obj) else if (cw->real_obj)
{ {
/* FIXME!!! */ /* FIXME: the first mirror shown with vsync enabled won't render immediately */
evas_object_image_alpha_set(o, 1); evas_object_image_alpha_set(o, 1);
evas_object_geometry_get(cw->zoomobj, NULL, NULL, &w, &h);
evas_object_image_source_set(o, cw->zoomobj); evas_object_image_source_set(o, cw->zoomobj);
} }
evas_object_image_data_update_add(o, 0, 0, w, h);
return o; return o;
} }