forked from enlightenment/efl
fix xrender engnie to accept user-provided pixel data
SVN revision: 17128
This commit is contained in:
parent
884e03d762
commit
0f042bcbd4
|
@ -1494,7 +1494,7 @@ evas_object_image_render_pre(Evas_Object *obj)
|
|||
if (is_v != was_v)
|
||||
{
|
||||
updates = evas_object_render_pre_visible_change(updates, obj, is_v, was_v);
|
||||
goto done;
|
||||
if (!o->pixel_updates) goto done;
|
||||
}
|
||||
/* it's not visible - we accounted for it appearing or not so just abort */
|
||||
if (!is_v) goto done;
|
||||
|
@ -1504,7 +1504,7 @@ evas_object_image_render_pre(Evas_Object *obj)
|
|||
if (obj->restack)
|
||||
{
|
||||
updates = evas_object_render_pre_prev_cur_add(updates, obj);
|
||||
goto done;
|
||||
if (!o->pixel_updates) goto done;
|
||||
}
|
||||
/* if it changed color */
|
||||
if ((obj->cur.color.r != obj->prev.color.r) ||
|
||||
|
@ -1513,7 +1513,7 @@ evas_object_image_render_pre(Evas_Object *obj)
|
|||
(obj->cur.color.a != obj->prev.color.a))
|
||||
{
|
||||
updates = evas_object_render_pre_prev_cur_add(updates, obj);
|
||||
goto done;
|
||||
if (!o->pixel_updates) goto done;
|
||||
}
|
||||
if (o->changed)
|
||||
{
|
||||
|
@ -1526,7 +1526,7 @@ evas_object_image_render_pre(Evas_Object *obj)
|
|||
)
|
||||
{
|
||||
updates = evas_object_render_pre_prev_cur_add(updates, obj);
|
||||
goto done;
|
||||
if (!o->pixel_updates) goto done;
|
||||
}
|
||||
if ((o->cur.image.w != o->prev.image.w) ||
|
||||
(o->cur.image.h != o->prev.image.h) ||
|
||||
|
@ -1534,7 +1534,7 @@ evas_object_image_render_pre(Evas_Object *obj)
|
|||
(o->cur.smooth_scale != o->prev.smooth_scale))
|
||||
{
|
||||
updates = evas_object_render_pre_prev_cur_add(updates, obj);
|
||||
goto done;
|
||||
if (!o->pixel_updates) goto done;
|
||||
}
|
||||
if ((o->cur.border.l != o->prev.border.l) ||
|
||||
(o->cur.border.r != o->prev.border.r) ||
|
||||
|
@ -1542,12 +1542,12 @@ evas_object_image_render_pre(Evas_Object *obj)
|
|||
(o->cur.border.b != o->prev.border.b))
|
||||
{
|
||||
updates = evas_object_render_pre_prev_cur_add(updates, obj);
|
||||
goto done;
|
||||
if (!o->pixel_updates) goto done;
|
||||
}
|
||||
if (o->dirty_pixels)
|
||||
{
|
||||
updates = evas_object_render_pre_prev_cur_add(updates, obj);
|
||||
goto done;
|
||||
if (!o->pixel_updates) goto done;
|
||||
}
|
||||
}
|
||||
/* if it changed geometry - and obviously not visibility or color */
|
||||
|
@ -1581,7 +1581,7 @@ evas_object_image_render_pre(Evas_Object *obj)
|
|||
rl = evas_list_remove(rl, r);
|
||||
updates = evas_list_append(updates, r);
|
||||
}
|
||||
goto done;
|
||||
if (!o->pixel_updates) goto done;
|
||||
}
|
||||
if (((obj->cur.geometry.x != obj->prev.geometry.x) ||
|
||||
(obj->cur.geometry.y != obj->prev.geometry.y) ||
|
||||
|
@ -1590,7 +1590,7 @@ evas_object_image_render_pre(Evas_Object *obj)
|
|||
)
|
||||
{
|
||||
updates = evas_object_render_pre_prev_cur_add(updates, obj);
|
||||
goto done;
|
||||
if (!o->pixel_updates) goto done;
|
||||
}
|
||||
if (o->changed)
|
||||
{
|
||||
|
@ -1600,7 +1600,7 @@ evas_object_image_render_pre(Evas_Object *obj)
|
|||
(o->cur.fill.h != o->prev.fill.h))
|
||||
{
|
||||
updates = evas_object_render_pre_prev_cur_add(updates, obj);
|
||||
goto done;
|
||||
if (!o->pixel_updates) goto done;
|
||||
}
|
||||
if ((o->cur.border.l == 0) &&
|
||||
(o->cur.border.r == 0) &&
|
||||
|
|
|
@ -635,18 +635,22 @@ static void *
|
|||
evas_engine_xrender_x11_image_new_from_data(void *data, int w, int h, DATA32 *image_data)
|
||||
{
|
||||
Render_Engine *re;
|
||||
XR_Image *im;
|
||||
|
||||
re = (Render_Engine *)data;
|
||||
return _xre_image_new_from_data(re->xinf, w, h, image_data);
|
||||
im = _xre_image_new_from_data(re->xinf, w, h, image_data);
|
||||
return im;
|
||||
}
|
||||
|
||||
static void *
|
||||
evas_engine_xrender_x11_image_new_from_copied_data(void *data, int w, int h, DATA32 *image_data)
|
||||
{
|
||||
Render_Engine *re;
|
||||
XR_Image *im;
|
||||
|
||||
re = (Render_Engine *)data;
|
||||
return _xre_image_new_from_copied_data(re->xinf, w, h, image_data);
|
||||
im = _xre_image_new_from_copied_data(re->xinf, w, h, image_data);
|
||||
return im;
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -673,6 +677,9 @@ evas_engine_xrender_x11_image_size_get(void *data, void *image, int *w, int *h)
|
|||
static void *
|
||||
evas_engine_xrender_x11_image_size_set(void *data, void *image, int w, int h)
|
||||
{
|
||||
Render_Engine *re;
|
||||
|
||||
re = (Render_Engine *)data;
|
||||
if (!image) return image;
|
||||
if (((XR_Image *)image)->references > 1)
|
||||
{
|
||||
|
@ -696,6 +703,9 @@ evas_engine_xrender_x11_image_size_set(void *data, void *image, int w, int h)
|
|||
static void *
|
||||
evas_engine_xrender_x11_image_dirty_region(void *data, void *image, int x, int y, int w, int h)
|
||||
{
|
||||
Render_Engine *re;
|
||||
|
||||
re = (Render_Engine *)data;
|
||||
if (!image) return image;
|
||||
if (((XR_Image *)image)->references > 1)
|
||||
{
|
||||
|
@ -714,6 +724,9 @@ evas_engine_xrender_x11_image_dirty_region(void *data, void *image, int x, int y
|
|||
static void *
|
||||
evas_engine_xrender_x11_image_data_get(void *data, void *image, int to_write, DATA32 **image_data)
|
||||
{
|
||||
Render_Engine *re;
|
||||
|
||||
re = (Render_Engine *)data;
|
||||
if (!image) return image;
|
||||
if (to_write)
|
||||
{
|
||||
|
@ -738,13 +751,16 @@ evas_engine_xrender_x11_image_data_get(void *data, void *image, int to_write, DA
|
|||
static void *
|
||||
evas_engine_xrender_x11_image_data_put(void *data, void *image, DATA32 *image_data)
|
||||
{
|
||||
Render_Engine *re;
|
||||
|
||||
re = (Render_Engine *)data;
|
||||
if (!image) return image;
|
||||
if (_xre_image_data_get((XR_Image *)image) != image_data)
|
||||
{
|
||||
XR_Image *old_image;
|
||||
|
||||
old_image = (XR_Image *)image;
|
||||
image = _xre_image_new_from_data(old_image->xinf, old_image->w, old_image->h, data);
|
||||
image = _xre_image_new_from_data(old_image->xinf, old_image->w, old_image->h, image_data);
|
||||
if (image)
|
||||
{
|
||||
((XR_Image *)image)->alpha = old_image->alpha;
|
||||
|
@ -759,6 +775,9 @@ evas_engine_xrender_x11_image_data_put(void *data, void *image, DATA32 *image_da
|
|||
static void *
|
||||
evas_engine_xrender_x11_image_alpha_set(void *data, void *image, int has_alpha)
|
||||
{
|
||||
Render_Engine *re;
|
||||
|
||||
re = (Render_Engine *)data;
|
||||
if (!image) return image;
|
||||
if ((int)((XR_Image *)image)->alpha == has_alpha) return image;
|
||||
if (((XR_Image *)image)->references > 1)
|
||||
|
@ -805,6 +824,9 @@ evas_engine_xrender_x11_image_draw(void *data, void *context, void *surface, voi
|
|||
static char *
|
||||
evas_engine_xrender_x11_image_comment_get(void *data, void *image, char *key)
|
||||
{
|
||||
Render_Engine *re;
|
||||
|
||||
re = (Render_Engine *)data;
|
||||
if (!image) return NULL;
|
||||
return ((XR_Image *)image)->comment;
|
||||
}
|
||||
|
@ -812,6 +834,9 @@ evas_engine_xrender_x11_image_comment_get(void *data, void *image, char *key)
|
|||
static char *
|
||||
evas_engine_xrender_x11_image_format_get(void *data, void *image)
|
||||
{
|
||||
Render_Engine *re;
|
||||
|
||||
re = (Render_Engine *)data;
|
||||
if (!image) return NULL;
|
||||
return ((XR_Image *)image)->format;
|
||||
}
|
||||
|
|
|
@ -410,6 +410,7 @@ _xre_image_surface_gen(XR_Image *im)
|
|||
{
|
||||
void *data = NULL;
|
||||
|
||||
if ((im->surface) && (!im->updates)) return;
|
||||
if (im->data) data = im->data;
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue