Migration with svn version @65618
authorJaehwan Kim <jae.hwan.kim@samsung.com>
Mon, 28 Nov 2011 02:26:39 +0000 (11:26 +0900)
committerJaehwan Kim <jae.hwan.kim@samsung.com>
Tue, 29 Nov 2011 04:51:13 +0000 (13:51 +0900)
Merge remote branch 'origin/upstream'

Conflicts:
po/el.po

1  2 
src/lib/ecore/ecore_thread.c
src/lib/ecore_evas/ecore_evas_x.c

@@@ -789,9 -789,9 +789,9 @@@ restart
  static Ecore_Pthread_Worker *
  _ecore_thread_worker_new(void)
  {
+ #ifdef EFL_HAVE_THREADS
     Ecore_Pthread_Worker *result;
  
- #ifdef EFL_HAVE_THREADS
     result = eina_trash_pop(&_ecore_thread_worker_trash);
  
     if (!result) result = malloc(sizeof (Ecore_Pthread_Worker));
@@@ -894,9 -894,7 +894,9 @@@ _ecore_thread_assert_main_loop_thread(c
     if (!good)
       {
          EINA_LOG_CRIT("Call to %s from wrong thread!", function);
 +#if 0
          abort();
 +#endif
       }
  }
  
@@@ -1073,6 -1071,7 +1073,7 @@@ on_exit
     ((Ecore_Pthread_Worker *)thread)->cancel = EINA_TRUE;
     return EINA_FALSE;
  #else
+    (void) thread;
     return EINA_TRUE;
  #endif
  }
