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);
evas_object_image_is_inside,
NULL,
NULL,
- NULL
+ NULL,
+ evas_object_image_has_opaque_rect,
+ evas_object_image_get_opaque_rect
};
/**
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)
{
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) &&
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);
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,