e_comp_wl_capture: correct image size according to orientation of image. 78/247978/2 submit/tizen/20201119.103351
authorSeunghun Lee <shiin.lee@samsung.com>
Wed, 18 Nov 2020 06:28:05 +0000 (15:28 +0900)
committerSooChan Lim <sc1.lim@samsung.com>
Thu, 19 Nov 2020 10:18:32 +0000 (10:18 +0000)
When try to capture the image of buffer to which the output transform
has been applied, should consider to swapping size.

Change-Id: Ib0d8946e5f66c65743facda60de73301ee78862b

src/bin/e_comp_wl_capture.c

index 8ddfc5f134d880b901f72c3bc4adf99cdded1ec4..2d5c67e063d6cb2c1f04b49d586ba653ac772914 100644 (file)
@@ -521,8 +521,20 @@ _e_capture_client_capture_with_video(Thread_Data *td)
    Eina_Bool ret = EINA_TRUE;
 
    main_surface = td->tbm_surface;
-   w = tbm_surface_get_width(main_surface);
-   h = tbm_surface_get_height(main_surface);
+   if ((td->transform == WL_OUTPUT_TRANSFORM_90) ||
+       (td->transform == WL_OUTPUT_TRANSFORM_270) ||
+       (td->transform == WL_OUTPUT_TRANSFORM_FLIPPED_90) ||
+       (td->transform == WL_OUTPUT_TRANSFORM_FLIPPED_270))
+     {
+        w = tbm_surface_get_height(main_surface);
+        h = tbm_surface_get_width(main_surface);
+     }
+   else
+     {
+        w = tbm_surface_get_width(main_surface);
+        h = tbm_surface_get_height(main_surface);
+     }
+
    if ((w <= 0) || (h <= 0))
      {
         ERR("Abnormal buffer size of main surface %dx%d", w, h);