summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Michael <cp.michael@samsung.com>2017-02-28 08:51:21 -0500
committerChris Michael <cp.michael@samsung.com>2017-02-28 08:51:21 -0500
commitf8f71d05cdc7a8578329f75b0101662220390f20 (patch)
tree2a51c9c76c6e0c9c92abbf498d1ecfe16c8bf079
parent0e93f03636ec10710547513fb865ef2703e937a4 (diff)
ecore-wl2: Avoid resetting opaque & input regions if they match
Small patch to avoid setting the same opaque/input regions if they already match what is being requested. ref T5226 @fix Signed-off-by: Chris Michael <cp.michael@samsung.com>
-rw-r--r--src/lib/ecore_wl2/ecore_wl2_window.c74
1 files changed, 42 insertions, 32 deletions
diff --git a/src/lib/ecore_wl2/ecore_wl2_window.c b/src/lib/ecore_wl2/ecore_wl2_window.c
index 385a685037..c078ba440e 100644
--- a/src/lib/ecore_wl2/ecore_wl2_window.c
+++ b/src/lib/ecore_wl2/ecore_wl2_window.c
@@ -877,6 +877,7 @@ EAPI void
877ecore_wl2_window_opaque_region_set(Ecore_Wl2_Window *window, int x, int y, int w, int h) 877ecore_wl2_window_opaque_region_set(Ecore_Wl2_Window *window, int x, int y, int w, int h)
878{ 878{
879 struct wl_region *region; 879 struct wl_region *region;
880 int nx = 0, ny = 0, nw = 0, nh = 0;
880 881
881 EINA_SAFETY_ON_NULL_RETURN(window); 882 EINA_SAFETY_ON_NULL_RETURN(window);
882 883
@@ -890,33 +891,37 @@ ecore_wl2_window_opaque_region_set(Ecore_Wl2_Window *window, int x, int y, int w
890 switch (window->rotation) 891 switch (window->rotation)
891 { 892 {
892 case 0: 893 case 0:
893 window->opaque.x = x; 894 nx = x;
894 window->opaque.y = y; 895 ny = y;
895 window->opaque.w = w; 896 nw = w;
896 window->opaque.h = h; 897 nh = h;
897 break; 898 break;
898 case 90: 899 case 90:
899 window->opaque.x = y; 900 nx = y;
900 window->opaque.y = x; 901 ny = x;
901 window->opaque.w = h; 902 nw = h;
902 window->opaque.h = w; 903 nh = w;
903 break; 904 break;
904 case 180: 905 case 180:
905 window->opaque.x = x; 906 nx = x;
906 window->opaque.y = x + y; 907 ny = x + y;
907 window->opaque.w = w; 908 nw = w;
908 window->opaque.h = h; 909 nh = h;
909 break; 910 break;
910 case 270: 911 case 270:
911 window->opaque.x = x + y; 912 nx = x + y;
912 window->opaque.y = x; 913 ny = x;
913 window->opaque.w = h; 914 nw = h;
914 window->opaque.h = w; 915 nh = w;
915 break; 916 break;
916 default: 917 default:
917 break; 918 break;
918 } 919 }
919 920
921 if ((window->opaque.x == nx) && (window->opaque.y == ny) &&
922 (window->opaque.w == nw) && (window->opaque.h == nh))
923 return;
924
920 window->opaque_set = EINA_TRUE; 925 window->opaque_set = EINA_TRUE;
921 926
922 if (!window->surface) return; 927 if (!window->surface) return;
@@ -938,6 +943,7 @@ EAPI void
938ecore_wl2_window_input_region_set(Ecore_Wl2_Window *window, int x, int y, int w, int h) 943ecore_wl2_window_input_region_set(Ecore_Wl2_Window *window, int x, int y, int w, int h)
939{ 944{
940 struct wl_region *region; 945 struct wl_region *region;
946 int nx = 0, ny = 0, nw = 0, nh = 0;
941 947
942 EINA_SAFETY_ON_NULL_RETURN(window); 948 EINA_SAFETY_ON_NULL_RETURN(window);
943 949
@@ -951,33 +957,37 @@ ecore_wl2_window_input_region_set(Ecore_Wl2_Window *window, int x, int y, int w,
951 switch (window->rotation) 957 switch (window->rotation)
952 { 958 {
953 case 0: 959 case 0:
954 window->input_rect.x = x; 960 nx = x;
955 window->input_rect.y = y; 961 ny = y;
956 window->input_rect.w = w; 962 nw = w;
957 window->input_rect.h = h; 963 nh = h;
958 break; 964 break;
959 case 90: 965 case 90:
960 window->input_rect.x = y; 966 nx = y;
961 window->input_rect.y = x; 967 ny = x;
962 window->input_rect.w = h; 968 nw = h;
963 window->input_rect.h = w; 969 nh = w;
964 break; 970 break;
965 case 180: 971 case 180:
966 window->input_rect.x = x; 972 nx = x;
967 window->input_rect.y = x + y; 973 ny = x + y;
968 window->input_rect.w = w; 974 nw = w;
969 window->input_rect.h = h; 975 nh = h;
970 break; 976 break;
971 case 270: 977 case 270:
972 window->input_rect.x = x + y; 978 nx = x + y;
973 window->input_rect.y = x; 979 ny = x;
974 window->input_rect.w = h; 980 nw = h;
975 window->input_rect.h = w; 981 nh = w;
976 break; 982 break;
977 default: 983 default:
978 break; 984 break;
979 } 985 }
980 986
987 if ((window->input_rect.x == nx) && (window->input_rect.y == ny) &&
988 (window->input_rect.w == nw) && (window->input_rect.h == nh))
989 return;
990
981 window->input_set = EINA_TRUE; 991 window->input_set = EINA_TRUE;
982 992
983 if (!window->surface) return; 993 if (!window->surface) return;