Enlightenment CVS committal Author : raster Project : e17 Module : libs/evas
Dir : e17/libs/evas/src/modules/engines/buffer Modified Files: evas_engine.h evas_outbuf.c Log Message: cedric's cache changes patch =================================================================== RCS file: /cvs/e/e17/libs/evas/src/modules/engines/buffer/evas_engine.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -3 -r1.3 -r1.4 --- evas_engine.h 2 Apr 2006 07:47:31 -0000 1.3 +++ evas_engine.h 12 Apr 2008 00:32:26 -0000 1.4 @@ -19,15 +19,15 @@ struct _Outbuf { - int w, h; - Outbuf_Depth depth; + int w, h; + Outbuf_Depth depth; - void *dest; - int dest_row_bytes; + void *dest; + int dest_row_bytes; - int alpha_level; - DATA32 color_key; - char use_color_key : 1; + int alpha_level; + DATA32 color_key; + char use_color_key : 1; struct { void * (*new_update_region) (int x, int y, int w, int h, int *row_bytes); @@ -35,7 +35,7 @@ } func; struct { - RGBA_Image *back_buf; + RGBA_Image *back_buf; } priv; }; =================================================================== RCS file: /cvs/e/e17/libs/evas/src/modules/engines/buffer/evas_outbuf.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -3 -r1.12 -r1.13 --- evas_outbuf.c 20 Jan 2008 04:15:31 -0000 1.12 +++ evas_outbuf.c 12 Apr 2008 00:32:26 -0000 1.13 @@ -12,7 +12,7 @@ { if (buf->priv.back_buf) { - evas_common_image_delete(buf->priv.back_buf); + evas_cache_image_drop(&buf->priv.back_buf->cache_entry); } free(buf); } @@ -48,29 +48,25 @@ if ((buf->depth == OUTBUF_DEPTH_RGB_24BPP_888_888) || (buf->depth == OUTBUF_DEPTH_BGR_24BPP_888_888)) bpp = 3; + if ((buf->depth == OUTBUF_DEPTH_ARGB_32BPP_8888_8888) && (buf->dest) && (buf->dest_row_bytes == (buf->w * sizeof(DATA32)))) { for (y = 0; y < h; y++) memset(((unsigned char *)(buf->dest)) + (y * buf->dest_row_bytes), 0, w * bpp); - buf->priv.back_buf = evas_common_image_new(); - buf->priv.back_buf->image = evas_common_image_surface_new(buf->priv.back_buf); - buf->priv.back_buf->image->w = w; - buf->priv.back_buf->image->h = h; - buf->priv.back_buf->image->data = buf->dest; - buf->priv.back_buf->image->no_free = 1; - buf->priv.back_buf->flags |= RGBA_IMAGE_HAS_ALPHA; + buf->priv.back_buf = (RGBA_Image *) evas_cache_image_data(evas_common_image_cache_get(), + w, h, + buf->dest, + 1, EVAS_COLORSPACE_ARGB8888); } else if ((buf->depth == OUTBUF_DEPTH_RGB_32BPP_888_8888) && (buf->dest) && (buf->dest_row_bytes == (buf->w * sizeof(DATA32)))) { - buf->priv.back_buf = evas_common_image_new(); - buf->priv.back_buf->image = evas_common_image_surface_new(buf->priv.back_buf); - buf->priv.back_buf->image->w = w; - buf->priv.back_buf->image->h = h; - buf->priv.back_buf->image->data = buf->dest; - buf->priv.back_buf->image->no_free = 1; + buf->priv.back_buf = (RGBA_Image *) evas_cache_image_data(evas_common_image_cache_get(), + w, h, + buf->dest, + 0, EVAS_COLORSPACE_ARGB8888); } return buf; @@ -88,13 +84,13 @@ if (buf->priv.back_buf->flags & RGBA_IMAGE_HAS_ALPHA) { int ww = w; - ptr = buf->priv.back_buf->image->data + (y * buf->priv.back_buf->image->w) + x; + ptr = buf->priv.back_buf->image.data + (y * buf->priv.back_buf->cache_entry.w) + x; while (h--) { while (w--) *ptr++ = 0; w = ww; - ptr += (buf->priv.back_buf->image->w - w); + ptr += (buf->priv.back_buf->cache_entry.w - w); } } return buf->priv.back_buf; @@ -102,16 +98,20 @@ else { *cx = 0; *cy = 0; *cw = w; *ch = h; - im = evas_common_image_create(w, h); - if (im) - { + im = (RGBA_Image *) evas_cache_image_empty(evas_common_image_cache_get()); + if (im) + { if (((buf->depth == OUTBUF_DEPTH_ARGB_32BPP_8888_8888)) || ((buf->depth == OUTBUF_DEPTH_BGRA_32BPP_8888_8888))) { im->flags |= RGBA_IMAGE_HAS_ALPHA; - memset(im->image->data, 0, w * h * sizeof(DATA32)); - } - } + im = (RGBA_Image *) evas_cache_image_size_set(&im->cache_entry, w, h); + if (im) + { + memset(im->image.data, 0, w * h * sizeof(DATA32)); + } + } + } } return im; } @@ -119,7 +119,7 @@ void evas_buffer_outbuf_buf_free_region_for_update(Outbuf *buf, RGBA_Image *update) { - if (update != buf->priv.back_buf) evas_common_image_delete(update); + if (update != buf->priv.back_buf) evas_cache_image_drop(&update->cache_entry); } void @@ -153,7 +153,7 @@ for (yy = 0; yy < h; yy++) { dst = dest + (yy * row_bytes); - src = update->image->data + (yy * update->image->w); + src = update->image.data + (yy * update->cache_entry.w); for (xx = 0; xx < w; xx++) { if (A_VAL(src) > thresh) @@ -177,7 +177,7 @@ for (yy = 0; yy < h; yy++) { dst = dest + (yy * row_bytes); - src = update->image->data + (yy * update->image->w); + src = update->image.data + (yy * update->cache_entry.w); for (xx = 0; xx < w; xx++) { *dst++ = R_VAL(src); @@ -218,7 +218,7 @@ for (yy = 0; yy < h; yy++) { dst = dest + (yy * row_bytes); - src = update->image->data + (yy * update->image->w); + src = update->image.data + (yy * update->cache_entry.w); for (xx = 0; xx < w; xx++) { if (A_VAL(src) > thresh) @@ -242,7 +242,7 @@ for (yy = 0; yy < h; yy++) { dst = dest + (yy * row_bytes); - src = update->image->data + (yy * update->image->w); + src = update->image.data + (yy * update->cache_entry.w); for (xx = 0; xx < w; xx++) { *dst++ = B_VAL(src); @@ -280,7 +280,7 @@ { for (yy = 0; yy < h; yy++) { - src = update->image->data + (yy * update->image->w); + src = update->image.data + (yy * update->cache_entry.w); dst = (DATA8 *)(buf->dest) + ((y + yy) * row_bytes); func(src, dst, w); } @@ -308,7 +308,7 @@ for (yy = 0; yy < h; yy++) { dst = dest + (yy * row_bytes); - src = update->image->data + (yy * update->image->w); + src = update->image.data + (yy * update->cache_entry.w); for (xx = 0; xx < w; xx++) { A_VAL(dst) = B_VAL(src); @@ -339,7 +339,7 @@ for (yy = 0; yy < h; yy++) { dst = dest + (yy * row_bytes); - src = update->image->data + (yy * update->image->w); + src = update->image.data + (yy * update->cache_entry.w); for (xx = 0; xx < w; xx++) { A_VAL(dst) = B_VAL(src); ------------------------------------------------------------------------- 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