Enlightenment CVS committal

Author  : raster
Project : e17
Module  : libs/ecore

Dir     : e17/libs/ecore/src/lib/ecore_evas


Modified Files:
        Ecore_Evas.h ecore_evas.c ecore_evas_private.h ecore_evas_x.c 


Log Message:


avoid damage now has an enum (compatible with the old way at ABI though), so
you can either handle it via exposes, or native system methods (bg pixmaps)

===================================================================
RCS file: /cvs/e/e17/libs/ecore/src/lib/ecore_evas/Ecore_Evas.h,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -3 -r1.32 -r1.33
--- Ecore_Evas.h        26 Sep 2007 14:40:02 -0000      1.32
+++ Ecore_Evas.h        3 Oct 2007 06:31:05 -0000       1.33
@@ -69,6 +69,13 @@
    ECORE_EVAS_ENGINE_SDL
 } Ecore_Evas_Engine_Type;
 
+typedef enum _Ecore_Evas_Avoid_Damage_Type
+{
+   ECORE_EVAS_AVOID_DAMAGE_NONE = 0,
+   ECORE_EVAS_AVOID_DAMAGE_EXPOSE = 1,
+   ECORE_EVAS_AVOID_DAMAGE_BUILT_IN = 2
+} Ecore_Evas_Avoid_Damage_Type;
+   
 #ifndef _ECORE_X_H
 #define _ECORE_X_WINDOW_PREDEF
 typedef unsigned int Ecore_X_Window;
@@ -217,8 +224,8 @@
 EAPI int         ecore_evas_maximized_get(Ecore_Evas *ee);
 EAPI void        ecore_evas_fullscreen_set(Ecore_Evas *ee, int on);
 EAPI int         ecore_evas_fullscreen_get(Ecore_Evas *ee);
-EAPI void        ecore_evas_avoid_damage_set(Ecore_Evas *ee, int on);
-EAPI int         ecore_evas_avoid_damage_get(Ecore_Evas *ee);
+EAPI void        ecore_evas_avoid_damage_set(Ecore_Evas *ee, 
Ecore_Evas_Avoid_Damage_Type on);
+EAPI Ecore_Evas_Avoid_Damage_Type ecore_evas_avoid_damage_get(Ecore_Evas *ee);
 EAPI void        ecore_evas_withdrawn_set(Ecore_Evas *ee, int withdrawn);
 EAPI int         ecore_evas_withdrawn_get(Ecore_Evas *ee);
 EAPI void        ecore_evas_sticky_set(Ecore_Evas *ee, int sticky);
===================================================================
RCS file: /cvs/e/e17/libs/ecore/src/lib/ecore_evas/ecore_evas.c,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -3 -r1.40 -r1.41
--- ecore_evas.c        26 Sep 2007 14:40:02 -0000      1.40
+++ ecore_evas.c        3 Oct 2007 06:31:05 -0000       1.41
@@ -1625,7 +1625,7 @@
  * On expose events it will copy from the pixmap to the window.
  */
 EAPI void
