viewport: check old type only if destination type isn't changed accepted/tizen/4.0/unified/20180330.060833 submit/tizen_4.0/20180329.065259
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 06:51:28 +0000 (15:51 +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 3f2a1aa4346d587bdc611d9ec2108fda9103c183..2ab7840bbe1c59ec8c9e9a79f5aafc7234a4540b 100644 (file)
@@ -628,11 +628,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);
 
@@ -676,11 +680,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);