e_pixmap: use & return the buffer-transformed size 24/127324/2
authorBoram Park <boram1288.park@samsung.com>
Sun, 23 Apr 2017 03:55:21 +0000 (12:55 +0900)
committerBoram Park <boram1288.park@samsung.com>
Thu, 27 Apr 2017 06:40:37 +0000 (15:40 +0900)
Change-Id: Ied72200bff6a611b2474007d011b1331af956139

src/bin/e_pixmap.c

index 1c312c0..a6d1a14 100644 (file)
@@ -497,20 +497,26 @@ e_pixmap_refresh(E_Pixmap *cp)
 E_API Eina_Bool
 e_pixmap_size_changed(E_Pixmap *cp, int w, int h)
 {
+   E_Client *ec;
    EINA_SAFETY_ON_NULL_RETURN_VAL(cp, EINA_FALSE);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(cp->client, EINA_FALSE);
    if (cp->dirty) return EINA_TRUE;
-   return (w != cp->w) || (h != cp->h);
+   ec = cp->client;
+   return (w != ec->comp_data->width_from_buffer) || (h != ec->comp_data->height_from_buffer);
 }
 
 E_API Eina_Bool
 e_pixmap_size_get(E_Pixmap *cp, int *w, int *h)
 {
+   E_Client *ec;
    if (w) *w = 0;
    if (h) *h = 0;
    EINA_SAFETY_ON_NULL_RETURN_VAL(cp, EINA_FALSE);
-   if (w) *w = cp->w;
-   if (h) *h = cp->h;
-   return (cp->w > 0) && (cp->h > 0);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(cp->client, EINA_FALSE);
+   ec = cp->client;
+   if (w) *w = ec->comp_data->width_from_buffer;
+   if (h) *h = ec->comp_data->height_from_buffer;
+   return (ec->comp_data->width_from_buffer > 0) && (ec->comp_data->height_from_buffer > 0);
 }
 
 E_API unsigned int