Enlightenment CVS committal
Author : raster
Project : e17
Module : libs/evas
Dir : e17/libs/evas/src/modules/engines/xrender_xcb
Modified Files:
evas_engine.c evas_engine_font.c evas_engine_gradient.c
evas_engine_image.c
Log Message:
cedric's cache changes patch
===================================================================
RCS file: /cvs/e/e17/libs/evas/src/modules/engines/xrender_xcb/evas_engine.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -3 -r1.14 -r1.15
--- evas_engine.c 17 Jun 2007 03:02:22 -0000 1.14
+++ evas_engine.c 12 Apr 2008 00:32:29 -0000 1.15
@@ -761,35 +761,31 @@
static void
eng_font_draw(void *data, void *context, void *surface, void *font, int x, int
y, int w, int h, int ow, int oh, const char *text)
{
- Render_Engine *re;
+ Render_Engine *re;
+ RGBA_Image *im;
re = (Render_Engine *)data;
- {
- static RGBA_Image *im = NULL;
- if (!im)
- {
- im = evas_common_image_new();
- im->image = evas_common_image_surface_new(im);
- im->image->no_free = 1;
- }
- im->image->w = ((Xcb_Render_Surface *)surface)->w;
- im->image->h = ((Xcb_Render_Surface *)surface)->h;
- _xr_render_surface_clips_set((Xcb_Render_Surface *)surface,
(RGBA_Draw_Context *)context, x, y, w, h);
- im->image->data = surface;
- evas_common_draw_context_font_ext_set(context,
- re->xcbinf,
- _xre_font_surface_new,
- _xre_font_surface_free,
- _xre_font_surface_draw);
- evas_common_font_draw(im, context, font, x, y, text);
- evas_common_draw_context_font_ext_set(context,
- NULL,
- NULL,
- NULL,
- NULL);
- evas_common_cpu_end_opt();
- }
+ im = (RGBA_Image *) evas_cache_image_data(evas_common_image_cache_get(),
+ ((Xcb_Render_Surface
*)surface)->w,
+ ((Xcb_Render_Surface
*)surface)->h,
+ surface,
+ 0, EVAS_COLORSPACE_ARGB8888);
+
+ _xr_render_surface_clips_set((Xcb_Render_Surface *)surface,
(RGBA_Draw_Context *)context, x, y, w, h);
+
+ evas_common_draw_context_font_ext_set(context,
+ re->xcbinf,
+ _xre_font_surface_new,
+ _xre_font_surface_free,
+ _xre_font_surface_draw);
+ evas_common_font_draw(im, context, font, x, y, text);
+ evas_common_draw_context_font_ext_set(context,
+ NULL,
+ NULL,
+ NULL,
+ NULL);
+ evas_common_cpu_end_opt();
}
/* module advertising code */
===================================================================
RCS file:
/cvs/e/e17/libs/evas/src/modules/engines/xrender_xcb/evas_engine_font.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -3 -r1.5 -r1.6
--- evas_engine_font.c 8 Feb 2008 20:42:10 -0000 1.5
+++ evas_engine_font.c 12 Apr 2008 00:32:29 -0000 1.6
@@ -167,7 +167,7 @@
fs = fg->ext_dat;
if (!fs) return;
- target_surface = (Xcb_Render_Surface *)(surface->image->data);
+ target_surface = (Xcb_Render_Surface *)(surface->image.data);
a = (dc->col.col >> 24) & 0xff;
r = (dc->col.col >> 16) & 0xff;
g = (dc->col.col >> 8 ) & 0xff;
===================================================================
RCS file:
/cvs/e/e17/libs/evas/src/modules/engines/xrender_xcb/evas_engine_gradient.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -3 -r1.5 -r1.6
--- evas_engine_gradient.c 1 Oct 2006 18:26:47 -0000 1.5
+++ evas_engine_gradient.c 12 Apr 2008 00:32:29 -0000 1.6
@@ -159,18 +159,19 @@
int op = dc->render_op, cuse = dc->clip.use;
RGBA_Image *im;
- im = evas_common_image_create(w, h);
- if (!im)
+ im = (RGBA_Image*)
evas_cache_image_empty(evas_common_image_cache_get());
+ if (!im)
{
_xr_render_surface_free(gr->surface);
gr->surface = NULL;
return;
}
+ evas_cache_image_surface_alloc(&im->cache_entry, w, h);
dc->render_op = _EVAS_RENDER_FILL;
dc->clip.use = 0;
evas_common_gradient_draw(im, dc, 0, 0, w, h, gr->grad);
- _xr_render_surface_argb_pixels_fill(gr->surface, w, h, im->image->data,
0, 0, w, h);
- evas_common_image_free(im);
+ _xr_render_surface_argb_pixels_fill(gr->surface, w, h, im->image.data,
0, 0, w, h);
+ evas_cache_image_drop(&im->cache_entry);
dc->render_op = op;
dc->clip.use = cuse;
}
===================================================================
RCS file:
/cvs/e/e17/libs/evas/src/modules/engines/xrender_xcb/evas_engine_image.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -3 -r1.10 -r1.11
--- evas_engine_image.c 16 Jul 2007 07:25:35 -0000 1.10
+++ evas_engine_image.c 12 Apr 2008 00:32:29 -0000 1.11
@@ -105,8 +105,8 @@
im->fkey = strdup(buf);
im->file = (char *)evas_stringshare_add(file);
if (key) im->key = (char *)evas_stringshare_add(key);
- im->w = im->im->image->w;
- im->h = im->im->image->h;
+ im->w = im->im->cache_entry.w;
+ im->h = im->im->cache_entry.h;
im->references = 1;
if (lo) im->load_opts = *lo;
if (im->im->info.comment) im->comment = (char
*)evas_stringshare_add(im->im->info.comment);
@@ -199,7 +199,7 @@
if (im->file) evas_stringshare_del(im->file);
if (im->key) evas_stringshare_del(im->key);
if (im->fkey) free(im->fkey);
- if (im->im) evas_cache_image_drop(im->im);
+ if (im->im) evas_cache_image_drop(&im->im->cache_entry);
if ((im->data) && (im->dirty)) __xre_image_dirty_hash_del(im);
if ((im->free_data) && (im->data)) free(im->data);
if (im->surface) _xr_render_surface_free(im->surface);
@@ -263,8 +263,8 @@
if (!im->im) im->im = evas_common_load_image_from_file(im->file,
im->key, &(im->load_opts));
if (im->im)
{
- evas_common_load_image_data_from_file(im->im);
- data = im->im->image->data;
+ evas_cache_image_load_data(&im->im->cache_entry);
+ data = im->im->image.data;
}
}
if (!data) return NULL;
@@ -272,7 +272,7 @@
if (im2) im2->alpha = im->alpha;
if ((im->im) && (!im->dirty))
{
- evas_cache_image_drop(im->im);
+ evas_cache_image_drop(&im->im->cache_entry);
im->im = NULL;
}
return im2;
@@ -337,7 +337,7 @@
RGBA_Image *im_old;
im_old = im->im;
- im->im = evas_cache_image_empty(evas_common_image_cache_get());
+ im->im = (RGBA_Image*)
evas_cache_image_empty(evas_common_image_cache_get());
if (!im->im)
{
im->im = im_old;
@@ -348,11 +348,8 @@
}
return;
}
- im->im->image->w = w;
- im->im->image->h = h;
- evas_common_image_surface_alloc(im->im->image);
- evas_common_load_image_data_from_file(im_old);
- if (im_old->image->data)
+ evas_cache_image_load_data(&im->im->cache_entry);
+ if (im_old->image.data)
{
int x = 0, y = 0, ww, hh;
@@ -363,11 +360,11 @@
}
im->free_data = 1;
/* FIXME: Hum ? */
- im->data = im->im->image->data;
- im->im->image->data = NULL;
- evas_cache_image_drop(im->im);
+ im->data = im->im->image.data;
+ im->im->image.data = NULL;
+ evas_cache_image_drop(&im->im->cache_entry);
im->im = NULL;
- evas_cache_image_drop(im_old);
+ evas_cache_image_drop(&im_old->cache_entry);
__xre_image_dirty_hash_add(im);
}
else
@@ -391,8 +388,8 @@
if (!im->im) im->im = evas_common_load_image_from_file(im->file,
im->key, &(im->load_opts));
if (im->im)
{
- evas_common_load_image_data_from_file(im->im);
- data = im->im->image->data;
+ evas_cache_image_load_data(&im->im->cache_entry);
+ data = im->im->image.data;
}
}
return data;
@@ -426,11 +423,11 @@
}
else
{
- if (im->im) imdata = im->im->image->data;
+ if (im->im) imdata = im->im->image.data;
if (data == imdata) return;
if (im->im)
{
- evas_cache_image_drop(im->im);
+ evas_cache_image_drop(&im->im->cache_entry);
im->im = NULL;
}
}
@@ -525,8 +522,8 @@
if (!im->im) im->im = evas_common_load_image_from_file(im->file,
im->key, &(im->load_opts));
if (im->im)
{
- evas_common_load_image_data_from_file(im->im);
- data = im->im->image->data;
+ evas_cache_image_load_data(&im->im->cache_entry);
+ data = im->im->image.data;
}
}
if (!data) return;
@@ -584,7 +581,7 @@
1, 1);
if ((im->im) && (!im->dirty))
{
- evas_cache_image_drop(im->im);
+ evas_cache_image_drop(&im->im->cache_entry);
im->im = NULL;
}
}
-------------------------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs