and support obscured rects for clip-out if middle of bordered image set to

solid. speedup.



SVN revision: 39051
This commit is contained in:
Carsten Haitzler 2009-02-17 04:53:03 +00:00
parent a66c46264c
commit 9062c9050a
12 changed files with 94 additions and 25 deletions

View File

@ -75,6 +75,8 @@ static const Evas_Object_Func object_func =
evas_object_gradient_was_opaque,
NULL,
NULL,
NULL,
NULL,
NULL
};

View File

@ -61,6 +61,8 @@ static const Evas_Object_Func object_func =
NULL,
NULL,
NULL,
NULL,
NULL,
NULL
};

View File

@ -61,6 +61,8 @@ static const Evas_Object_Func rg_object_func =
NULL,
NULL,
NULL,
NULL,
NULL,
NULL
};

View File

@ -80,6 +80,8 @@ static void *evas_object_image_engine_data_get(Evas_Object *obj);
static int evas_object_image_is_opaque(Evas_Object *obj);
static int evas_object_image_was_opaque(Evas_Object *obj);
static int evas_object_image_is_inside(Evas_Object *obj, Evas_Coord x, Evas_Coord y);
static int evas_object_image_has_opaque_rect(Evas_Object *obj);
static int evas_object_image_get_opaque_rect(Evas_Object *obj, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h);
static void *evas_object_image_data_convert_internal(Evas_Object_Image *o, void *data, Evas_Colorspace to_cspace);
static void evas_object_image_filled_resize_listener(void *data, Evas *e, Evas_Object *obj, void *einfo);
@ -104,7 +106,9 @@ static const Evas_Object_Func object_func =
evas_object_image_is_inside,
NULL,
NULL,
NULL
NULL,
evas_object_image_has_opaque_rect,
evas_object_image_get_opaque_rect
};
/**
@ -2687,6 +2691,38 @@ evas_object_image_is_inside(Evas_Object *obj, Evas_Coord x, Evas_Coord y)
return (a != 0);
}
static int
evas_object_image_has_opaque_rect(Evas_Object *obj)
{
Evas_Object_Image *o;
o = (Evas_Object_Image *)(obj->object_data);
if (((o->cur.border.l | o->cur.border.r | o->cur.border.t | o->cur.border.b) != 0) &&
(o->cur.border.fill == EVAS_BORDER_FILL_SOLID) &&
(obj->cur.render_op == EVAS_RENDER_BLEND) &&
(obj->cur.cache.clip.a == 255) &&
(o->cur.fill.x == 0) &&
(o->cur.fill.y == 0) &&
(o->cur.fill.w == obj->cur.geometry.w) &&
(o->cur.fill.h == obj->cur.geometry.h)
) return 1;
return 0;
}
static int
evas_object_image_get_opaque_rect(Evas_Object *obj, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h)
{
Evas_Object_Image *o;
o = (Evas_Object_Image *)(obj->object_data);
*x = obj->cur.geometry.x + o->cur.border.l;
*y = obj->cur.geometry.y + o->cur.border.t;
*w = obj->cur.geometry.w - (o->cur.border.l + o->cur.border.r);
if (*w < 0) *w = 0;
*h = obj->cur.geometry.h - (o->cur.border.t + o->cur.border.b);
if (*h < 0) *h = 0;
}
static void *
evas_object_image_data_convert_internal(Evas_Object_Image *o, void *data, Evas_Colorspace to_cspace)
{

View File

@ -63,6 +63,8 @@ static const Evas_Object_Func object_func =
evas_object_line_is_inside,
evas_object_line_was_inside,
evas_object_line_coords_recalc,
NULL,
NULL,
NULL
};

View File

@ -60,6 +60,8 @@ static const Evas_Object_Func object_func =
evas_object_polygon_is_inside,
evas_object_polygon_was_inside,
NULL,
NULL,
NULL,
NULL
};

View File

@ -57,6 +57,8 @@ static const Evas_Object_Func object_func =
NULL,
NULL,
NULL,
NULL,
NULL,
NULL
};

View File

@ -57,6 +57,8 @@ static const Evas_Object_Func object_func =
NULL,
NULL,
NULL,
NULL,
NULL,
NULL
};

View File

@ -72,7 +72,9 @@ static const Evas_Object_Func object_func =
NULL,
NULL,
NULL,
evas_object_text_scale_update
evas_object_text_scale_update,
NULL,
NULL
};
/* the actual api call to add a rect */

