redo pixmap image border to take xywh instead of lrtb
authorMike Blumenkrantz <zmike@osg.samsung.com>
Tue, 10 Feb 2015 23:07:41 +0000 (18:07 -0500)
committerMike Blumenkrantz <zmike@osg.samsung.com>
Tue, 10 Feb 2015 23:07:41 +0000 (18:07 -0500)
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
src/bin/e_comp_wl.c
src/bin/e_pixmap.c
src/bin/e_pixmap.h

index 0fddddcb25f59517a9dc870c6f3fa5c1dada8e06..263729e51981cff0c46c0341c77bc0d85fe776fa 100644 (file)
@@ -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);
index 6b486d0e739681a43dc6a43eae1ede8f89a09691..ac1467b5a9d5c37abbc04bc7af11551f5d6b5c9c 100644 (file)
@@ -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 
index c2dbe6fad2609af2bc941d060ce12604e9a02366..ee2f53a22895da0ead0496ab3b574ced57ff0852 100644 (file)
@@ -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
 }
index ca18a0d3e3f67209fc4d3d5d0e13dbd6724d7b89..1bf387862efab5f965642b516ee926c5021636db 100644 (file)
@@ -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)