e_mod_effect: Get e_plane and check it's being used for displaying video now. 11/184911/1
authorSeunghun Lee <shiin.lee@samsung.com>
Tue, 24 Jul 2018 04:51:14 +0000 (13:51 +0900)
committerSeunghun Lee <shiin.lee@samsung.com>
Tue, 24 Jul 2018 07:23:09 +0000 (16:23 +0900)
From tdm_layer we can't find out it's used for displaying video.
Thus, there is possibility that tdm_layer is still used for displaying UI even
if there is video client which needs to be animated. To animate video image
properly, we have to ask E_Plane if it's used for video.

Change-Id: Ie3f0be111c47c306ead0f8b7b5cbcb22b45be075

src/e_mod_effect.c

index 566376d..1cb180a 100644 (file)
@@ -46,7 +46,6 @@ _eff_object_underlayer_get(E_Client *ec)
    Evas_Object *underlay = NULL;
    E_Comp_Screen *e_comp_screen;
    Eina_List *l;
-   tdm_layer *layer;
    Under_Layer *ulayer;
 
    e_comp_screen = e_comp->e_comp_screen;
@@ -57,41 +56,36 @@ _eff_object_underlayer_get(E_Client *ec)
      {
         if ((!_eff->under_layers) && (!_eff->under_checked))
           {
-             int i, count;
-             int primary_index, primary_zpos;
-             tdm_layer *primary_layer;
-             tdm_output *output;
              tdm_layer_capability capabilities;
+             E_Output *eoutput;
+             E_Plane *plane;
+             const Eina_List *planes, *l;
 
-             output = tdm_display_get_output(e_comp_screen->tdisplay, 0, NULL);
-             if (!output) return NULL;
+             if (!ec->zone) return NULL;
 
-             tdm_output_get_primary_index(output, &primary_index);
-             primary_layer = tdm_output_get_layer(output, primary_index, NULL);
-             if (!primary_layer) return NULL;
+             eoutput = e_output_find(ec->zone->output_id);
+             if (eoutput) return NULL;
 
-             tdm_layer_get_zpos(primary_layer, &primary_zpos);
-             tdm_output_get_layer_count(output, &count);
+             planes = e_output_planes_get(eoutput);
+             if (!planes) return NULL;
 
-             for (i = 0; i < count; i++)
+             /* Find a plane which is placed under primary and used for video.
+              * planes is supposed to be sorted by zpos (lower -> higher) */
+             EINA_LIST_FOREACH(planes, l, plane)
                {
-                  int zpos;
+                  if (e_plane_is_primary(plane))
+                    break;
 
-                  if (i == primary_index) continue;
+                  if (!plane->is_video)
+                    continue;
 
-                  layer = tdm_output_get_layer(output, i, NULL);
-                  if (!layer) continue;
-
-                  tdm_layer_get_capabilities(layer, &capabilities);
+                  tdm_layer_get_capabilities(plane->tlayer, &capabilities);
                   if (!(capabilities & TDM_LAYER_CAPABILITY_GRAPHIC)) continue;
 
-                  tdm_layer_get_zpos(layer, &zpos);
-                  if (zpos >= primary_zpos) continue;
-
                   ulayer = E_NEW(Under_Layer, 1);
                   if (!ulayer) continue;
-                  ulayer->zpos = zpos;
-                  ulayer->tlayer = layer;
+                  ulayer->zpos = plane->zpos;
+                  ulayer->tlayer = plane->tlayer;
 
                   _eff->under_layers = eina_list_append(_eff->under_layers,
                                                         ulayer);