e_plane_renderer: allocate reserved tsurface according to output rotation 93/185993/6
authorChangyeon Lee <cyeon.lee@samsung.com>
Mon, 6 Aug 2018 08:24:21 +0000 (17:24 +0900)
committerchangyeon lee <cyeon.lee@samsung.com>
Wed, 29 Aug 2018 05:56:37 +0000 (05:56 +0000)
Change-Id: Ib29ad13b000219d037dd8d8d9b88e3f37a1c0819

src/bin/e_plane_renderer.c

index 8166ea4aeb956c80e91bdf01ba7fcda722f97054..9b662b6a3df10d07067948f78927699b80d57d6b 100644 (file)
@@ -1287,6 +1287,8 @@ e_plane_renderer_ec_set(E_Plane_Renderer *renderer, E_Client *ec)
    E_Plane *plane = NULL;
    tbm_surface_queue_h tqueue = NULL;
    E_Plane_Renderer_Client *renderer_client = NULL;
+   int w, h;
+   int output_rotation;
 
    plane = renderer->plane;
    EINA_SAFETY_ON_NULL_RETURN_VAL(plane, EINA_FALSE);
@@ -1304,9 +1306,21 @@ e_plane_renderer_ec_set(E_Plane_Renderer *renderer, E_Client *ec)
      {
         if (!renderer->ee)
           {
+             output_rotation = plane->output->config.rotation;
+             if (output_rotation % 180)
+               {
+                  w = ec->h;
+                  h = ec->w;
+               }
+             else
+               {
+                  w = ec->w;
+                  h = ec->h;
+               }
+
              if (!renderer->tqueue)
                {
-                  tqueue = e_plane_renderer_surface_queue_create(renderer, ec->w, ec->h, plane->buffer_flags);
+                  tqueue = e_plane_renderer_surface_queue_create(renderer, w, h, plane->buffer_flags);
                   EINA_SAFETY_ON_NULL_RETURN_VAL(tqueue, EINA_FALSE);
 
                   if (!e_plane_renderer_surface_queue_set(renderer, tqueue))
@@ -1318,13 +1332,13 @@ e_plane_renderer_ec_set(E_Plane_Renderer *renderer, E_Client *ec)
                }
              else
                {
-                  if (renderer->tqueue_width != ec->w || renderer->tqueue_height != ec->h)
+                  if (renderer->tqueue_width != w || renderer->tqueue_height != h)
                     {
                        /* recreate tqueue */
                        e_plane_renderer_clean(plane);
                        e_plane_renderer_surface_queue_destroy(renderer);
 
-                       tqueue = e_plane_renderer_surface_queue_create(renderer, ec->w, ec->h, plane->buffer_flags);
+                       tqueue = e_plane_renderer_surface_queue_create(renderer, w, h, plane->buffer_flags);
                        EINA_SAFETY_ON_NULL_RETURN_VAL(tqueue, EINA_FALSE);
 
                        if (!e_plane_renderer_surface_queue_set(renderer, tqueue))