-ecore_evas_avoid_damage_set(Ecore_Evas *ee, int on)
+ecore_evas_avoid_damage_set(Ecore_Evas *ee, Ecore_Evas_Avoid_Damage_Type on)
 {
    if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
      {
@@ -1643,7 +1643,7 @@
  * @return 1 if @p ee avoids damage, 0 if not.
  *
  */
-EAPI int
+EAPI Ecore_Evas_Avoid_Damage_Type
 ecore_evas_avoid_damage_get(Ecore_Evas *ee)
 {
    if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
@@ -1652,7 +1652,7 @@
                         "ecore_evas_avoid_damage_get");
        return 0;
      }
-   return ee->prop.avoid_damage ? 1:0;
+   return ee->prop.avoid_damage;
 }
 
 /**
===================================================================
RCS file: /cvs/e/e17/libs/ecore/src/lib/ecore_evas/ecore_evas_private.h,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -3 -r1.33 -r1.34
--- ecore_evas_private.h        27 Sep 2007 15:31:00 -0000      1.33
+++ ecore_evas_private.h        3 Oct 2007 06:31:05 -0000       1.34
@@ -234,13 +234,13 @@
         } hot;
       } cursor;
       int             layer;
+      unsigned char   avoid_damage;
       char            focused      : 1;
       char            iconified    : 1;
       char            borderless   : 1;
       char            override     : 1;
       char            maximized    : 1;
       char            fullscreen   : 1;
-      char            avoid_damage : 1;
       char            withdrawn    : 1;
       char            sticky       : 1;
       char            request_pos  : 1;
===================================================================
RCS file: /cvs/e/e17/libs/ecore/src/lib/ecore_evas/ecore_evas_x.c,v
retrieving revision 1.112
retrieving revision 1.113
diff -u -3 -r1.112 -r1.113
--- ecore_evas_x.c      29 Sep 2007 01:52:13 -0000      1.112
+++ ecore_evas_x.c      3 Oct 2007 06:31:05 -0000       1.113
@@ -158,13 +158,16 @@
 
        updates = evas_render_updates(ee->evas);
 #if 0
-       for (l = updates; l; l = l->next)
+//     if (ee->w == 640)
          {
-            Evas_Rectangle *r;
-
-            r = l->data;
-            printf("DMG render [%p] %ix%i, [%i %i %ix%i]\n",
-                   ee, ee->w, ee->h, r->x, r->y, r->w, r->h);
+            for (l = updates; l; l = l->next)
+              {
+                 Evas_Rectangle *r;
+                 
+                 r = l->data;
+                 printf("  UP render [%p] %ix%i, [%i %i %ix%i]\n",
+                        ee, ee->w, ee->h, r->x, r->y, r->w, r->h);
+              }
          }
 #endif
        if (ee->engine.x.using_bg_pixmap)
@@ -232,6 +235,10 @@
               }
             if (ee->engine.x.damages)
               {
+#if 0
+//               if (ee->w == 640)
+                   printf("    --COPY PIXMAP\n");
+#endif        
                  /* if we have a damage pixmap - we can avoid exposures by
                   * disabling them just for setting the mask */
                  ecore_x_event_mask_set(ee->engine.x.win,
@@ -309,17 +316,20 @@
             if (updates)
               {
 #if 0
-                 Evas_List *l;
-
-                 printf("RENDER [%p] [%i] %ix%i\n",
-                        ee, ee->visible, ee->w, ee->h);
-                 for (l = updates; l; l = l->next)
+//               if (ee->w == 640)
                    {
-                      Evas_Rectangle *r;
-
-                      r = l->data;
-                      printf("   render [%i %i %ix%i]\n",
-                             r->x, r->y, r->w, r->h);
+                      Evas_List *l;
+                      
+                      printf("RENDER [%p] [%i] %ix%i\n",
+                             ee, ee->visible, ee->w, ee->h);
+                      for (l = updates; l; l = l->next)
+                        {
+                           Evas_Rectangle *r;
+                           
+                           r = l->data;
+                           printf("   render [%i %i %ix%i]\n",
+                                  r->x, r->y, r->w, r->h);
+                        }
                    }
 #endif
                  evas_render_updates_free(updates);
@@ -1043,8 +1053,11 @@
          }
        if (ee->prop.avoid_damage)
          {
+            int pdam;
+            
+            pdam = ecore_evas_avoid_damage_get(ee);
             ecore_evas_avoid_damage_set(ee, 0);
-            ecore_evas_avoid_damage_set(ee, 1);
+            ecore_evas_avoid_damage_set(ee, pdam);
          }
        if (ee->shaped)
          _ecore_evas_x_resize_shape(ee);
@@ -1455,8 +1468,11 @@
               }
             if (ee->prop.avoid_damage)
               {
+                 int pdam;
+                 
+                 pdam = ecore_evas_avoid_damage_get(ee);
                  ecore_evas_avoid_damage_set(ee, 0);
-                 ecore_evas_avoid_damage_set(ee, 1);
+                 ecore_evas_avoid_damage_set(ee, pdam);
               }
             if (ee->shaped)
               {
@@ -1503,8 +1519,11 @@
               }
             if (ee->prop.avoid_damage)
               {
+                 int pdam;
+                 
+                 pdam = ecore_evas_avoid_damage_get(ee);
                  ecore_evas_avoid_damage_set(ee, 0);
-                 ecore_evas_avoid_damage_set(ee, 1);
+                 ecore_evas_avoid_damage_set(ee, pdam);
               }
             if (ee->shaped)
               {
@@ -2351,9 +2370,7 @@
 static void
 _ecore_evas_x_avoid_damage_set(Ecore_Evas *ee, int on)
 {
-   if (((ee->prop.avoid_damage) && (on)) ||
-       ((!ee->prop.avoid_damage) && (!on)))
-     return;
+   if (ee->prop.avoid_damage == on) return;
    if (!strcmp(ee->driver, "gl_x11")) return;
 
    if ((!strcmp(ee->driver, "software_x11")) || (!strcmp(ee->driver, 
"software_xcb")))
@@ -2382,6 +2399,12 @@
                    evas_damage_rectangle_add(ee->evas, 0, 0, ee->h, ee->w);
                  else
                    evas_damage_rectangle_add(ee->evas, 0, 0, ee->w, ee->h);
+                 if (ee->prop.avoid_damage == ECORE_EVAS_AVOID_DAMAGE_BUILT_IN)
+                   {
+                      ee->engine.x.using_bg_pixmap = 1;
+                      ecore_x_window_pixmap_set(ee->engine.x.win, 
ee->engine.x.pmap);
+                      ecore_x_window_area_expose(ee->engine.x.win, 0, 0, 
ee->w, ee->h);
+                   }
                  if (ee->engine.x.direct_resize)
                    {
                       /* Turn this off for now
@@ -2398,6 +2421,7 @@
                    {
                       ecore_x_window_pixmap_set(ee->engine.x.win, 0);
                       ee->engine.x.using_bg_pixmap = 0;
+                      ecore_x_window_area_expose(ee->engine.x.win, 0, 0, 
ee->w, ee->h);
                    }
                  ee->engine.x.pmap = 0;
                  ee->engine.x.gc = 0;
@@ -2834,9 +2858,11 @@
          }
        else
          {
+/* turn this off too- bg pixmap is controlled by avoid damage directly      
             ee->engine.x.using_bg_pixmap = 0;
             ecore_x_window_pixmap_set(ee->engine.x.win, 0);
             ecore_x_window_area_expose(ee->engine.x.win, 0, 0, ee->w, ee->h);
+ */
          }
      }
 #else
@@ -3487,9 +3513,11 @@
          }
        else
          {
+/* turn this off too- bg pixmap is controlled by avoid damage directly      
             ee->engine.x.using_bg_pixmap = 0;
             ecore_x_window_pixmap_set(ee->engine.x.win, 0);
             ecore_x_window_area_expose(ee->engine.x.win, 0, 0, ee->w, ee->h);
+ */
          }
      }
 #else



-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to