viewport: check old type only if destination type isn't changed 89/174189/1
authorBoram Park <boram1288.park@samsung.com>
Thu, 29 Mar 2018 04:12:19 +0000 (13:12 +0900)
committerBoram Park <boram1288.park@samsung.com>
Thu, 29 Mar 2018 04:21:02 +0000 (13:21 +0900)
when destination type becomes rect -> mode(letterbox) -> rect, second
rect setting was ignored because rect information is same with
first setting. So we have to check rect information only if destination type
isn't changed.

Change-Id: I3a70540bdf54469b5bf2c7b9ee8eb0d923682d62

src/bin/e_comp_wl_viewport.c

index c3e55f0a58b45972cf8117dc8df9dc9708c87f12..734cb7c937a96c23856b41935144d78200c34537 100644 (file)
@@ -630,11 +630,15 @@ _e_comp_wl_viewport_cb_set_destination(struct wl_client *client EINA_UNUSED,
 
    _e_comp_wl_viewport_parent_check(viewport);
 
-   viewport->type = DESTINATION_TYPE_RECT;
-
-   if (viewport->destination.rect.x == x && viewport->destination.rect.y == y &&
+   if (viewport->type == DESTINATION_TYPE_RECT &&
+       viewport->destination.rect.x == x && viewport->destination.rect.y == y &&
        viewport->destination.rect.w == width && viewport->destination.rect.h == height)
-     return;
+     {
+        PWR("skipped: set twice");
+        return;
+     }
+
+   viewport->type = DESTINATION_TYPE_RECT;
 
    PIN("destination.rect(%d,%d %dx%d)", x, y, width, height);
 
@@ -678,11 +682,15 @@ _e_comp_wl_viewport_cb_set_destination_ratio(struct wl_client *client EINA_UNUSE
         return;
      }
 
-   viewport->type = DESTINATION_TYPE_RATIO;
-
-   if (viewport->destination.ratio.x == ratio_x && viewport->destination.ratio.y == ratio_y &&
+   if (viewport->type == DESTINATION_TYPE_RATIO &&
+       viewport->destination.ratio.x == ratio_x && viewport->destination.ratio.y == ratio_y &&
        viewport->destination.ratio.w == ratio_w && viewport->destination.ratio.h == ratio_h)
-     return;
+     {
+        PWR("skipped: set twice");
+        return;
+     }
+
+   viewport->type = DESTINATION_TYPE_RATIO;
 
    PIN("destination.ratio(%.2f,%.2f %.2fx%.2f)", ratio_x, ratio_y, ratio_w, ratio_h);