e_output: Sort list of planes by zpos 79/84179/2 accepted/tizen/common/20160817.133000 accepted/tizen/ivi/20160817.231103 accepted/tizen/mobile/20160817.231038 accepted/tizen/tv/20160817.231052 accepted/tizen/wearable/20160817.230932 submit/tizen/20160817.040540
authorChangyeon Lee <cyeon.lee@samsung.com>
Wed, 17 Aug 2016 05:59:49 +0000 (14:59 +0900)
committerGwanglim Lee <gl77.lee@samsung.com>
Wed, 17 Aug 2016 07:08:26 +0000 (00:08 -0700)
Change-Id: Id75dfbbe5a83239a196bbed4f775335c7b4f8b9b

src/bin/e_output.c

index 11ebc74..8639706 100644 (file)
@@ -193,6 +193,18 @@ _output_type_to_str(tdm_output_type output_type)
    else return "Unknown";
 }
 
+static int
+_e_output_planes_sort_cb(const void *d1, const void *d2)
+{
+   E_Plane *plane1 = (E_Plane *)d1;
+   E_Plane *plane2 = (E_Plane *)d2;
+
+   if(!plane1) return(1);
+   if(!plane2) return(-1);
+
+   return(plane1->zpos > plane2->zpos);
+}
+
 EINTERN E_Output *
 e_output_new(E_Comp_Screen *e_comp_screen, int index)
 {
@@ -260,8 +272,9 @@ e_output_new(E_Comp_Screen *e_comp_screen, int index)
         output->planes = eina_list_append(output->planes, plane);
      }
 
-   output->e_comp_screen = e_comp_screen;
+   output->planes = eina_list_sort(output->planes, eina_list_count(output->planes), _e_output_planes_sort_cb);
 
+   output->e_comp_screen = e_comp_screen;
 
    return output;