ecore-wl2: Don't set opaque or input regions if already set
authorChris Michael <cp.michael@samsung.com>
Wed, 25 Jan 2017 17:02:35 +0000 (12:02 -0500)
committerChris Michael <cp.michael@samsung.com>
Wed, 25 Jan 2017 17:02:35 +0000 (12:02 -0500)
If the window opaque/input regions already match what is being
requested (to be set), then no need for the compositor to create
regions and set them.

@optimize
@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
src/lib/ecore_wl2/ecore_wl2_window.c

index 8acb7d5..6d50ca3 100644 (file)
@@ -870,6 +870,10 @@ ecore_wl2_window_opaque_region_set(Ecore_Wl2_Window *window, int x, int y, int w
 
    EINA_SAFETY_ON_NULL_RETURN(window);
 
+   if ((window->opaque.x == x) && (window->opaque.y == y) &&
+       (window->opaque.w == w) && (window->opaque.h == h))
+     return;
+
    window->opaque.x = x;
    window->opaque.y = y;
    window->opaque.w = w;
@@ -913,6 +917,10 @@ ecore_wl2_window_input_region_set(Ecore_Wl2_Window *window, int x, int y, int w,
 
    EINA_SAFETY_ON_NULL_RETURN(window);
 
+   if ((window->input_rect.x == x) && (window->input_rect.y == y) &&
+       (window->input_rect.w == w) && (window->input_rect.h == h))
+     return;
+
    window->input_rect.x = x;
    window->input_rect.y = y;
    window->input_rect.w = w;