summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2017-03-21 19:10:44 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2017-03-22 14:29:02 +0900
commit2787f0fe5dfe1e880a07bf957aa2a111866f25dc (patch)
treef685881029037d0d73c534d939b6c47412c8dc08
parent2c0b850f5727b0dce5fdc80cd6394adb242cd93f (diff)
evas: Fix a rare issue with GL and map and mask
The things you learn to love... The situation was: - An object is mapped (naviframe in an animation) - One of its children has a mask - The window is rotated by 90 or 270 degrees (landscape) The mask glsl code to invert the x,y coordinate depends on the screen rotation and this somehow was wrong. Tested on Tizen and in elm_test "Masking", made with @jiin.moon. @fix
-rw-r--r--src/bin/elementary/test_evas_mask.c18
-rw-r--r--src/modules/evas/engines/gl_common/evas_gl_context.c2
2 files changed, 19 insertions, 1 deletions
diff --git a/src/bin/elementary/test_evas_mask.c b/src/bin/elementary/test_evas_mask.c
index 575fe050ec..a3e5ac1c5f 100644
--- a/src/bin/elementary/test_evas_mask.c
+++ b/src/bin/elementary/test_evas_mask.c
@@ -95,6 +95,18 @@ _toggle_map(void *data, const Efl_Event *ev EINA_UNUSED)
95 } 95 }
96} 96}
97 97
98static void
99_rotate_win(void *data, const Efl_Event *ev EINA_UNUSED)
100{
101 //Efl_Orient orient;
102 Eo *win = data;
103
104 // FIXME: This is not implemented???
105 //orient = efl_orientation_get(win);
106 //efl_orientation_set(win, (orient + 90) % 360);
107 elm_win_rotation_set(win, (elm_win_rotation_get(win) + 90) % 360);
108}
109
98void 110void
99test_evas_mask(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) 111test_evas_mask(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
100{ 112{
@@ -170,6 +182,12 @@ test_evas_mask(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event
170 efl_pack(box2, efl_added), 182 efl_pack(box2, efl_added),
171 efl_gfx_visible_set(efl_added, 1)); 183 efl_gfx_visible_set(efl_added, 1));
172 184
185 efl_add(ELM_BUTTON_CLASS, win,
186 efl_text_set(efl_added, "Rotate Window"),
187 efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _rotate_win, win),
188 efl_pack(box2, efl_added),
189 efl_gfx_visible_set(efl_added, 1));
190
173 efl_gfx_size_set(win, 500, 600); 191 efl_gfx_size_set(win, 500, 600);
174 efl_gfx_visible_set(win, 1); 192 efl_gfx_visible_set(win, 1);
175} 193}
diff --git a/src/modules/evas/engines/gl_common/evas_gl_context.c b/src/modules/evas/engines/gl_common/evas_gl_context.c
index cc70c2bfdc..b0ddb5e0ba 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_context.c
+++ b/src/modules/evas/engines/gl_common/evas_gl_context.c
@@ -3202,7 +3202,7 @@ shader_array_flush(Evas_Engine_GL_Context *gc)
3202 glUseProgram(prog->prog); 3202 glUseProgram(prog->prog);
3203 if (prog->reset) 3203 if (prog->reset)
3204 { 3204 {
3205 glUniform1i(prog->uniform.rotation_id, gc->rot / 90); 3205 glUniform1i(prog->uniform.rotation_id, fbo ? 0 : gc->rot / 90);
3206 glUniformMatrix4fv(prog->uniform.mvp, 1, GL_FALSE, gc->shared->proj); 3206 glUniformMatrix4fv(prog->uniform.mvp, 1, GL_FALSE, gc->shared->proj);
3207 prog->reset = EINA_FALSE; 3207 prog->reset = EINA_FALSE;
3208 } 3208 }