forked from enlightenment/efl
Evas filters: Fix invalid rendering in case of async render
This simplifies the code and fixes async buffer management. @fix
This commit is contained in:
parent
20045ec0e1
commit
284cd2a530
|
@ -106,6 +106,8 @@ _backing_free(Evas_Filter_Context *ctx, RGBA_Image *im)
|
||||||
{
|
{
|
||||||
if (!ctx->async)
|
if (!ctx->async)
|
||||||
ENFN->image_free(ENDT, im);
|
ENFN->image_free(ENDT, im);
|
||||||
|
else
|
||||||
|
evas_unref_queue_image_put(ctx->evas, &im->cache_entry);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -439,20 +441,7 @@ evas_filter_context_buffers_allocate_all(Evas_Filter_Context *ctx)
|
||||||
{
|
{
|
||||||
RGBA_Image *im;
|
RGBA_Image *im;
|
||||||
im = fb->backing;
|
im = fb->backing;
|
||||||
if (im)
|
if (im || fb->source || fb->glimage)
|
||||||
{
|
|
||||||
if (ctx->async)
|
|
||||||
{
|
|
||||||
im->cache_entry.references++;
|
|
||||||
evas_unref_queue_image_put(ctx->evas, &im->cache_entry);
|
|
||||||
}
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (fb->source)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
if (fb->glimage)
|
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (!fb->w && !fb->h)
|
if (!fb->w && !fb->h)
|
||||||
|
@ -467,8 +456,6 @@ evas_filter_context_buffers_allocate_all(Evas_Filter_Context *ctx)
|
||||||
|
|
||||||
fb->backing = im;
|
fb->backing = im;
|
||||||
fb->allocated = (im != NULL);
|
fb->allocated = (im != NULL);
|
||||||
if (ctx->async && fb->allocated)
|
|
||||||
evas_unref_queue_image_put(ctx->evas, &im->cache_entry);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return EINA_TRUE;
|
return EINA_TRUE;
|
||||||
|
@ -517,8 +504,6 @@ _filter_buffer_data_set(Evas_Filter_Context *ctx, int bufid, void *data,
|
||||||
|
|
||||||
fb->backing = _rgba_image_alloc(fb, data);
|
fb->backing = _rgba_image_alloc(fb, data);
|
||||||
fb->allocated = (!data && (fb->backing != NULL));
|
fb->allocated = (!data && (fb->backing != NULL));
|
||||||
if (ctx->async && fb->allocated)
|
|
||||||
evas_unref_queue_image_put(ctx->evas, fb->backing);
|
|
||||||
return fb->allocated;
|
return fb->allocated;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -644,31 +629,14 @@ evas_filter_buffer_backing_release(Evas_Filter_Context *ctx,
|
||||||
|
|
||||||
EINA_LIST_FOREACH(ctx->buffers, li, fb)
|
EINA_LIST_FOREACH(ctx->buffers, li, fb)
|
||||||
{
|
{
|
||||||
if (fb->backing == stolen_buffer)
|
if ((fb->backing == stolen_buffer) || (fb->glimage == stolen_buffer))
|
||||||
{
|
|
||||||
fb->stolen = EINA_FALSE;
|
|
||||||
if (fb->delete_me)
|
|
||||||
{
|
|
||||||
ctx->buffers = eina_list_remove_list(ctx->buffers, li);
|
|
||||||
if (ctx->async)
|
|
||||||
{
|
|
||||||
if (fb->allocated)
|
|
||||||
evas_unref_queue_image_put(ctx->evas, stolen_buffer);
|
|
||||||
free(fb);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
_buffer_free(fb);
|
|
||||||
return EINA_TRUE;
|
|
||||||
}
|
|
||||||
return EINA_TRUE;
|
|
||||||
}
|
|
||||||
else if (fb->glimage == stolen_buffer)
|
|
||||||
{
|
{
|
||||||
fb->stolen = EINA_FALSE;
|
fb->stolen = EINA_FALSE;
|
||||||
if (fb->delete_me)
|
if (fb->delete_me)
|
||||||
{
|
{
|
||||||
ctx->buffers = eina_list_remove_list(ctx->buffers, li);
|
ctx->buffers = eina_list_remove_list(ctx->buffers, li);
|
||||||
_buffer_free(fb);
|
_buffer_free(fb);
|
||||||
|
return EINA_TRUE;
|
||||||
}
|
}
|
||||||
return EINA_TRUE;
|
return EINA_TRUE;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue