evas_object_image_is_opaque(Evas_Object *obj)
{
Evas_Object_Image *o;
+ int v;
/* this returns 1 if the internal object data implies that the object is */
/* currently fully opaque over the entire rectangle it occupies */
o = (Evas_Object_Image *)(obj->object_data);
+ if (o->cur.has_alpha) return 0;
+ v = (!!!o->cur.fill.w) + (!!!o->cur.fill.h);
+ if (v) return 0;
+ if (!o->engine_data) return 0;
+ v = o->cur.border.l + o->cur.border.r + o->cur.border.t + o->cur.border.b;
+ v += !o->cur.border.fill;
+ if (v > 0) return 0;
+ if (obj->cur.render_op == EVAS_RENDER_COPY) return 1;
+ if (obj->cur.render_op != EVAS_RENDER_BLEND) return 0;
+ return 1;
+/*
if ((o->cur.fill.w < 1) || (o->cur.fill.h < 1))
return 0;
if (((o->cur.border.l != 0) ||
(o->cur.border.b != 0)) &&
(!o->cur.border.fill)) return 0;
if (!o->engine_data) return 0;
- if (obj->cur.render_op == EVAS_RENDER_COPY)
- return 1;
+ if (obj->cur.render_op == EVAS_RENDER_COPY) return 1;
if (o->cur.has_alpha) return 0;
- if (obj->cur.render_op != EVAS_RENDER_BLEND)
- return 0;
return 1;
+ */
}
static int
{
Cutout_Rect* rect;
- if (rects->max < (rects->active + 1))
+ rects->active++;
+ if (rects->max < rects->active)
{
- rects->max += 32;
+ rects->max += 1024;
rects->rects = realloc(rects->rects, sizeof(Cutout_Rect) * rects->max);
}
-
- rect = rects->rects + rects->active;
+ rect = rects->rects + rects->active - 1;
rect->x = x;
rect->y = y;
rect->w = w;
rect->h = h;
- rects->active++;
return rect;
}
{
if (dc->clip.use)
{
+#if 1 // this is a bit faster
+ int xa1, xa2, xb1, xb2;
+
+ xa1 = x;
+ xa2 = xa1 + w - 1;
+ xb1 = dc->clip.x;
+ if (xa2 < xb1) return;
+ xb2 = xb1 + dc->clip.w - 1;
+ if (xa1 >= xb2) return;
+ if (xa2 > xb2) xa2 = xb2;
+ if (xb1 > xa1) xa1 = xb1;
+ x = xa1;
+ w = xa2 - xa1 + 1;
+
+ xa1 = y;
+ xa2 = xa1 + h - 1;
+ xb1 = dc->clip.y;
+ if (xa2 < xb1) return;
+ xb2 = xb1 + dc->clip.h - 1;
+ if (xa1 >= xb2) return;
+ if (xa2 > xb2) xa2 = xb2;
+ if (xb1 > xa1) xa1 = xb1;
+ y = xa1;
+ h = xa2 - xa1 + 1;
+#else
RECTS_CLIP_TO_RECT(x, y, w, h,
dc->clip.x, dc->clip.y, dc->clip.w, dc->clip.h);
+#endif
if ((w < 1) || (h < 1)) return;
}
evas_common_draw_context_cutouts_add(&dc->cutout, x, y, w, h);
static void
eng_output_tile_size_set(void *data, int w __UNUSED__, int h __UNUSED__)
{
- Render_Engine *re;
-
- re = (Render_Engine *)data;
+// Render_Engine *re;
+//
+// re = (Render_Engine *)data;
}
static void
static void
eng_output_redraws_rect_del(void *data, int x __UNUSED__, int y __UNUSED__, int w __UNUSED__, int h __UNUSED__)
{
- Render_Engine *re;
-
- re = (Render_Engine *)data;
+// Render_Engine *re;
+//
+// re = (Render_Engine *)data;
}
static void
static void
eng_output_idle_flush(void *data)
{
- Render_Engine *re;
-
- re = (Render_Engine *)data;
+// Render_Engine *re;
+//
+// re = (Render_Engine *)data;
}
static void
eng_context_cutout_add(void *data, void *context, int x, int y, int w, int h)
{
- Render_Engine *re;
-
- re = (Render_Engine *)data;
- re->win->gl_context->dc = context;
+// Render_Engine *re;
+//
+// re = (Render_Engine *)data;
+// re->win->gl_context->dc = context;
evas_common_draw_context_add_cutout(context, x, y, w, h);
}
static void
eng_context_cutout_clear(void *data, void *context)
{
- Render_Engine *re;
-
- re = (Render_Engine *)data;
- re->win->gl_context->dc = context;
+// Render_Engine *re;
+//
+// re = (Render_Engine *)data;
+// re->win->gl_context->dc = context;
evas_common_draw_context_clear_cutouts(context);
}
static int
eng_image_alpha_get(void *data, void *image)
{
- Render_Engine *re;
+// Render_Engine *re;
Evas_GL_Image *im;
- re = (Render_Engine *)data;
+// re = (Render_Engine *)data;
if (!image) return 1;
im = image;
/* FIXME: can move to gl_common */
static int
eng_image_colorspace_get(void *data, void *image)
{
- Render_Engine *re;
+// Render_Engine *re;
Evas_GL_Image *im;
- re = (Render_Engine *)data;
+// re = (Render_Engine *)data;
if (!image) return EVAS_COLORSPACE_ARGB8888;
im = image;
return im->cs.space;
static void *
eng_image_border_set(void *data, void *image, int l __UNUSED__, int r __UNUSED__, int t __UNUSED__, int b __UNUSED__)
{
- Render_Engine *re;
-
- re = (Render_Engine *)data;
+// Render_Engine *re;
+//
+// re = (Render_Engine *)data;
return image;
}
static void
eng_image_border_get(void *data, void *image __UNUSED__, int *l __UNUSED__, int *r __UNUSED__, int *t __UNUSED__, int *b __UNUSED__)
{
- Render_Engine *re;
-
- re = (Render_Engine *)data;
+// Render_Engine *re;
+//
+// re = (Render_Engine *)data;
}
static char *
eng_image_comment_get(void *data, void *image, char *key __UNUSED__)
{
- Render_Engine *re;
+// Render_Engine *re;
Evas_GL_Image *im;
- re = (Render_Engine *)data;
+// re = (Render_Engine *)data;
if (!image) return NULL;
im = image;
return im->im->info.comment;
static char *
eng_image_format_get(void *data, void *image)
{
- Render_Engine *re;
+// Render_Engine *re;
Evas_GL_Image *im;
- re = (Render_Engine *)data;
+// re = (Render_Engine *)data;
im = image;
return NULL;
}
static void
eng_image_size_get(void *data, void *image, int *w, int *h)
{
- Render_Engine *re;
-
- re = (Render_Engine *)data;
+// Render_Engine *re;
+//
+// re = (Render_Engine *)data;
if (!image)
{
*w = 0;