From b4758714cdfc1d28717019dee522f54d03cddfee Mon Sep 17 00:00:00 2001 From: "Wonsik, Jung" Date: Thu, 27 Jul 2017 11:00:37 +0900 Subject: [PATCH] [EvasGL] Add to unset PreRotation If evasgl and the other objects work together, then remove evasgl object, the other object should work without prerotation. Becase they have their own rotation code. Change-Id: I04a861ed578e565a7a9fa8cacc635da5f271b733 --- src/lib/evas/canvas/evas_gl.c | 4 ++++ src/lib/evas/include/evas_private.h | 3 +++ src/modules/evas/engines/gl_common/evas_gl_core.c | 2 +- src/modules/evas/engines/software_generic/evas_engine.c | 3 ++- src/modules/evas/engines/wayland_egl/evas_engine.c | 16 ++++++++++++++-- src/modules/evas/engines/wayland_egl/evas_wl_main.c | 12 +++++++----- 6 files changed, 31 insertions(+), 9 deletions(-) diff --git a/src/lib/evas/canvas/evas_gl.c b/src/lib/evas/canvas/evas_gl.c index 6b9b60e..e3903ce 100644 --- a/src/lib/evas/canvas/evas_gl.c +++ b/src/lib/evas/canvas/evas_gl.c @@ -187,6 +187,10 @@ evas_gl_free(Evas_GL *evas_gl) // Destroy private tls _evas_gl_internal_tls_destroy(evas_gl); + // Unset PreRotation + if (evas_gl->evas->engine.func->gl_prerotation_unset) + evas_gl->evas->engine.func->gl_prerotation_unset(evas_gl->evas->engine.data.output); + // Reset current evas gl tls if (_current_evas_gl_key && (evas_gl == eina_tls_get(_current_evas_gl_key))) eina_tls_set(_current_evas_gl_key, NULL); diff --git a/src/lib/evas/include/evas_private.h b/src/lib/evas/include/evas_private.h index 3517d71..99840c1 100644 --- a/src/lib/evas/include/evas_private.h +++ b/src/lib/evas/include/evas_private.h @@ -1482,6 +1482,9 @@ struct _Evas_Func void *(*ector_surface_cache_get) (void *data, void *key); void (*gl_get_pixels) (void *data, Evas_Object_Image_Pixels_Get_Cb cb, void *get_pixels_data, Evas_Object *o, void *image); + + // Unset PreRotation + void (*gl_prerotation_unset) (void *data); }; struct _Evas_Image_Save_Func diff --git a/src/modules/evas/engines/gl_common/evas_gl_core.c b/src/modules/evas/engines/gl_common/evas_gl_core.c index 4545e50..0446d18 100644 --- a/src/modules/evas/engines/gl_common/evas_gl_core.c +++ b/src/modules/evas/engines/gl_common/evas_gl_core.c @@ -1630,7 +1630,7 @@ try_again: (evgl_engine->funcs->native_win_prerotation_set)) { if (!evgl_engine->funcs->native_win_prerotation_set(eng_data)) - ERR("Prerotation does not work"); + DBG("Prerotation does not work"); } // diff --git a/src/modules/evas/engines/software_generic/evas_engine.c b/src/modules/evas/engines/software_generic/evas_engine.c index c8ad700..afd1a75 100644 --- a/src/modules/evas/engines/software_generic/evas_engine.c +++ b/src/modules/evas/engines/software_generic/evas_engine.c @@ -4350,8 +4350,9 @@ static Evas_Func func = eng_ector_end, eng_ector_surface_create, eng_ector_surface_cache_set, - eng_ector_surface_cache_get + eng_ector_surface_cache_get, /* FUTURE software generic calls go here */ + NULL //gl_prerotation_unset }; diff --git a/src/modules/evas/engines/wayland_egl/evas_engine.c b/src/modules/evas/engines/wayland_egl/evas_engine.c index 48c430f..d1f442f 100644 --- a/src/modules/evas/engines/wayland_egl/evas_engine.c +++ b/src/modules/evas/engines/wayland_egl/evas_engine.c @@ -910,7 +910,7 @@ evgl_eng_native_win_prerotation_set(void *data) if (!(eng_get_ob(re)->support_pre_rotation)) return 0; if (eng_get_ob(re)->gl_context->pre_rotated) return 0; - _evas_native_win_pre_rotation_set(eng_get_ob(re)->info->info.win, eng_get_ob(re)->info->info.rotation); + _evas_native_win_pre_rotation_set(eng_get_ob(re)->win, eng_get_ob(re)->info->info.rotation); // re->win's h & w are not modified eng_get_ob(re)->rot = 0; @@ -1168,7 +1168,7 @@ eng_setup(Evas *evas, void *info) (ob->info->info.rotation != ob->rot) || (ob->gl_context->pre_rotated)) { - //TIZEN_ONLY(20161121) : Support PreRotation + // Support PreRotation if (ob->support_pre_rotation && ob->gl_context->pre_rotated) { ob->gl_context->pre_rotated = EINA_FALSE; @@ -1309,6 +1309,15 @@ end: } static void +eng_gl_prerotation_unset(void *data) +{ + Render_Engine *re; + if (!(re = (Render_Engine *)data)) return; + + eng_get_ob(re)->gl_context->pre_rotated = EINA_FALSE; +} + +static void _native_cb_bind(void *data EINA_UNUSED, void *image) { Evas_GL_Image *img; @@ -1927,6 +1936,9 @@ module_open(Evas_Module *em) ORD(gl_current_context_get); ORD(gl_error_get); + //Unset PreRotation + ORD(gl_prerotation_unset); + evas_gl_thread_link_init(); gl_symbols(); diff --git a/src/modules/evas/engines/wayland_egl/evas_wl_main.c b/src/modules/evas/engines/wayland_egl/evas_wl_main.c index 7b37f5e..23bafaa 100644 --- a/src/modules/evas/engines/wayland_egl/evas_wl_main.c +++ b/src/modules/evas/engines/wayland_egl/evas_wl_main.c @@ -109,7 +109,7 @@ _orig_eng_window_new(Evas *evas, Evas_Engine_Info_Wayland_Egl *einfo, int w, int gw->depth_bits = depth_bits; gw->stencil_bits = stencil_bits; gw->msaa_bits = msaa_bits; - //TIZEN_ONLY(20161121):Support PreRotation + //Support PreRotation gw->support_pre_rotation = 0; context_attrs[0] = EGL_CONTEXT_CLIENT_VERSION; @@ -207,7 +207,7 @@ _orig_eng_window_new(Evas *evas, Evas_Engine_Info_Wayland_Egl *einfo, int w, int return NULL; } - //TIZEN_ONLY(20161121):Support PreRotation + //Support PreRotation if (!getenv("EVAS_GL_PREROTATION_DISABLE") && glsym_wl_egl_win_get_capabilities) { int prerotation_cap = EVAS_WL_EGL_WINDOW_CAPABILITY_NONE; @@ -530,9 +530,11 @@ _orig_eng_outbuf_reconfigure(Outbuf *ob, int w, int h, int rot, Outbuf_Depth dep { ob->w = w; ob->h = h; - ob->rot = rot; - if (ob->support_pre_rotation && ob->gl_context->pre_rotated) - ob->rot = 0; + if (ob->support_pre_rotation && ob->gl_context->pre_rotated) + ob->rot = 0; + else + ob->rot = rot; + eng_window_use(ob); glsym_evas_gl_common_context_resize(ob->gl_context, w, h, ob->rot,1); -- 2.7.4