Evas_Rectangle are gone. We now use Eina_Rectangle and memory pool is

shared accross the application.


SVN revision: 41170
This commit is contained in:
Cedric BAIL 2009-06-23 13:57:27 +00:00
parent 42e610f81b
commit 0c9aead634
20 changed files with 90 additions and 165 deletions

View File

@ -121,7 +121,7 @@ _ecore_evas_buffer_render(Ecore_Evas *ee)
updates = evas_render_updates(ee->evas);
if (ee->engine.buffer.image)
{
Evas_Rectangle *r;
Eina_Rectangle *r;
EINA_LIST_FOREACH(updates, l, r)
if (ee->engine.buffer.image)

View File

@ -141,7 +141,7 @@ _ecore_evas_x_gl_window_new(Ecore_Evas *ee, Ecore_X_Window parent, int x, int y,
static int
_ecore_evas_x_render(Ecore_Evas *ee)
{
Evas_Rectangle *r;
Eina_Rectangle *r;
Eina_List *updates, *l;
int rend = 0;
#ifdef BUILD_ECORE_EVAS_SOFTWARE_BUFFER

View File

@ -32,10 +32,10 @@
*/
typedef struct _Eina_Rectangle
{
int x;
int y;
int w;
int h;
int x; /**< top-left x co-ordinate of rectangle */
int y; /**< top-left y co-ordinate of rectangle */
int w; /**< width of rectangle */
int h; /**< height of rectangle */
} Eina_Rectangle;
typedef struct _Eina_Rectangle_Pool Eina_Rectangle_Pool;
@ -66,13 +66,13 @@ EAPI Eina_Rectangle *eina_rectangle_pool_request(Eina_Rectangle_Pool *pool, int
EAPI void eina_rectangle_pool_release(Eina_Rectangle *rect) EINA_ARG_NONNULL(1);
#define EINA_RECTANGLE_SET(Rectangle, X, Y, W, H) \
Rectangle->x = X; \
Rectangle->y = Y; \
Rectangle->w = W; \
Rectangle->h = H;
(Rectangle)->x = X; \
(Rectangle)->y = Y; \
(Rectangle)->w = W; \
(Rectangle)->h = H;
EAPI Eina_Rectangle *eina_rectangle_new(int x, int y, int w, int h);
EAPI void eina_rectangle_free(Eina_Rectangle *rect);
EAPI Eina_Rectangle *eina_rectangle_new(int x, int y, int w, int h) EINA_MALLOC EINA_WARN_UNUSED_RESULT;
EAPI void eina_rectangle_free(Eina_Rectangle *rect) EINA_ARG_NONNULL(1);
#include "eina_inline_rectangle.x"

View File

@ -405,7 +405,7 @@ eina_rectangle_init(void)
goto init_error;
}
_eina_rectangle_mp = eina_mempool_new(choice, "rectangle", NULL, sizeof (Eina_Rectangle), 42);
_eina_rectangle_mp = eina_mempool_new(choice, "rectangle", NULL, sizeof (Eina_Rectangle), 256);
if (!_eina_rectangle_mp)
{
EINA_ERROR_PERR("ERROR: Mempool for rectangle cannot be allocated in list init.\n");

View File

@ -102,7 +102,6 @@ typedef enum _Evas_Object_Table_Homogeneous_Mode
} Evas_Object_Table_Homogeneous_Mode;
typedef struct _Evas_Transform Evas_Transform; /**< An Evas projective or affine transform */
typedef struct _Evas_Rectangle Evas_Rectangle; /**< A generic rectangle handle */
typedef struct _Evas_Coord_Rectangle Evas_Coord_Rectangle; /**< A generic rectangle handle */
typedef struct _Evas_Smart_Class Evas_Smart_Class; /**< A smart object base class */
@ -126,14 +125,6 @@ struct _Evas_Transform /** An affine or projective coordinate transformation mat
float mzx, mzy, mzz;
};
struct _Evas_Rectangle /** A rectangle */
{
int x; /**< top-left x co-ordinate of rectangle */
int y; /**< top-left y co-ordinate of rectangle */
int w; /**< width of rectangle */
int h; /**< height of rectangle */
};
struct _Evas_Coord_Rectangle /** A rectangle in Evas_Coord */
{
Evas_Coord x; /**< top-left x co-ordinate of rectangle */

View File

@ -4,28 +4,13 @@
static int initcount = 0;
Eina_Mempool *_evas_rectangle_mp = NULL;
EAPI int
evas_init(void)
{
if (initcount == 0)
{
const char *choice;
eina_init();
if (!(choice = getenv("EINA_MEMPOOL")))
choice = "chained_mempool";
_evas_rectangle_mp = eina_mempool_new(choice, "evas_rectangle", NULL,
sizeof (Evas_Rectangle), 256);
if (!_evas_rectangle_mp)
{
EINA_ERROR_PERR("ERROR: Mempool for rectangle cannot be allocated in list init.\n");
abort();
}
evas_module_init();
evas_async_events_init();
#ifdef EVAS_CSERVE
@ -48,8 +33,6 @@ evas_shutdown(void)
evas_font_dir_cache_free();
evas_common_shutdown();
evas_module_shutdown();
eina_mempool_delete(_evas_rectangle_mp);
_evas_rectangle_mp = NULL;
eina_shutdown();
}
return initcount;
@ -119,7 +102,7 @@ evas_new(void)
EAPI void
evas_free(Evas *e)
{
Evas_Rectangle *r;
Eina_Rectangle *r;
Evas_Layer *lay;
int i;
int del;
@ -170,9 +153,9 @@ evas_free(Evas *e)
e->name_hash = NULL;
EINA_LIST_FREE(e->damages, r)
eina_mempool_free(_evas_rectangle_mp, r);
eina_rectangle_free(r);
EINA_LIST_FREE(e->obscures, r)
eina_mempool_free(_evas_rectangle_mp, r);
eina_rectangle_free(r);
evas_fonts_zero_free(e);

View File

@ -1164,7 +1164,7 @@ EAPI void
evas_object_image_data_update_add(Evas_Object *obj, int x, int y, int w, int h)
{
Evas_Object_Image *o;
Evas_Rectangle *r;
Eina_Rectangle *r;
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
return;
@ -2116,7 +2116,7 @@ static void
evas_object_image_free(Evas_Object *obj)
{
Evas_Object_Image *o;
Evas_Rectangle *r;
Eina_Rectangle *r;
/* frees private object data. very simple here */
o = (Evas_Object_Image *)(obj->object_data);
@ -2132,7 +2132,7 @@ evas_object_image_free(Evas_Object *obj)
o->engine_data = NULL;
o->magic = 0;
EINA_LIST_FREE(o->pixel_updates, r)
eina_mempool_free(_evas_rectangle_mp, r);
eina_rectangle_free(r);
free(o);
}
@ -2500,7 +2500,7 @@ evas_object_image_render_pre(Evas_Object *obj)
(o->cur.border.t == 0) &&
(o->cur.border.b == 0))
{
Evas_Rectangle *rr;
Eina_Rectangle *rr;
EINA_LIST_FREE(o->pixel_updates, rr)
{
@ -2525,7 +2525,7 @@ evas_object_image_render_pre(Evas_Object *obj)
w = ((int)(idx + idw)) - x;
while (idy < obj->cur.geometry.h)
{
Evas_Rectangle r;
Eina_Rectangle r;
y = idy;
h = ((int)(idy + idh)) - y;
@ -2542,7 +2542,7 @@ evas_object_image_render_pre(Evas_Object *obj)
idx += idw;
idy = ydy;
}
eina_mempool_free(_evas_rectangle_mp, rr);
eina_rectangle_free(rr);
}
goto done;
}
@ -2550,10 +2550,10 @@ evas_object_image_render_pre(Evas_Object *obj)
{
if (o->pixel_updates)
{
Evas_Rectangle *r;
Eina_Rectangle *r;
EINA_LIST_FREE(o->pixel_updates, r)
eina_mempool_free(_evas_rectangle_mp, r);
eina_rectangle_free(r);
obj->layer->evas->engine.func->image_dirty_region(obj->layer->evas->engine.data.output, o->engine_data, 0, 0, o->cur.image.w, o->cur.image.h);
evas_object_render_pre_prev_cur_add(&obj->layer->evas->clip_changes, obj);
goto done;
@ -2578,7 +2578,7 @@ static void
evas_object_image_render_post(Evas_Object *obj)
{
Evas_Object_Image *o;
Evas_Rectangle *r;
Eina_Rectangle *r;
/* this moves the current data to the previous state parts of the object */
/* in whatever way is safest for the object. also if we don't need object */
@ -2587,7 +2587,7 @@ evas_object_image_render_post(Evas_Object *obj)
/* remove those pesky changes */
evas_object_clip_changes_clean(obj);
EINA_LIST_FREE(o->pixel_updates, r)
eina_mempool_free(_evas_rectangle_mp, r);
eina_rectangle_free(r);
/* move cur to prev safely for object data */
obj->prev = obj->cur;
o->prev = o->cur;

View File

@ -194,17 +194,17 @@ evas_object_render_pre_prev_cur_add(Eina_Array *rects, Evas_Object *obj)
void
evas_object_clip_changes_clean(Evas_Object *obj)
{
Evas_Rectangle *r;
Eina_Rectangle *r;
EINA_LIST_FREE(obj->clip.changes, r)
eina_mempool_free(_evas_rectangle_mp, r);
eina_rectangle_free(r);
}
void
evas_object_render_pre_effect_updates(Eina_Array *rects, Evas_Object *obj, int is_v, int was_v)
{
Evas_Rectangle *r;
Eina_Rectangle *r;
Evas_Object *clipper;
Eina_List *l;
unsigned int i;
@ -288,7 +288,7 @@ evas_object_render_pre_effect_updates(Eina_Array *rects, Evas_Object *obj, int i
end:
EINA_ARRAY_ITER_NEXT(rects, i, r, it)
eina_mempool_free(_evas_rectangle_mp, r);
eina_rectangle_free(r);
eina_array_clean(rects);
}

View File

@ -13,7 +13,7 @@ evas_render_updates_internal(Evas *e, unsigned char make_updates, unsigned char
EAPI void
evas_damage_rectangle_add(Evas *e, int x, int y, int w, int h)
{
Evas_Rectangle *r;
Eina_Rectangle *r;
MAGIC_CHECK(e, Evas, MAGIC_EVAS);
return;
@ -33,7 +33,7 @@ evas_damage_rectangle_add(Evas *e, int x, int y, int w, int h)
EAPI void
evas_obscured_rectangle_add(Evas *e, int x, int y, int w, int h)
{
Evas_Rectangle *r;
Eina_Rectangle *r;
MAGIC_CHECK(e, Evas, MAGIC_EVAS);
return;
@ -52,13 +52,13 @@ evas_obscured_rectangle_add(Evas *e, int x, int y, int w, int h)
EAPI void
evas_obscured_clear(Evas *e)
{
Evas_Rectangle *r;
Eina_Rectangle *r;
MAGIC_CHECK(e, Evas, MAGIC_EVAS);
return;
MAGIC_CHECK_END();
EINA_LIST_FREE(e->obscures, r)
eina_mempool_free(_evas_rectangle_mp, r);
eina_rectangle_free(r);
}
static void
@ -315,7 +315,7 @@ evas_render_updates_internal(Evas *e, unsigned char make_updates, unsigned char
Eina_List *ll;
void *surface;
Eina_Bool clean_them = EINA_FALSE;
Evas_Rectangle *r;
Eina_Rectangle *r;
int ux, uy, uw, uh;
int cx, cy, cw, ch;
unsigned int i, j;
@ -361,7 +361,7 @@ evas_render_updates_internal(Evas *e, unsigned char make_updates, unsigned char
{
e->engine.func->output_redraws_rect_add(e->engine.data.output,
r->x, r->y, r->w, r->h);
eina_mempool_free(_evas_rectangle_mp, r);
eina_rectangle_free(r);
}
/* phase 4. output & viewport changes */
if (e->viewport.changed)
@ -421,7 +421,7 @@ evas_render_updates_internal(Evas *e, unsigned char make_updates, unsigned char
if (make_updates)
{
Evas_Rectangle *rect;
Eina_Rectangle *rect;
NEW_RECT(rect, ux, uy, uw, uh);
if (rect)
@ -597,10 +597,10 @@ evas_render_updates_internal(Evas *e, unsigned char make_updates, unsigned char
EAPI void
evas_render_updates_free(Eina_List *updates)
{
Evas_Rectangle *r;
Eina_Rectangle *r;
EINA_LIST_FREE(updates, r)
eina_mempool_free(_evas_rectangle_mp, r);
eina_rectangle_free(r);
}
/**

View File

@ -103,21 +103,15 @@ _glyph_scanline_mask_transp_solid(DATA16 *dst,
static inline void
_calc_ext(const Soft16_Image *dst, const RGBA_Draw_Context *dc,
Evas_Rectangle *ext)
Eina_Rectangle *ext)
{
ext->x = 0;
ext->y = 0;
ext->w = dst->cache_entry.w;
ext->h = dst->cache_entry.h;
EINA_RECTANGLE_SET(ext, 0, 0, dst->cache_entry.w, dst->cache_entry.h);
if (dc->clip.use)
{
int v;
ext->x = dc->clip.x;
ext->y = dc->clip.y;
ext->w = dc->clip.w;
ext->h = dc->clip.h;
EINA_RECTANGLE_SET(ext, dc->clip.x, dc->clip.y, dc->clip.w, dc->clip.h);
if (ext->x < 0)
{
ext->w += ext->x;
@ -139,7 +133,7 @@ _calc_ext(const Soft16_Image *dst, const RGBA_Draw_Context *dc,
static inline void
_glyph_scanline(Soft16_Image *dst, const DATA8 *p_mask,
const Evas_Rectangle ext, int dx, int dy, int max_x, int max_y,
const Eina_Rectangle ext, int dx, int dy, int max_x, int max_y,
int w, DATA8 alpha, const DATA16 rgb565,
const DATA32 rgb565_unpack)
{
@ -186,7 +180,7 @@ static void
_soft16_font_glyph_draw_grayscale(Soft16_Image *dst,
RGBA_Draw_Context *dc __UNUSED__, RGBA_Font_Glyph *fg __UNUSED__,
int x, int y, DATA8 alpha, DATA16 rgb565,
const Evas_Rectangle ext, int bw, int bh,
const Eina_Rectangle ext, int bw, int bh,
int bpitch, const DATA8 *bitmap)
{
const DATA32 rgb565_unpack = RGB_565_UNPACK(rgb565);
@ -225,7 +219,7 @@ static void
_soft16_font_glyph_draw_mono(Soft16_Image *dst,
RGBA_Draw_Context *dc __UNUSED__, RGBA_Font_Glyph *fg __UNUSED__,
int x, int y, DATA8 alpha, DATA16 rgb565,
const Evas_Rectangle ext, int bw, int bh,
const Eina_Rectangle ext, int bw, int bh,
int bpitch, const DATA8 *bitmap)
{
const DATA32 rgb565_unpack = RGB_565_UNPACK(rgb565);
@ -253,7 +247,7 @@ soft16_font_glyph_draw(void *data, void *dest __UNUSED__, void *context,
const DATA8 *bitmap;
DATA8 alpha, r, g, b;
DATA16 rgb565;
Evas_Rectangle ext;
Eina_Rectangle ext;
int bpitch, bw, bh;
dst = data;

View File

@ -421,9 +421,9 @@ _soft16_image_draw_scaled_mul(Soft16_Image *src, Soft16_Image *dst,
void
soft16_image_draw_scaled_sampled(Soft16_Image *src, Soft16_Image *dst,
RGBA_Draw_Context *dc,
const Evas_Rectangle sr,
const Evas_Rectangle dr,
const Evas_Rectangle cr)
const Eina_Rectangle sr,
const Eina_Rectangle dr,
const Eina_Rectangle cr)
{
int x, y, dst_offset, *offset_x, *offset_y;
DATA16 mul_rgb565;

View File

@ -244,9 +244,9 @@ _soft16_image_draw_unscaled_mul(Soft16_Image *src, Soft16_Image *dst,
void
soft16_image_draw_unscaled(Soft16_Image *src, Soft16_Image *dst,
RGBA_Draw_Context *dc,
const Evas_Rectangle sr,
const Evas_Rectangle dr,
const Evas_Rectangle cr)
const Eina_Rectangle sr,
const Eina_Rectangle dr,
const Eina_Rectangle cr)
{
int src_offset_rows, src_offset, dst_offset;
DATA16 mul_rgb565;

View File

@ -319,14 +319,11 @@ _evas_common_load_soft16_image_data_from_file(Image_Entry *ie)
static inline void
_get_clip(const RGBA_Draw_Context *dc, const Soft16_Image *im,
Evas_Rectangle *clip)
Eina_Rectangle *clip)
{
if (dc->clip.use)
{
clip->x = dc->clip.x;
clip->y = dc->clip.y;
clip->w = dc->clip.w;
clip->h = dc->clip.h;
EINA_RECTANGLE_SET(clip, dc->clip.x, dc->clip.y, dc->clip.w, dc->clip.h);
if (clip->x < 0)
{
clip->w += clip->x;
@ -342,15 +339,12 @@ _get_clip(const RGBA_Draw_Context *dc, const Soft16_Image *im,
}
else
{
clip->x = 0;
clip->y = 0;
clip->w = im->cache_entry.w;
clip->h = im->cache_entry.h;
EINA_RECTANGLE_SET(clip, 0, 0, im->cache_entry.w, im->cache_entry.h);
}
}
static inline int
_is_empty_rectangle(const Evas_Rectangle *r)
_is_empty_rectangle(const Eina_Rectangle *r)
{
return (r->w < 1) || (r->h < 1);
}
@ -373,11 +367,11 @@ _shrink(int *s_pos, int *s_size, int pos, int size)
}
static int
_soft16_adjust_areas(Evas_Rectangle *src,
_soft16_adjust_areas(Eina_Rectangle *src,
int src_max_x, int src_max_y,
Evas_Rectangle *dst,
Eina_Rectangle *dst,
int dst_max_x, int dst_max_y,
Evas_Rectangle *dst_clip)
Eina_Rectangle *dst_clip)
{
if (_is_empty_rectangle(src) ||
_is_empty_rectangle(dst) ||
@ -449,9 +443,9 @@ _soft16_adjust_areas(Evas_Rectangle *src,
static void
_soft16_image_draw_sampled_int(Soft16_Image *src, Soft16_Image *dst,
RGBA_Draw_Context *dc,
Evas_Rectangle sr, Evas_Rectangle dr)
Eina_Rectangle sr, Eina_Rectangle dr)
{
Evas_Rectangle cr;
Eina_Rectangle cr;
if (!(RECTS_INTERSECT(dr.x, dr.y, dr.w, dr.h, 0, 0, dst->cache_entry.w, dst->cache_entry.h)))
return;
@ -477,26 +471,20 @@ soft16_image_draw(Soft16_Image *src, Soft16_Image *dst,
int dst_region_w, int dst_region_h,
int smooth __UNUSED__)
{
Evas_Rectangle sr, dr;
Eina_Rectangle sr, dr;
Cutout_Rects *rects;
Cutout_Rect *r;
struct RGBA_Draw_Context_clip clip_bkp;
int i;
/* handle cutouts here! */
dr.x = dst_region_x;
dr.y = dst_region_y;
dr.w = dst_region_w;
dr.h = dst_region_h;
EINA_RECTANGLE_SET(&dr, dst_region_x, dst_region_y, dst_region_w, dst_region_h);
if (_is_empty_rectangle(&dr)) return;
if (!(RECTS_INTERSECT(dr.x, dr.y, dr.w, dr.h, 0, 0, dst->cache_entry.w, dst->cache_entry.h)))
return;
sr.x = src_region_x;
sr.y = src_region_y;
sr.w = src_region_w;
sr.h = src_region_h;
EINA_RECTANGLE_SET(&sr, src_region_x, src_region_y, src_region_w, src_region_h);
if (_is_empty_rectangle(&sr)) return;
if (!(RECTS_INTERSECT(sr.x, sr.y, sr.w, sr.h, 0, 0, src->cache_entry.w, src->cache_entry.h)))

View File

@ -2,7 +2,7 @@
#include "evas_soft16_scanline_fill.c"
static inline int
_is_empty_rectangle(const Evas_Rectangle *r)
_is_empty_rectangle(const Eina_Rectangle *r)
{
return (r->w < 1) || (r->h < 1);
}
@ -38,7 +38,7 @@ _soft16_rectangle_draw_transp_solid(Soft16_Image *dst, int offset, int w, int h,
static void
_soft16_rectangle_draw_int(Soft16_Image *dst, RGBA_Draw_Context *dc,
Evas_Rectangle dr)
Eina_Rectangle dr)
{
int dst_offset;
@ -80,17 +80,14 @@ void
soft16_rectangle_draw(Soft16_Image *dst, RGBA_Draw_Context *dc,
int x, int y, int w, int h)
{
Evas_Rectangle dr;
Eina_Rectangle dr;
Cutout_Rects *rects;
Cutout_Rect *r;
struct RGBA_Draw_Context_clip c_bkp;
int i;
/* handle cutouts here! */
dr.x = x;
dr.y = y;
dr.w = w;
dr.h = h;
EINA_RECTANGLE_SET(&dr, x, y, w, h);
if (_is_empty_rectangle(&dr)) return;
if (!(RECTS_INTERSECT(dr.x, dr.y, dr.w, dr.h, 0, 0, dst->cache_entry.w, dst->cache_entry.h)))

View File

@ -74,8 +74,8 @@ EAPI Evas_Cache_Image *evas_common_soft16_image_cache_get(void);
EAPI void soft16_image_draw(Soft16_Image *src, Soft16_Image *dst, RGBA_Draw_Context *dc, int src_region_x, int src_region_y, int src_region_w, int src_region_h, int dst_region_x, int dst_region_y, int dst_region_w, int dst_region_h, int smooth);
EAPI Soft16_Image *soft16_image_alpha_set(Soft16_Image *im, int have_alpha);
void soft16_image_draw_unscaled(Soft16_Image *src, Soft16_Image *dst, RGBA_Draw_Context *dc, const Evas_Rectangle sr, const Evas_Rectangle dr, const Evas_Rectangle cr);
void soft16_image_draw_scaled_sampled(Soft16_Image *src, Soft16_Image *dst, RGBA_Draw_Context *dc, const Evas_Rectangle sr, const Evas_Rectangle dr, const Evas_Rectangle cr);
void soft16_image_draw_unscaled(Soft16_Image *src, Soft16_Image *dst, RGBA_Draw_Context *dc, const Eina_Rectangle sr, const Eina_Rectangle dr, const Eina_Rectangle cr);
void soft16_image_draw_scaled_sampled(Soft16_Image *src, Soft16_Image *dst, RGBA_Draw_Context *dc, const Eina_Rectangle sr, const Eina_Rectangle dr, const Eina_Rectangle cr);
/* convert/dither functions */
void soft16_image_convert_from_rgb(Soft16_Image *im, const DATA32 *src);

View File

@ -19,7 +19,7 @@ evas_object_was_visible(Evas_Object *obj)
static inline void
evas_add_rect(Eina_Array *rects, int x, int y, int w, int h)
{
Evas_Rectangle *r;
Eina_Rectangle *r;
NEW_RECT(r, x, y, w, h);
if (r) eina_array_push(rects, r);

View File

@ -48,7 +48,6 @@ typedef struct _Evas_Intercept_Func_Color Evas_Intercept_Func_Color;
typedef struct _Evas_Key_Grab Evas_Key_Grab;
typedef struct _Evas_Callbacks Evas_Callbacks;
typedef struct _Evas_Format Evas_Format;
typedef struct _Evas_Rectangles Evas_Rectangles;
#define MAGIC_EVAS 0x70777770
#define MAGIC_OBJ 0x71777770
@ -84,13 +83,7 @@ MAGIC_CHECK_FAILED(o, t, m)
# define MAGIC_CHECK_END() }}
#endif
#define NEW_RECT(_r, _x, _y, _w, _h) \
{(_r) = (Evas_Rectangle *)eina_mempool_alloc(_evas_rectangle_mp, sizeof(Evas_Rectangle)); \
if (_r) \
{ \
(_r)->x = (_x); (_r)->y = (_y); \
(_r)->w = (_w); (_r)->h = (_h); \
}}
#define NEW_RECT(_r, _x, _y, _w, _h) (_r) = eina_rectangle_new(_x, _y, _w, _h);
#define MERR_NONE() _evas_alloc_error = EVAS_ALLOC_ERROR_NONE
#define MERR_FATAL() _evas_alloc_error = EVAS_ALLOC_ERROR_FATAL
@ -335,13 +328,6 @@ struct _Evas_Layer
unsigned char delete_me : 1;
};
struct _Evas_Rectangles
{
unsigned int total;
unsigned int count;
Evas_Rectangle *array;
};
struct _Evas_Size
{
Evas_Coord w, h;
@ -789,7 +775,6 @@ void _evas_object_text_rehint(Evas_Object *obj);
void _evas_object_textblock_rehint(Evas_Object *obj);
extern int _evas_alloc_error;
extern Eina_Mempool *_evas_rectangle_mp;
struct _Evas_Imaging_Image
{

View File

@ -28,15 +28,6 @@ static IDirectFB *dfb = NULL; /* XXX HACK to work around evas image cache
/***********************************************************************
* Evas helpers
**********************************************************************/
static void
_rect_set(Evas_Rectangle *r, int x, int y, int w, int h)
{
r->x = x;
r->y = y;
r->w = w;
r->h = h;
}
static void
_context_get_color(RGBA_Draw_Context *dc, int *r, int *g, int *b, int *a)
{
@ -1070,7 +1061,7 @@ evas_engine_dfb_font_draw(void *data, void *context, void *surface, void *font,
static void
_cb_draw_line(IDirectFBSurface *surface, RGBA_Draw_Context *dc __UNUSED__, const DFBRegion *region __UNUSED__, void *data)
{
const Evas_Rectangle *r = data;
const Eina_Rectangle *r = data;
surface->DrawLine(surface, r->x, r->y, r->w, r->h); /* x2, y2 really */
}
@ -1079,12 +1070,12 @@ static void
evas_engine_dfb_line_draw(void *data __UNUSED__, void *context, void *surface, int x1, int y1, int x2, int y2)
{
IDirectFBSurface *screen = surface;
Evas_Rectangle r;
Eina_Rectangle r;
if (!_dfb_surface_set_color_from_context(screen, context))
return;
_rect_set(&r, x1, y1, x2, y2); /* x2, y2 (ab)used as w, h */
EINA_RECTANGLE_SET(&r, x1, y1, x2, y2); /* x2, y2 (ab)used as w, h */
_dfb_surface_for_each_cutout(screen, context, _cb_draw_line, &r);
}
@ -1092,7 +1083,7 @@ evas_engine_dfb_line_draw(void *data __UNUSED__, void *context, void *surface, i
static void
_cb_draw_rectangle(IDirectFBSurface *surface, RGBA_Draw_Context *dc __UNUSED__, const DFBRegion *region __UNUSED__, void *data)
{
const Evas_Rectangle *r = data;
const Eina_Rectangle *r = data;
surface->FillRectangle(surface, r->x, r->y, r->w, r->h);
}
@ -1101,12 +1092,12 @@ static void
evas_engine_dfb_rectangle_draw(void *data __UNUSED__, void *context, void *surface, int x, int y, int w, int h)
{
IDirectFBSurface *screen = surface;
Evas_Rectangle r;
Eina_Rectangle r;
if (!_dfb_surface_set_color_from_context(screen, context))
return;
_rect_set(&r, x, y, w, h);
EINA_RECTANGLE_SET(&r, x, y, w, h);
_dfb_surface_for_each_cutout(screen, context, _cb_draw_rectangle, &r);
}
#else

View File

@ -395,14 +395,12 @@ evas_software_xcb_outbuf_new_region_for_update(Outbuf *buf,
if ((buf->onebuf) && (buf->priv.x11.xcb.shm))
{
Evas_Rectangle *rect;
Eina_Rectangle *rect;
rect = malloc(sizeof(Evas_Rectangle));
RECTS_CLIP_TO_RECT(x, y, w, h, 0, 0, buf->w, buf->h);
rect->x = x;
rect->y = y;
rect->w = w;
rect->h = h;
rect = eina_rectangle_new(x, y, w, h);
if (!rect) return NULL;
buf->priv.onebuf_regions = eina_list_append(buf->priv.onebuf_regions, rect);
if (buf->priv.onebuf)
{
@ -617,7 +615,7 @@ evas_software_xcb_outbuf_flush(Outbuf *buf)
pixman_region_init(&tmpr);
while (buf->priv.onebuf_regions)
{
Evas_Rectangle *rect;
Eina_Rectangle *rect;
rect = buf->priv.onebuf_regions->data;
buf->priv.onebuf_regions = eina_list_remove_list(buf->priv.onebuf_regions, buf->priv.onebuf_regions);
@ -627,7 +625,7 @@ evas_software_xcb_outbuf_flush(Outbuf *buf)
if (buf->priv.debug)
evas_software_xcb_outbuf_debug_show(buf, buf->priv.x11.xcb.win,
rect->x, rect->y, rect->w, rect->h);
free(rect);
eina_rectangle_free(rect);
}
xcb_set_clip_rectangles(buf->priv.x11.xcb.conn, XCB_CLIP_ORDERING_YX_BANDED,
buf->priv.x11.xcb.gc,

View File

@ -345,14 +345,12 @@ evas_software_xlib_outbuf_new_region_for_update(Outbuf *buf, int x, int y, int w
if ((buf->onebuf) && (buf->priv.x11.xlib.shm))
{
Evas_Rectangle *rect;
Eina_Rectangle *rect;
rect = malloc(sizeof(Evas_Rectangle));
RECTS_CLIP_TO_RECT(x, y, w, h, 0, 0, buf->w, buf->h);
rect->x = x;
rect->y = y;
rect->w = w;
rect->h = h;
rect = eina_rectangle_new(x, y, w, h);
if (!rect) return NULL;
buf->priv.onebuf_regions = eina_list_append(buf->priv.onebuf_regions, rect);
if (buf->priv.onebuf)
{
@ -613,7 +611,7 @@ evas_software_xlib_outbuf_flush(Outbuf *buf)
tmpr = XCreateRegion();
while (buf->priv.onebuf_regions)
{
Evas_Rectangle *rect;
Eina_Rectangle *rect;
XRectangle xr;
rect = buf->priv.onebuf_regions->data;
@ -626,7 +624,7 @@ evas_software_xlib_outbuf_flush(Outbuf *buf)
if (buf->priv.debug)
evas_software_xlib_outbuf_debug_show(buf, buf->priv.x11.xlib.win,
rect->x, rect->y, rect->w, rect->h);
free(rect);
eina_rectangle_free(rect);
}
XSetRegion(buf->priv.x11.xlib.disp, buf->priv.x11.xlib.gc, tmpr);
evas_software_xlib_x_output_buffer_paste(obr->xob, buf->priv.x11.xlib.win,