Apply alpha value through opaque_region requests 65/38765/2 accepted/tizen/common/20150429.093812 accepted/tizen/mobile/20150429.124703 accepted/tizen/tv/20150429.123929 accepted/tizen/wearable/20150429.124158 submit/tizen/20150428.160542
authorMinJeong Kim <minjjj.kim@samsung.com>
Tue, 28 Apr 2015 07:49:39 +0000 (16:49 +0900)
committerGwanglim Lee <gl77.lee@samsung.com>
Tue, 28 Apr 2015 10:36:18 +0000 (03:36 -0700)
1. Change alpha value(argb) inside opaque region set callback.
2. Added alpha set api for setting alpha value of image object

Change-Id: I352988d267b7cd26e7aa2df2602054d52f685f8d

src/bin/e_comp_object.c
src/bin/e_comp_object.h
src/bin/e_comp_wl.c

index 191b8a7bab68c47c62299fdb09956c0722c4e15b..a3f0687073651a35d94c1a1a70fa8d7994c845df 100644 (file)
@@ -3904,3 +3904,13 @@ e_comp_object_is_animating(Evas_Object *obj)
 
    return cw->animating;
 }
+
+EAPI void
+e_comp_object_alpha_set(Evas_Object *obj, Eina_Bool alpha)
+{
+   SOFT_ENTRY(0);
+
+   if (alpha == evas_object_image_alpha_get(cw->obj)) return;
+
+   evas_object_image_alpha_set(cw->obj, alpha);
+}
index 1b37f2d101e468dcd8bc1d951691e14ced4ea0e8..bbcd3b22809e7cefaa1701fb682c53707bd5c7d5 100644 (file)
@@ -108,6 +108,7 @@ EAPI E_Comp_Object_Intercept_Hook *e_comp_object_intercept_hook_add(E_Comp_Objec
 EAPI void e_comp_object_intercept_hook_del(E_Comp_Object_Intercept_Hook *ch);
 #endif
 EAPI unsigned int e_comp_object_is_animating(Evas_Object *obj);
+EAPI void e_comp_object_alpha_set(Evas_Object *obj, Eina_Bool alpha);
 
 #endif
 #endif
index 2580347bb33c1990e98d934e222891c8938ed5c2..489a0a3b773f9a78da5203531fbdad6761dd299c 100644 (file)
@@ -1497,6 +1497,15 @@ _e_comp_wl_surface_cb_opaque_region_set(struct wl_client *client EINA_UNUSED, st
           return;
 
         eina_tiler_union(ec->comp_data->pending.opaque, tmp);
+
+        if (!eina_tiler_empty(ec->comp_data->pending.opaque))
+          {
+             if (ec->argb)
+               {
+                  ec->argb = EINA_FALSE;
+                  e_comp_object_alpha_set(ec->frame, EINA_FALSE);
+               }
+          }
      }
    else
      {
@@ -1505,6 +1514,11 @@ _e_comp_wl_surface_cb_opaque_region_set(struct wl_client *client EINA_UNUSED, st
              eina_tiler_clear(ec->comp_data->pending.opaque);
              /* eina_tiler_free(ec->comp_data->pending.opaque); */
           }
+        if (!ec->argb)
+          {
+             ec->argb = EINA_TRUE;
+             e_comp_object_alpha_set(ec->frame, EINA_TRUE);
+          }
      }
 }