[EvasGL] Add to unset PreRotation 57/140857/3
authorWonsik, Jung <sidein@samsung.com>
Thu, 27 Jul 2017 02:00:37 +0000 (11:00 +0900)
committerGerrit Code Review <gerrit@review.ap-northeast-2.compute.internal>
Fri, 28 Jul 2017 08:49:03 +0000 (08:49 +0000)
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
src/lib/evas/include/evas_private.h
src/modules/evas/engines/gl_common/evas_gl_core.c
src/modules/evas/engines/software_generic/evas_engine.c
src/modules/evas/engines/wayland_egl/evas_engine.c
src/modules/evas/engines/wayland_egl/evas_wl_main.c

index 6b9b60e..e3903ce 100644 (file)
@@ -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);
index 3517d71..99840c1 100644 (file)
@@ -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
index 4545e50..0446d18 100644 (file)
@@ -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");
                }
              //
 
index c8ad700..afd1a75 100644 (file)
@@ -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
 };
 
 
index 48c430f..d1f442f 100644 (file)
@@ -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();
 
index 7b37f5e..23bafaa 100644 (file)
@@ -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);