View File

@ -175,7 +175,9 @@ static const Evas_Object_Func object_func =
NULL,
NULL,
evas_object_textblock_coords_recalc,
evas_object_textblock_scale_update
evas_object_textblock_scale_update,
NULL,
NULL
};
/* the actual api call to add a textblock */

View File

@ -400,7 +400,9 @@ evas_render_updates_internal(Evas *e, unsigned char make_updates, unsigned char
Evas_Object *obj;
obj = eina_array_data_get(&e->active_objects, i);
if (UNLIKELY(evas_object_is_opaque(obj) &&
if (UNLIKELY((evas_object_is_opaque(obj) ||
((obj->func->has_opaque_rect) &&
(obj->func->has_opaque_rect(obj)))) &&
evas_object_is_visible(obj) &&
(!obj->clip.clipees) &&
(obj->cur.visible) &&
@ -476,21 +478,6 @@ evas_render_updates_internal(Evas *e, unsigned char make_updates, unsigned char
obj->cur.cache.clip.h);
if ((w > 0) && (h > 0))
{
/// printf("CLIP: %p | %i %i, %ix%i | %p %i %i %ix%i\n",
/// obj,
/// x, y, w, h,
/// obj->cur.clipper,
/// obj->cur.cache.clip.x + off_x,
/// obj->cur.cache.clip.y + off_y,
/// obj->cur.cache.clip.w,
/// obj->cur.cache.clip.h
/// );
/// if (((obj->cur.cache.clip.x + off_x) == 0) &&
/// ((obj->cur.cache.clip.w) == 960))
/// {
/// abort();
/// }
e->engine.func->context_clip_set(e->engine.data.output,
e->engine.data.context,
x, y, w, h);
@ -500,12 +487,37 @@ evas_render_updates_internal(Evas *e, unsigned char make_updates, unsigned char
Evas_Object *obj2;
obj2 = (Evas_Object *) eina_array_data_get(&e->temporary_objects, j);
e->engine.func->context_cutout_add(e->engine.data.output,
e->engine.data.context,
obj2->cur.cache.clip.x + off_x,
obj2->cur.cache.clip.y + off_y,
obj2->cur.cache.clip.w,
obj2->cur.cache.clip.h);
if (evas_object_is_opaque(obj2))
e->engine.func->context_cutout_add(e->engine.data.output,
e->engine.data.context,
obj2->cur.cache.clip.x + off_x,
obj2->cur.cache.clip.y + off_y,
obj2->cur.cache.clip.w,
obj2->cur.cache.clip.h);
else
{
if (obj2->func->get_opaque_rect)
{
Evas_Coord obx, oby, obw, obh;
obj2->func->get_opaque_rect
(obj2, &obx, &oby, &obw, &obh);
if ((obw > 0) && (obh > 0))
{
obx += off_x;
oby += off_y;
RECTS_CLIP_TO_RECT(obx, oby, obw, obh,
obj2->cur.cache.clip.x + off_x,
obj2->cur.cache.clip.y + off_y,
obj2->cur.cache.clip.w,
obj2->cur.cache.clip.h);
e->engine.func->context_cutout_add(e->engine.data.output,
e->engine.data.context,
obx, oby,
obw, obh);
}
}
}
}
#endif
obj->func->render(obj,

View File

@ -531,6 +531,9 @@ struct _Evas_Object_Func
void (*coords_recalc) (Evas_Object *obj);
void (*scale_update) (Evas_Object *obj);
int (*has_opaque_rect) (Evas_Object *obj);
int (*get_opaque_rect) (Evas_Object *obj, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h);
};
struct _Evas_Func