added an ECORE_X_ATOM_E_COMP_DRI_BUFF_FLIP_SUPPORTED atom
authorGwanglim Lee <gl77.lee@samsung.com>
Sun, 4 Jul 2010 10:50:44 +0000 (19:50 +0900)
committerGwanglim Lee <gl77.lee@samsung.com>
Sun, 4 Jul 2010 10:50:44 +0000 (19:50 +0900)
src/lib/ecore_x/Ecore_X.h
src/lib/ecore_x/Ecore_X_Atoms.h
src/lib/ecore_x/ecore_x_atoms_decl.h
src/lib/ecore_x/xlib/ecore_x_atoms.c
src/lib/ecore_x/xlib/ecore_x_e.c

index a8fe707..f0bf174 100644 (file)
@@ -1624,6 +1624,9 @@ EAPI void                 ecore_x_e_comp_sync_cancel_send(Ecore_X_Window win);
 
 EAPI void                 ecore_x_e_comp_flush_send(Ecore_X_Window win);
 EAPI void                 ecore_x_e_comp_dump_send(Ecore_X_Window win);
+
+EAPI void                 ecore_x_e_comp_dri_buff_flip_supported_set(Ecore_X_Window root, Eina_Bool enabled);
+EAPI void                 ecore_x_e_comp_dri_buff_flip_supported_get(Ecore_X_Window root);
        
 EAPI Ecore_X_Sync_Alarm   ecore_x_sync_alarm_new(Ecore_X_Sync_Counter counter);
 EAPI int                  ecore_x_sync_alarm_free(Ecore_X_Sync_Alarm alarm);
index 3e48537..7e7c9f1 100755 (executable)
@@ -250,6 +250,7 @@ EAPI extern Ecore_X_Atom ECORE_X_ATOM_E_COMP_SYNC_END;
 EAPI extern Ecore_X_Atom ECORE_X_ATOM_E_COMP_SYNC_CANCEL;
 EAPI extern Ecore_X_Atom ECORE_X_ATOM_E_COMP_FLUSH;
 EAPI extern Ecore_X_Atom ECORE_X_ATOM_E_COMP_DUMP;
+EAPI extern Ecore_X_Atom ECORE_X_ATOM_E_COMP_DRI_BUFF_FLIP_SUPPORTED;
 
 /* added by doyoun.kang 100218 - for rotation */
 EAPI extern Ecore_X_Atom ECORE_X_ATOM_E_ILLUME_ROTATE_WINDOW_ANGLE;
index 7ae5039..1858523 100755 (executable)
@@ -274,6 +274,8 @@ EAPI Ecore_X_Atom ECORE_X_ATOM_E_COMP_SYNC_CANCEL = 0;
 EAPI Ecore_X_Atom ECORE_X_ATOM_E_COMP_FLUSH = 0;
 EAPI Ecore_X_Atom ECORE_X_ATOM_E_COMP_DUMP = 0;
 
+EAPI Ecore_X_Atom ECORE_X_ATOM_E_COMP_DRI_BUFF_FLIP_SUPPORTED = 0;
+
 /* added by doyoun.kang 100218 - for rotation */
 EAPI Ecore_X_Atom ECORE_X_ATOM_E_ILLUME_ROTATE_WINDOW_ANGLE = 0;
 EAPI Ecore_X_Atom ECORE_X_ATOM_E_ILLUME_ROTATE_WINDOW_AVAILABLE_ANGLE = 0;
index 4ad191b..fd60228 100755 (executable)
@@ -266,6 +266,8 @@ _ecore_x_atoms_init(void)
         { "_E_COMP_FLUSH", &ECORE_X_ATOM_E_COMP_FLUSH },
         { "_E_COMP_DUMP", &ECORE_X_ATOM_E_COMP_DUMP },
 
+        { "_E_COMP_DRI_BUFF_FLIP_SUPPORTED", &ECORE_X_ATOM_E_COMP_DRI_BUFF_FLIP_SUPPORTED },
+
         /* added by doyoun.kang 100218 - for rotation */
         { "_E_ILLUME_ROTATE_WINDOW_ANGLE", & ECORE_X_ATOM_E_ILLUME_ROTATE_WINDOW_ANGLE },
         { "_E_ILLUME_ROTATE_WINDOW_AVAILABLE_ANGLES", & ECORE_X_ATOM_E_ILLUME_ROTATE_WINDOW_AVAILABLE_ANGLE },
index 5493ca4..62b4d1e 100644 (file)
@@ -858,3 +858,63 @@ ecore_x_e_comp_dump_send(Ecore_X_Window win)
               NoEventMask, //SubstructureRedirectMask | SubstructureNotifyMask, 
               &xev);
 }
+
+/* added by gl77.lee 100704 - support for DRI buffer flipping */
+EAPI void
+ecore_x_e_comp_dri_buff_flip_supported_set(Ecore_X_Window root, Eina_Bool enabled)
+{
+   Ecore_X_Window win;
+
+   if (!root) root = DefaultRootWindow(_ecore_x_disp);
+   LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   if (enabled)
+     {
+        win = ecore_x_window_new(root, 1, 2, 3, 4);
+        ecore_x_window_prop_xid_set(win, ECORE_X_ATOM_E_COMP_DRI_BUFF_FLIP_SUPPORTED,
+                                     ECORE_X_ATOM_WINDOW, &win, 1);
+        ecore_x_window_prop_xid_set(root, ECORE_X_ATOM_E_COMP_DRI_BUFF_FLIP_SUPPORTED,
+                                     ECORE_X_ATOM_WINDOW, &win, 1);
+     }
+   else
+     {
+        int ret;
+        ret =
+          ecore_x_window_prop_xid_get(root,
+                                      ECORE_X_ATOM_E_COMP_DRI_BUFF_FLIP_SUPPORTED,
+                                      ECORE_X_ATOM_WINDOW,
+                                      &win, 1);
+        if ((ret == 1) && (win))
+          {
+             ecore_x_window_prop_property_del(root, ECORE_X_ATOM_E_COMP_DRI_BUFF_FLIP_SUPPORTED);
+             ecore_x_window_free(win);
+          }
+     }
+}
+
+EAPI Eina_Bool
+ecore_x_e_comp_dri_buff_flip_supported_get(Ecore_X_Window root)
+{
+   Ecore_X_Window win, win2;
+   int ret;
+
+   LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   if (!root) root = DefaultRootWindow(_ecore_x_disp);
+   ret =
+     ecore_x_window_prop_xid_get(root,
+                                 ECORE_X_ATOM_E_COMP_DRI_BUFF_FLIP_SUPPORTED,
+                                 ECORE_X_ATOM_WINDOW,
+                                 &win, 1);
+   if ((ret == 1) && (win))
+     {
+        ret =
+          ecore_x_window_prop_xid_get(win,
+                                      ECORE_X_ATOM_E_COMP_DRI_BUFF_FLIP_SUPPORTED,
+                                      ECORE_X_ATOM_WINDOW,
+                                      &win2, 1);
+        if ((ret == 1) && (win2 == win))
+          {
+             return 1;
+          }
+     }
+   return 0;
+}