move wl pixmap stuff to use pixmap functions in compositor instead of in pixmap

This commit is contained in:
Mike Blumenkrantz 2015-02-05 16:31:18 -05:00
parent c87ca3e892
commit a19957d3eb
2 changed files with 14 additions and 17 deletions

View File

@ -1466,9 +1466,6 @@ _e_comp_wl_subsurface_commit_from_cache(E_Client *ec)
if (sdata->cached.buffer)
{
/* set pixmap resource */
e_pixmap_resource_set(ep, sdata->cached.buffer);
/* mark the pixmap as usable or not */
e_pixmap_usable_set(ep, (sdata->cached.buffer != NULL));
}
@ -1476,7 +1473,15 @@ _e_comp_wl_subsurface_commit_from_cache(E_Client *ec)
/* mark the pixmap as dirty */
e_pixmap_dirty(ep);
e_pixmap_refresh(ep);
e_pixmap_image_clear(ep, EINA_FALSE);
e_pixmap_resource_set(ep, sdata->cached.buffer);
/* refresh pixmap */
if (e_pixmap_refresh(ep))
{
e_comp->post_updates = eina_list_append(e_comp->post_updates, ec);
e_object_ref(E_OBJECT(ec));
}
/* check for any pending attachments */
if (sdata->cached.new_attach)
@ -2592,6 +2597,9 @@ e_comp_wl_surface_commit(E_Client *ec)
/* mark the pixmap as dirty */
e_pixmap_dirty(ep);
e_pixmap_image_clear(ep, EINA_FALSE);
e_pixmap_resource_set(ep, ec->comp_data->pending.buffer);
/* refresh pixmap */
if (e_pixmap_refresh(ep))
{

View File

@ -436,18 +436,16 @@ e_pixmap_refresh(E_Pixmap *cp)
#if defined(HAVE_WAYLAND_CLIENTS) || defined(HAVE_WAYLAND_ONLY)
{
E_Comp_Wl_Client_Data *cd = NULL;
struct wl_resource *res = NULL;
int pw = 0, ph = 0;
if (cp->client)
{
cd = (E_Comp_Wl_Client_Data *)cp->client->comp_data;
res = cd->pending.buffer;
/* pw = cp->client->client.w; */
/* ph = cp->client->client.h; */
}
success = (res != NULL);
success = !!cp->resource;
if (!success) break;
if ((cd) && (cd->pending.w) && (cd->pending.h))
@ -458,16 +456,7 @@ e_pixmap_refresh(E_Pixmap *cp)
success = ((pw > 0) && (ph > 0));
if (success)
{
/* if (cp->resource) _e_pixmap_resource_free(cp->resource); */
e_pixmap_image_clear(cp, EINA_FALSE);
cp->resource = res;
_e_pixmap_update_wl(cp);
}
else
{
if (res) _e_pixmap_resource_free(res);
}
_e_pixmap_update_wl(cp);
}
#endif
break;