discomfitor pushed a commit to branch master. http://git.enlightenment.org/core/enlightenment.git/commit/?id=d97c6b04bb56682383124fbbe0bfc5f3377923aa
commit d97c6b04bb56682383124fbbe0bfc5f3377923aa Author: Mike Blumenkrantz <[email protected]> Date: Tue Feb 10 18:07:41 2015 -0500 redo pixmap image border to take xywh instead of lrtb client size is not set by the time opacity is set so it's necessary to store the full rect --- src/bin/e_comp_object.c | 12 ++++++++---- src/bin/e_comp_wl.c | 5 ++--- src/bin/e_pixmap.c | 24 ++++++++++++------------ src/bin/e_pixmap.h | 4 ++-- 4 files changed, 24 insertions(+), 21 deletions(-) diff --git a/src/bin/e_comp_object.c b/src/bin/e_comp_object.c index 0fddddc..263729e 100644 --- a/src/bin/e_comp_object.c +++ b/src/bin/e_comp_object.c @@ -3201,7 +3201,7 @@ e_comp_object_dirty(Evas_Object *obj) Eina_Rectangle *rect; Eina_List *ll; Evas_Object *o; - int w, h, t, b, l, r; + int w, h, bx, by, bxx, byy; Eina_Bool dirty, visible; API_ENTRY; @@ -3214,14 +3214,18 @@ e_comp_object_dirty(Evas_Object *obj) evas_object_image_data_set(cw->obj, NULL); evas_object_image_size_set(cw->obj, w, h); - e_pixmap_image_border_get(cw->ec->pixmap, &l, &r, &t, &b); - evas_object_image_border_set(cw->obj, l, r, t, b); + e_pixmap_image_opaque_get(cw->ec->pixmap, &bx, &by, &bxx, &byy); + if (bxx && byy) + bxx = cw->ec->client.w - (bx + bxx), byy = cw->ec->client.h - (by + byy); + else + bx = by = bxx = byy = 0; + evas_object_image_border_set(cw->obj, bx, by, bxx, byy); RENDER_DEBUG("SIZE [%p]: %dx%d", cw->ec, w, h); if (cw->pending_updates) eina_tiler_area_size_set(cw->pending_updates, w, h); EINA_LIST_FOREACH(cw->obj_mirror, ll, o) { - evas_object_image_border_set(o, l, r, t, b); + evas_object_image_border_set(o, bx, by, bxx, byy); evas_object_image_pixels_dirty_set(o, dirty); if (!dirty) evas_object_image_data_set(o, NULL); diff --git a/src/bin/e_comp_wl.c b/src/bin/e_comp_wl.c index 6b486d0..ac1467b 100644 --- a/src/bin/e_comp_wl.c +++ b/src/bin/e_comp_wl.c @@ -1043,15 +1043,14 @@ _e_comp_wl_surface_cb_opaque_region_set(struct wl_client *client EINA_UNUSED, st it = eina_tiler_iterator_new(tmp); EINA_ITERATOR_FOREACH(it, rect) { - e_pixmap_image_border_set(ec->pixmap, rect->x, ec->client.w - rect->x, - rect->y, ec->client.h - rect->y); + e_pixmap_image_opaque_set(ec->pixmap, rect->x, rect->y, rect->w, rect->h); break; } eina_iterator_free(it); } else - e_pixmap_image_border_set(ec->pixmap, 0, 0, 0, 0); + e_pixmap_image_opaque_set(ec->pixmap, 0, 0, 0, 0); } static void diff --git a/src/bin/e_pixmap.c b/src/bin/e_pixmap.c index c2dbe6f..ee2f53a 100644 --- a/src/bin/e_pixmap.c +++ b/src/bin/e_pixmap.c @@ -34,7 +34,7 @@ struct _E_Pixmap #if defined(HAVE_WAYLAND_CLIENTS) || defined(HAVE_WAYLAND_ONLY) struct wl_resource *resource; Eina_List *resource_cache; - Eina_Rectangle border; + Eina_Rectangle opaque; #endif Eina_Bool usable : 1; @@ -889,11 +889,11 @@ e_pixmap_image_draw(E_Pixmap *cp, const Eina_Rectangle *r) } EAPI void -e_pixmap_image_border_set(E_Pixmap *cp, int l, int r, int t, int b) +e_pixmap_image_opaque_set(E_Pixmap *cp, int x, int y, int w, int h) { EINA_SAFETY_ON_NULL_RETURN(cp); #if defined(HAVE_WAYLAND_CLIENTS) || defined(HAVE_WAYLAND_ONLY) - EINA_RECTANGLE_SET(&cp->border, t, b, l, r); + EINA_RECTANGLE_SET(&cp->opaque, x, y, w, h); #else (void)l; (void)r; @@ -903,18 +903,18 @@ e_pixmap_image_border_set(E_Pixmap *cp, int l, int r, int t, int b) } EAPI void -e_pixmap_image_border_get(E_Pixmap *cp, int *l, int *r, int *t, int *b) +e_pixmap_image_opaque_get(E_Pixmap *cp, int *x, int *y, int *w, int *h) { EINA_SAFETY_ON_NULL_RETURN(cp); #if defined(HAVE_WAYLAND_CLIENTS) || defined(HAVE_WAYLAND_ONLY) - if (t) *t = cp->border.x; - if (b) *b = cp->border.y; - if (l) *l = cp->border.w; - if (r) *r = cp->border.h; + if (x) *x = cp->opaque.x; + if (y) *y = cp->opaque.y; + if (w) *w = cp->opaque.w; + if (h) *h = cp->opaque.h; #else - if (t) *t = 0; - if (b) *b = 0; - if (l) *l = 0; - if (r) *r = 0; + if (x) *x = 0; + if (y) *y = 0; + if (w) *w = 0; + if (h) *h = 0; #endif } diff --git a/src/bin/e_pixmap.h b/src/bin/e_pixmap.h index ca18a0d..1bf3878 100644 --- a/src/bin/e_pixmap.h +++ b/src/bin/e_pixmap.h @@ -45,8 +45,8 @@ EAPI void *e_pixmap_image_data_get(E_Pixmap *cp); EAPI Eina_Bool e_pixmap_image_data_argb_convert(E_Pixmap *cp, void *pix, void *ipix, Eina_Rectangle *r, int stride); EAPI Eina_Bool e_pixmap_image_draw(E_Pixmap *cp, const Eina_Rectangle *r); -EAPI void e_pixmap_image_border_set(E_Pixmap *cp, int l, int r, int t, int b); -EAPI void e_pixmap_image_border_get(E_Pixmap *cp, int *l, int *r, int *t, int *b); +EAPI void e_pixmap_image_opaque_set(E_Pixmap *cp, int x, int y, int w, int h); +EAPI void e_pixmap_image_opaque_get(E_Pixmap *cp, int *x, int *y, int *w, int *h); static inline Eina_Bool e_pixmap_is_x(const E_Pixmap *cp) --
