Enlightenment CVS committal

Author  : raster
Project : e17
Module  : libs/evas

Dir     : e17/libs/evas/src/modules/engines/software_x11


Modified Files:
        evas_outbuf.c 


Log Message:


cedric's cache changes patch

===================================================================
RCS file: /cvs/e/e17/libs/evas/src/modules/engines/software_x11/evas_outbuf.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -3 -r1.18 -r1.19
--- evas_outbuf.c       9 Mar 2008 09:35:12 -0000       1.18
+++ evas_outbuf.c       12 Apr 2008 00:32:28 -0000      1.19
@@ -330,6 +330,7 @@
    Outbuf_Region      *obr;
    int                 bpl = 0;
    int                 use_shm = 1;
+   int                 alpha;
 
    if ((buf->onebuf) && (buf->priv.x.shm))
      {
@@ -360,7 +361,7 @@
                  im = buf->priv.onebuf;
                  for (yy = y; yy < (y + h); yy++)
                    {
-                      memset(im->image->data + (im->image->w * yy) + x,
+                      memset(im->image.data + (im->cache_entry.w * yy) + x,
                              0, w * sizeof(DATA32));
                    }
               }
@@ -375,26 +376,26 @@
        *cy = y;
        *cw = w;
        *ch = h;
-       
+
+        alpha = ((buf->priv.x.mask) || (buf->priv.destination_alpha));
+
        use_shm = buf->priv.x.shm;
        if ((buf->rot == 0) &&
            (buf->priv.mask.r == 0xff0000) &&
            (buf->priv.mask.g == 0x00ff00) &&
            (buf->priv.mask.b == 0x0000ff))
          {
-            im = evas_cache_image_empty(evas_common_image_cache_get());
-            im->image->w = buf->w;
-            im->image->h = buf->h;
-            im->image->data = NULL;
-            im->image->no_free = 1;
-            im->extended_info = obr;
             obr->xob = evas_software_x11_x_output_buffer_new(buf->priv.x.disp,
                                                              buf->priv.x.vis,
                                                              buf->priv.x.depth,
                                                              buf->w, buf->h,
                                                              use_shm,
                                                              NULL);
-            im->image->data = (DATA32 *) 
evas_software_x11_x_output_buffer_data(obr->xob, &bpl);
+             im = (RGBA_Image *) 
evas_cache_image_data(evas_common_image_cache_get(),
+                                                       buf->w, buf->h,
+                                                       (DATA32 *) 
evas_software_x11_x_output_buffer_data(obr->xob, &bpl),
+                                                       alpha, 
EVAS_COLORSPACE_ARGB8888);
+            im->extended_info = obr;
             if (buf->priv.x.mask)
               obr->mxob = 
evas_software_x11_x_output_buffer_new(buf->priv.x.disp,
                                                                 
buf->priv.x.vis,
@@ -405,10 +406,9 @@
          }
        else
          {
-            im = evas_cache_image_empty(evas_common_image_cache_get());
-            im->image->w = buf->w;
-            im->image->h = buf->h;
-            evas_common_image_surface_alloc(im->image);
+            im = (RGBA_Image *) 
evas_cache_image_empty(evas_common_image_cache_get());
+             im->flags |= alpha ? RGBA_IMAGE_HAS_ALPHA : 0;
+             evas_cache_image_surface_alloc(&im->cache_entry, buf->w, buf->h);
             im->extended_info = obr;
             if ((buf->rot == 0) || (buf->rot == 180))
               obr->xob = 
evas_software_x11_x_output_buffer_new(buf->priv.x.disp,
@@ -431,22 +431,14 @@
                                                                 use_shm,
                                                                 NULL);
          }
-       if ((buf->priv.x.mask) || (buf->priv.destination_alpha))
-         {
-            im->flags |= RGBA_IMAGE_HAS_ALPHA;
-            /* FIXME: faster memset! */
-            memset(im->image->data, 0, w * h * sizeof(DATA32));
-         }
-       buf->priv.onebuf = im;
+       if (alpha)
+          /* FIXME: faster memset! */
+          memset(im->image.data, 0, w * h * sizeof(DATA32));
+
+        buf->priv.onebuf = im;
        return im;
      }
-   
-   
-   
-   
-   
-   
-   
+
    obr = calloc(1, sizeof(Outbuf_Region));
    obr->x = x;
    obr->y = y;
@@ -464,32 +456,30 @@
 //   use_shm = 0; /* 630 -> 1006 fps */
 //   if ((w * h) < (200 * 200)) use_shm = 0; /* 630 -> 962 fps */
 
+   alpha = ((buf->priv.x.mask) || (buf->priv.destination_alpha));
+
    if ((buf->rot == 0) &&
        (buf->priv.mask.r == 0xff0000) &&
        (buf->priv.mask.g == 0x00ff00) &&
        (buf->priv.mask.b == 0x0000ff))
      {
-       im = evas_cache_image_empty(evas_common_image_cache_get());
-       im->image->w = w;
-       im->image->h = h;
-       im->image->data = NULL;
-       im->image->no_free = 1;
-       im->extended_info = obr;
        obr->xob = _find_xob(buf->priv.x.disp,
                             buf->priv.x.vis,
                             buf->priv.x.depth,
                             w, h,
                             use_shm,
                             NULL);
- /*    
-       obr->xob = evas_software_x11_x_output_buffer_new(buf->priv.x.disp,
-                                                        buf->priv.x.vis,
-                                                        buf->priv.x.depth,
-                                                        w, h,
-                                                        use_shm,
-                                                        NULL);
- */
-       im->image->data = (DATA32 *) 
evas_software_x11_x_output_buffer_data(obr->xob, &bpl);
+/*      obr->xob = evas_software_x11_x_output_buffer_new(buf->priv.x.disp, */
+/*                                                      buf->priv.x.vis, */
+/*                                                      buf->priv.x.depth, */
+/*                                                      w, h, */
+/*                                                      use_shm, */
+/*                                                      NULL); */
+        im = (RGBA_Image *) 
evas_cache_image_data(evas_common_image_cache_get(),
+                                                  w, h,
+                                                  (DATA32 *) 
evas_software_x11_x_output_buffer_data(obr->xob, &bpl),
+                                                  alpha, 
EVAS_COLORSPACE_ARGB8888);
+       im->extended_info = obr;
        if (buf->priv.x.mask)
          obr->mxob = _find_xob(buf->priv.x.disp,
                                buf->priv.x.vis,
@@ -506,10 +496,9 @@
      }
    else
      {
-       im = evas_cache_image_empty(evas_common_image_cache_get());
-        im->image->w = w;
-        im->image->h = h;
-        evas_common_image_surface_alloc(im->image);
+        im = (RGBA_Image *) 
evas_cache_image_empty(evas_common_image_cache_get());
+        im->flags |= alpha ? RGBA_IMAGE_HAS_ALPHA : 0;
+        evas_cache_image_surface_alloc(&im->cache_entry, w, h);
        im->extended_info = obr;
        if ((buf->rot == 0) || (buf->rot == 180))
          obr->xob = _find_xob(buf->priv.x.disp,
@@ -556,11 +545,9 @@
  */
      }
    if ((buf->priv.x.mask) || (buf->priv.destination_alpha))
-     {
-       im->flags |= RGBA_IMAGE_HAS_ALPHA;
-       /* FIXME: faster memset! */
-       memset(im->image->data, 0, w * h * sizeof(DATA32));
-     }
+     /* FIXME: faster memset! */
+     memset(im->image.data, 0, w * h * sizeof(DATA32));
+
    buf->priv.pending_writes = evas_list_append(buf->priv.pending_writes, im);
    return im;
 }
@@ -692,7 +679,7 @@
             RGBA_Image *im;
             Outbuf_Region *obr;
             
-            im = buf->priv.pending_writes->data;
+            im = evas_list_data(buf->priv.pending_writes);
             buf->priv.pending_writes = 
evas_list_remove_list(buf->priv.pending_writes, buf->priv.pending_writes);
             obr = im->extended_info;
             evas_cache_image_drop(im);
@@ -703,6 +690,7 @@
             if (obr->mxob) evas_software_x11_x_output_buffer_free(obr->mxob, 
0);
  */
             free(obr);
+            evas_cache_image_drop(&im->cache_entry);
          }
 #endif 
      }
@@ -720,10 +708,10 @@
        im = buf->priv.onebuf;
        buf->priv.onebuf = NULL;
        obr = im->extended_info;
-       evas_cache_image_drop(im);
        if (obr->xob) evas_software_x11_x_output_buffer_free(obr->xob, 0);
        if (obr->mxob) evas_software_x11_x_output_buffer_free(obr->mxob, 0);
        free(obr);
+       evas_cache_image_drop(&im->cache_entry);
      }
    else
      {
@@ -790,7 +778,7 @@
    if (!conv_func) return;
 
    data = evas_software_x11_x_output_buffer_data(obr->xob, &bpl);
-   src_data = update->image->data;
+   src_data = update->image.data;
    if (buf->rot == 0)
      {
        obr->x = x;



-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to