@@@ -1281,8 -1280,9 +1282,9 @@@ ecore_thread_active_get(void
  EAPI int
  ecore_thread_pending_get(void)
  {
-    int ret;
  #ifdef EFL_HAVE_THREADS
+    int ret;
     LKL(_ecore_pending_job_threads_mutex);
     ret = eina_list_count(_ecore_pending_job_threads);
     LKU(_ecore_pending_job_threads_mutex);
  EAPI int
  ecore_thread_pending_feedback_get(void)
  {
-    int ret;
  #ifdef EFL_HAVE_THREADS
+    int ret;
     LKL(_ecore_pending_job_threads_mutex);
     ret = eina_list_count(_ecore_pending_job_threads_feedback);
     LKU(_ecore_pending_job_threads_mutex);
  EAPI int
  ecore_thread_pending_total_get(void)
  {
-    int ret;
  #ifdef EFL_HAVE_THREADS
+    int ret;
     LKL(_ecore_pending_job_threads_mutex);
     ret = eina_list_count(_ecore_pending_job_threads) + eina_list_count(_ecore_pending_job_threads_feedback);
     LKU(_ecore_pending_job_threads_mutex);
@@@ -1345,8 -1347,9 +1349,9 @@@ ecore_thread_max_reset(void
  EAPI int
  ecore_thread_available_get(void)
  {
-    int ret;
  #ifdef EFL_HAVE_THREADS
+    int ret;
     LKL(_ecore_pending_job_threads_mutex);
     ret = _ecore_thread_count_max - _ecore_thread_count;
     LKU(_ecore_pending_job_threads_mutex);
@@@ -1363,9 -1366,11 +1368,11 @@@ ecore_thread_local_data_add(Ecore_Threa
                              Eina_Free_Cb  cb,
                              Eina_Bool     direct)
  {
+ #ifdef EFL_HAVE_THREADS
     Ecore_Pthread_Worker *worker = (Ecore_Pthread_Worker *)thread;
     Ecore_Thread_Data *d;
     Eina_Bool ret;
+ #endif
  
     if ((!thread) || (!key) || (!value))
       return EINA_FALSE;
     CDB(worker->cond);
     return ret;
  #else
-    return EINA_TRUE;
+    (void) cb;
+    (void) direct;
+    return EINA_FALSE;
  #endif
  }
  
@@@ -1401,9 -1408,12 +1410,12 @@@ ecore_thread_local_data_set(Ecore_Threa
                              void         *value,
                              Eina_Free_Cb  cb)
  {
+ #ifdef EFL_HAVE_THREADS
     Ecore_Pthread_Worker *worker = (Ecore_Pthread_Worker *)thread;
     Ecore_Thread_Data *d, *r;
     void *ret;
+ #endif
     if ((!thread) || (!key) || (!value))
       return NULL;
  #ifdef EFL_HAVE_THREADS
     free(r);
     return ret;
  #else
+    (void) cb;
     return NULL;
  #endif
  }
@@@ -1435,8 -1446,10 +1448,10 @@@ EAPI void 
  ecore_thread_local_data_find(Ecore_Thread *thread,
                               const char   *key)
  {
+ #ifdef EFL_HAVE_THREADS
     Ecore_Pthread_Worker *worker = (Ecore_Pthread_Worker *)thread;
     Ecore_Thread_Data *d;
+ #endif
  
     if ((!thread) || (!key))
       return NULL;
@@@ -1459,7 -1472,10 +1474,10 @@@ EAPI Eina_Boo
  ecore_thread_local_data_del(Ecore_Thread *thread,
                              const char   *key)
  {
+ #ifdef EFL_HAVE_THREADS
     Ecore_Pthread_Worker *worker = (Ecore_Pthread_Worker *)thread;
+ #endif
     if ((!thread) || (!key))
       return EINA_FALSE;
  #ifdef EFL_HAVE_THREADS
@@@ -1479,8 -1495,10 +1497,10 @@@ ecore_thread_global_data_add(const cha
                               Eina_Free_Cb cb,
                               Eina_Bool    direct)
  {
-    Eina_Bool ret;
+ #ifdef EFL_HAVE_THREADS
     Ecore_Thread_Data *d;
+    Eina_Bool ret;
+ #endif
  
     if ((!key) || (!value))
       return EINA_FALSE;
     CDB(_ecore_thread_global_hash_cond);
     return ret;
  #else
+    (void) cb;
+    (void) direct;
     return EINA_TRUE;
  #endif
  }
@@@ -1516,8 -1536,10 +1538,10 @@@ ecore_thread_global_data_set(const cha
                               void        *value,
                               Eina_Free_Cb cb)
  {
+ #ifdef EFL_HAVE_THREADS
     Ecore_Thread_Data *d, *r;
     void *ret;
+ #endif
  
     if ((!key) || (!value))
       return NULL;
     free(r);
     return ret;
  #else
+    (void) cb;
     return NULL;
  #endif
  }
  EAPI void *
  ecore_thread_global_data_find(const char *key)
  {
+ #ifdef EFL_HAVE_THREADS
     Ecore_Thread_Data *ret;
+ #endif
     if (!key)
       return NULL;
  #ifdef EFL_HAVE_THREADS
  EAPI Eina_Bool
  ecore_thread_global_data_del(const char *key)
  {
+ #ifdef EFL_HAVE_THREADS
     Eina_Bool ret;
+ #endif
  
     if (!key)
       return EINA_FALSE;
@@@ -1593,8 -1621,10 +1623,10 @@@ EAPI void 
  ecore_thread_global_data_wait(const char *key,
                                double      seconds)
  {
+ #ifdef EFL_HAVE_THREADS
     double tm = 0;
     Ecore_Thread_Data *ret = NULL;
+ #endif
  
     if (!key)
       return NULL;
     if (ret) return ret->data;
     return NULL;
  #else
+    (void) seconds;
     return NULL;
  #endif
  }
@@@ -77,8 -77,6 +77,8 @@@ _ecore_evas_x_protocols_set(Ecore_Evas 
  static void
  _ecore_evas_x_sync_set(Ecore_Evas *ee)
  {
 +   Ecore_X_Sync_Counter sync_counter = ee->engine.x.sync_counter;
 +
     if (((ee->should_be_visible) || (ee->visible)) &&
         ((ecore_x_e_comp_sync_supported_get(ee->engine.x.win_root)) &&
             (!ee->no_comp_sync) && (_ecore_evas_app_comp_sync)))
     else
       {
          if (ee->engine.x.sync_counter)
 -           ecore_x_sync_counter_free(ee->engine.x.sync_counter);
 +          {
 +             ecore_x_sync_counter_free(ee->engine.x.sync_counter);
 +             ee->engine.x.sync_val = 0;
 +          }
          ee->engine.x.sync_counter = 0;
       }
 -   ecore_x_e_comp_sync_counter_set(ee->prop.window, ee->engine.x.sync_counter);
 +   if (sync_counter != ee->engine.x.sync_counter)
 +      ecore_x_e_comp_sync_counter_set(ee->prop.window, ee->engine.x.sync_counter);
  }
  
  static void
@@@ -104,7 -98,6 +104,7 @@@ _ecore_evas_x_sync_clear(Ecore_Evas *ee
  {
     if (!ee->engine.x.sync_counter) return;
     ecore_x_sync_counter_free(ee->engine.x.sync_counter);
 +   ee->engine.x.sync_val = 0;
     ee->engine.x.sync_counter = 0;
  }
  
@@@ -1001,17 -994,6 +1001,17 @@@ _ecore_evas_x_event_window_show(void *d
     ee = ecore_event_window_match(e->win);
     if (!ee) return ECORE_CALLBACK_PASS_ON; /* pass on event */
     if (e->win != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
 +   /* some GL drivers are doing buffer copy in a separate thread.
 +    * we need to check whether GL driver sends SYNC_DRAW_DONE msg afger copying
 +    * that are required in order to exactly render. - added by gl77.lee
 +    */
 +   if (ee->gl_sync_draw_done < 0)
 +     {
 +        if (getenv("ECORE_EVAS_GL_SYNC_DRAW_DONE"))
 +           ee->gl_sync_draw_done = atoi(getenv("ECORE_EVAS_GL_SYNC_DRAW_DONE"));
 +        else
 +           ee->gl_sync_draw_done = 0;
 +     }
     if (first_map_bug < 0)
       {
          char *bug = NULL;
       }
     if ((first_map_bug) && (!strcmp(ee->driver, "opengl_x11")))
       evas_damage_rectangle_add(ee->evas, 0, 0, ee->w, ee->h);
-    if (ee->visible) return ECORE_CALLBACK_DONE;
+    if (ee->visible) return ECORE_CALLBACK_PASS_ON;
+ //   if (ee->visible) return ECORE_CALLBACK_DONE;
  //   printf("SHOW EVENT %p\n", ee);
     ee->visible = 1;
     if (ee->func.fn_show) ee->func.fn_show(ee);
@@@ -1040,7 -1023,8 +1041,8 @@@ _ecore_evas_x_event_window_hide(void *d
     ee = ecore_event_window_match(e->win);
     if (!ee) return ECORE_CALLBACK_PASS_ON; /* pass on event */
     if (e->win != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
-    if (!ee->visible) return ECORE_CALLBACK_DONE;
+    if (!ee->visible) return ECORE_CALLBACK_PASS_ON;
+ //   if (!ee->visible) return ECORE_CALLBACK_DONE;
  //   printf("HIDE EVENT %p\n", ee);
     ee->visible = 0;
     if (ee->func.fn_hide) ee->func.fn_hide(ee);
@@@ -1560,41 -1544,10 +1562,41 @@@ _ecore_evas_x_rotation_set_internal(Eco
       }
  }
  
 +#define _USE_WIN_ROT_EFFECT 1
 +
 +#if _USE_WIN_ROT_EFFECT
 +static void _ecore_evas_x_flush_pre(void *data, Evas *e __UNUSED__, void *event_info __UNUSED__);
 +
 +typedef struct _Ecore_Evas_X_Rotation_Effect Ecore_Evas_X_Rotation_Effect;
 +struct _Ecore_Evas_X_Rotation_Effect
 +{
 +   Eina_Bool    wait_for_comp_reply;
 +};
 +
 +static Ecore_Evas_X_Rotation_Effect _rot_effect =
 +{
 +   EINA_FALSE
 +};
 +
 +static void
 +_ecore_evas_x_rotation_effect_setup(void)
 +{
 +   _rot_effect.wait_for_comp_reply = EINA_TRUE;
 +}
 +#endif /* end of _USE_WIN_ROT_EFFECT */
 +
  static void
  _ecore_evas_x_rotation_set(Ecore_Evas *ee, int rotation, int resize)
  {
     if (ee->rotation == rotation) return;
 +   if (!strcmp(ee->driver, "xrender_x11")) return;
 +
 +#if _USE_WIN_ROT_EFFECT
 +   int angles[2];
 +   angles[0] = rotation;
 +   angles[1] = ee->rotation;
 +#endif /* end of _USE_WIN_ROT_EFFECT */
 +
     if (!strcmp(ee->driver, "opengl_x11"))
       {
  #ifdef BUILD_ECORE_EVAS_OPENGL_X11
          einfo->info.rotation = rotation;
          _ecore_evas_x_rotation_set_internal(ee, rotation, resize,
                                              (Evas_Engine_Info *)einfo);
 +# if _USE_WIN_ROT_EFFECT
 +        ecore_x_window_prop_property_set(ee->prop.window,
 +                                         ECORE_X_ATOM_E_ILLUME_ROTATE_WINDOW_ANGLE,
 +                                         ECORE_X_ATOM_CARDINAL, 32, &angles, 2);
 +# else
 +        ecore_x_window_prop_property_set(ee->prop.window,
 +                                         ECORE_X_ATOM_E_ILLUME_ROTATE_WINDOW_ANGLE,
 +                                         ECORE_X_ATOM_CARDINAL, 32, &rotation, 1);
 +# endif
  #endif /* BUILD_ECORE_EVAS_OPENGL_X11 */
       }
     else if (!strcmp(ee->driver, "software_x11"))
          einfo->info.rotation = rotation;
          _ecore_evas_x_rotation_set_internal(ee, rotation, resize,
                                              (Evas_Engine_Info *)einfo);
 +# if _USE_WIN_ROT_EFFECT
 +        ecore_x_window_prop_property_set(ee->prop.window,
 +                                         ECORE_X_ATOM_E_ILLUME_ROTATE_WINDOW_ANGLE,
 +                                         ECORE_X_ATOM_CARDINAL, 32, &angles, 2);
 +# else
 +        ecore_x_window_prop_property_set(ee->prop.window,
 +                                         ECORE_X_ATOM_E_ILLUME_ROTATE_WINDOW_ANGLE,
 +                                         ECORE_X_ATOM_CARDINAL, 32, &rotation, 1);
 +# endif
  #endif /* BUILD_ECORE_EVAS_SOFTWARE_X11 */
       }
     else if (!strcmp(ee->driver,  "software_16_x11"))
          einfo->info.rotation = rotation;
          _ecore_evas_x_rotation_set_internal(ee, rotation, resize,
                                              (Evas_Engine_Info *)einfo);
 +# if _USE_WIN_ROT_EFFECT
 +        ecore_x_window_prop_property_set(ee->prop.window,
 +                                         ECORE_X_ATOM_E_ILLUME_ROTATE_WINDOW_ANGLE,
 +                                         ECORE_X_ATOM_CARDINAL, 32, &angles, 2);
 +# else
 +        ecore_x_window_prop_property_set(ee->prop.window,
 +                                         ECORE_X_ATOM_E_ILLUME_ROTATE_WINDOW_ANGLE,
 +                                         ECORE_X_ATOM_CARDINAL, 32, &rotation, 1);
 +# endif
  #endif /* BUILD_ECORE_EVAS_SOFTWARE_16_X11 */
       }
     else if (!strcmp(ee->driver,  "software_8_x11"))
          einfo->info.rotation = rotation;
          _ecore_evas_x_rotation_set_internal(ee, rotation, resize,
                                              (Evas_Engine_Info *)einfo);
 +# if _USE_WIN_ROT_EFFECT
 +        ecore_x_window_prop_property_set(ee->prop.window,
 +                                         ECORE_X_ATOM_E_ILLUME_ROTATE_WINDOW_ANGLE,
 +                                         ECORE_X_ATOM_CARDINAL, 32, &angles, 2);
 +# else
 +        ecore_x_window_prop_property_set(ee->prop.window,
 +                                         ECORE_X_ATOM_E_ILLUME_ROTATE_WINDOW_ANGLE,
 +                                         ECORE_X_ATOM_CARDINAL, 32, &rotation, 1);
 +# endif
  #endif /* BUILD_ECORE_EVAS_SOFTWARE_8_X11 */
       }
 +
 +#if _USE_WIN_ROT_EFFECT
 +   if ((ee->visible) &&
 +       ((ecore_x_e_comp_sync_supported_get(ee->engine.x.win_root)) &&
 +        (!ee->no_comp_sync) && (_ecore_evas_app_comp_sync)) &&
 +        (ee->engine.x.sync_counter) &&
 +        (ee->engine.x.sync_val > 0))
 +     {
 +        _ecore_evas_x_rotation_effect_setup();
 +        _ecore_evas_x_flush_pre(ee, NULL, NULL);
 +     }
 +#endif /* end of _USE_WIN_ROT_EFFECT */
  }
  
  static void
@@@ -2557,9 -2462,9 +2559,9 @@@ static voi
  _ecore_evas_x_override_set(Ecore_Evas *ee, int on)
  {
     if (ee->prop.override == on) return;
-    ecore_x_window_hide(ee->prop.window);
+    if (ee->should_be_visible) ecore_x_window_hide(ee->prop.window);
     ecore_x_window_override_set(ee->prop.window, on);
-    if (ee->visible) ecore_x_window_show(ee->prop.window);
+    if (ee->should_be_visible) ecore_x_window_show(ee->prop.window);
     if (ee->prop.focused) ecore_x_window_focus(ee->prop.window);
     ee->prop.override = on;
  }
@@@ -2865,8 -2770,7 +2867,8 @@@ _ecore_evas_x_flush_post(void *data, Ev
  {
     Ecore_Evas *ee = data;
  
 -   if ((!ee->no_comp_sync) && (_ecore_evas_app_comp_sync))
 +   if ((!ee->no_comp_sync) && (_ecore_evas_app_comp_sync) &&
 +       (!ee->gl_sync_draw_done)) // added by gl77.lee
       {
          if (ee->engine.x.sync_counter)
            {
@@@ -3234,20 -3138,14 +3236,20 @@@ ecore_evas_gl_x11_options_new(const cha
  
     ECORE_MAGIC_SET(ee, ECORE_MAGIC_EVAS);
  
 +   ee->gl_sync_draw_done = -1; // added by gl77.lee
 +
     _ecore_evas_x_init();
  
     ee->engine.func = (Ecore_Evas_Engine_Func *)&_ecore_x_engine_func;
  
     ee->driver = "opengl_x11";
 +#if 1
 +   ee->semi_sync = 0; // gl engine doesn't need to sync - its whole swaps
 +#else
     if (!getenv("ECORE_EVAS_COMP_NOSEMISYNC"))
        ee->semi_sync = 1; // gl engine doesn't need to sync - its whole swaps
  //   ee->no_comp_sync = 1; // gl engine doesn't need to sync - its whole swaps
 +#endif
     if (disp_name) ee->name = strdup(disp_name);
  
     if (w < 1) w = 1;