From a19957d3ebf7f7f4d6da3b2ebc27745b9539af06 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Thu, 5 Feb 2015 16:31:18 -0500 Subject: [PATCH] move wl pixmap stuff to use pixmap functions in compositor instead of in pixmap --- src/bin/e_comp_wl.c | 16 ++++++++++++---- src/bin/e_pixmap.c | 15 ++------------- 2 files changed, 14 insertions(+), 17 deletions(-) diff --git a/src/bin/e_comp_wl.c b/src/bin/e_comp_wl.c index 1b4c55776..8009403ab 100644 --- a/src/bin/e_comp_wl.c +++ b/src/bin/e_comp_wl.c @@ -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)) { diff --git a/src/bin/e_pixmap.c b/src/bin/e_pixmap.c index 16b2e97ec..3d747d9b0 100644 --- a/src/bin/e_pixmap.c +++ b/src/bin/e_pixmap.c @@ -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;