summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2014-01-23 14:58:05 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2014-02-07 17:33:17 +0900
commiteea049f988c3093c4859ff3a877e27b9e4aa0441 (patch)
tree63f34d3986caa858137b33f31866e99445c1e327
parentbf46a1d26c0f9bf04a540f5ccfaa204d7d2caa24 (diff)
Evas filters: Alloc/Dealloc buffers from the main loop only
This is a problem I didn't spot immediately... but with tons of nasty consequences.
-rw-r--r--src/lib/evas/canvas/evas_object_text.c21
-rw-r--r--src/lib/evas/filters/evas_filter.c186
-rw-r--r--src/lib/evas/filters/evas_filter_blend.c28
-rw-r--r--src/lib/evas/filters/evas_filter_private.h2
-rw-r--r--src/lib/evas/filters/evas_filter_utils.c16
-rw-r--r--src/lib/evas/include/evas_filter.h8
6 files changed, 186 insertions, 75 deletions
diff --git a/src/lib/evas/canvas/evas_object_text.c b/src/lib/evas/canvas/evas_object_text.c
index fab1f3b5d4..087024032d 100644
--- a/src/lib/evas/canvas/evas_object_text.c
+++ b/src/lib/evas/canvas/evas_object_text.c
@@ -2133,6 +2133,7 @@ evas_object_text_render(Evas_Object *eo_obj EINA_UNUSED,
2133 void *filter_ctx; 2133 void *filter_ctx;
2134 Eina_Bool ok; 2134 Eina_Bool ok;
2135 int ox = 0, oy = 0; 2135 int ox = 0, oy = 0;
2136 Image_Entry *previous = o->cur.filter.output;
2136 2137
2137 /* NOTE: Font effect rendering is now done ENTIRELY on CPU. 2138 /* NOTE: Font effect rendering is now done ENTIRELY on CPU.
2138 * So we rely on cache/cache2 to allocate a real image buffer, 2139 * So we rely on cache/cache2 to allocate a real image buffer,
@@ -2146,7 +2147,7 @@ evas_object_text_render(Evas_Object *eo_obj EINA_UNUSED,
2146 X = obj->cur->geometry.x; 2147 X = obj->cur->geometry.x;
2147 Y = obj->cur->geometry.y; 2148 Y = obj->cur->geometry.y;
2148 2149
2149 if (o->cur.filter.output) 2150 if (previous)
2150 { 2151 {
2151 Eina_Bool redraw = o->cur.filter.changed; 2152 Eina_Bool redraw = o->cur.filter.changed;
2152 2153
@@ -2170,16 +2171,11 @@ evas_object_text_render(Evas_Object *eo_obj EINA_UNUSED,
2170 eina_iterator_free(it); 2171 eina_iterator_free(it);
2171 } 2172 }
2172 2173
2173 if (redraw) 2174 if (!redraw)
2174 {
2175 ENFN->image_free(ENDT, o->cur.filter.output);
2176 o->cur.filter.output = NULL;
2177 }
2178 else
2179 { 2175 {
2180 // Render this image only 2176 // Render this image only
2181 ENFN->image_draw(ENDT, context, 2177 ENFN->image_draw(ENDT, context,
2182 surface, o->cur.filter.output, 2178 surface, previous,
2183 0, 0, W, H, // src 2179 0, 0, W, H, // src
2184 X + x, Y + y, W, H, // dst 2180 X + x, Y + y, W, H, // dst
2185 EINA_FALSE, // smooth 2181 EINA_FALSE, // smooth
@@ -2205,10 +2201,15 @@ evas_object_text_render(Evas_Object *eo_obj EINA_UNUSED,
2205 ENFN->context_color_set(ENDT, filter_ctx, 255, 255, 255, 255); 2201 ENFN->context_color_set(ENDT, filter_ctx, 255, 255, 255, 255);
2206 2202
2207 // Allocate main buffers now 2203 // Allocate main buffers now
2208 evas_filter_buffer_data_set(filter, inbuf, NULL, W, H, EINA_TRUE); 2204 evas_filter_context_buffers_allocate_all(filter, W, H);
2209 evas_filter_buffer_data_set(filter, outbuf, NULL, W, H, EINA_FALSE); 2205 //evas_filter_buffer_data_set(filter, inbuf, NULL, W, H, EINA_TRUE);
2206 //evas_filter_buffer_data_set(filter, outbuf, NULL, W, H, EINA_FALSE);
2210 evas_filter_target_set(filter, context, surface, X + x, Y + y); 2207 evas_filter_target_set(filter, context, surface, X + x, Y + y);
2208
2209 // Steal output and release previous
2211 o->cur.filter.output = evas_filter_buffer_backing_steal(filter, outbuf); 2210 o->cur.filter.output = evas_filter_buffer_backing_steal(filter, outbuf);
2211 if (o->cur.filter.output != previous)
2212 evas_filter_buffer_backing_release(filter, previous);
2212 2213
2213 // Render text to input buffer 2214 // Render text to input buffer
2214 EINA_INLIST_FOREACH(EINA_INLIST_GET(o->items), it) 2215 EINA_INLIST_FOREACH(EINA_INLIST_GET(o->items), it)
diff --git a/src/lib/evas/filters/evas_filter.c b/src/lib/evas/filters/evas_filter.c
index 6a1781f5f3..7374da0486 100644
--- a/src/lib/evas/filters/evas_filter.c
+++ b/src/lib/evas/filters/evas_filter.c
@@ -81,28 +81,39 @@ evas_filter_context_clear(Evas_Filter_Context *ctx)
81} 81}
82 82
83static void 83static void
84_backing_free(Evas_Filter_Context *ctx, Image_Entry *ie)
85{
86 if (!ie) return;
87
88 if (!ctx->gl_engine)
89 ENFN->image_free(ENDT, ie);
90 else
91 {
92 if (!evas_cserve2_use_get())
93 evas_cache_image_drop(ie);
94 else
95 evas_cache2_image_close(ie);
96 }
97}
98
99static void
84_filter_buffer_backing_free(Evas_Filter_Buffer *fb) 100_filter_buffer_backing_free(Evas_Filter_Buffer *fb)
85{ 101{
86 void *backing; 102 void *backing;
87 if (!fb) return; 103 if (!fb) return;
88 104
105 if (fb->stolen)
106 {
107 fb->delete_me = EINA_TRUE;
108 return;
109 }
110
111 INF("Free backing of buffer %d fb @ %p backing @ %p alloc %d", fb->id, fb, fb->backing, fb->allocated);
89 backing = fb->backing; 112 backing = fb->backing;
90 fb->backing = NULL; 113 fb->backing = NULL;
91 114
92 if (!fb->allocated) return; 115 if (!fb->allocated) return;
93 fb->allocated = EINA_FALSE; 116 _backing_free(fb->ctx, backing);
94
95 if (!backing) return;
96
97 if (!fb->ctx->gl_engine)
98 fb->ENFN->image_free(fb->ENDT, backing);
99 else
100 {
101 if (!evas_cserve2_use_get())
102 evas_cache_image_drop(backing);
103 else
104 evas_cache2_image_close(backing);
105 }
106} 117}
107 118
108/** @hidden private bind proxy to context */ 119/** @hidden private bind proxy to context */
@@ -362,42 +373,111 @@ _rgba_image_alloc(Evas_Filter_Buffer const *fb, void *data)
362 return image; 373 return image;
363} 374}
364 375
376/*
365Eina_Bool 377Eina_Bool
366evas_filter_buffer_alloc(Evas_Filter_Buffer *fb, int w, int h) 378evas_filter_buffer_alloc(Evas_Filter_Buffer *fb, int w, int h)
367{ 379{
368 if (!fb) return EINA_FALSE; 380 if (!fb) return EINA_FALSE;
381 INF("Allocate buffer %d: backing %p", fb->id, fb->backing);
369 if (fb->backing) 382 if (fb->backing)
370 { 383 {
384 RGBA_Image *im;
371 int W, H; 385 int W, H;
372 386
373 if (fb->ctx->gl_engine) 387 if (fb->ctx->gl_engine)
374 return EINA_TRUE;
375
376 fb->ENFN->image_size_get(fb->ENDT, fb->backing, &W, &H);
377 if ((W == w) && (H == h))
378 return EINA_TRUE;
379
380 if (!fb->transient)
381 { 388 {
382 ERR("Buffer dimensions mismatch with external image!"); 389 // This needs to be counter-checked.
383 //return EINA_FALSE; 390 INF("Nope, gl engine is used");
384 return EINA_TRUE; 391 return EINA_TRUE;
385 } 392 }
386 _filter_buffer_backing_free(fb); 393
394 im = fb->backing;
395 if (!im->image.data)
396 {
397 if (fb->allocated)
398 fb->ENFN->image_free(fb->ENDT, im);
399 fb->allocated = EINA_FALSE;
400 fb->backing = NULL;
401 }
402 else
403 {
404 fb->ENFN->image_size_get(fb->ENDT, fb->backing, &W, &H);
405 if ((W == w) && (H == h))
406 {
407 INF("Nope, already fine");
408 return EINA_TRUE;
409 }
410
411 if (!fb->transient)
412 ERR("Buffer dimensions mismatch with external image!");
413 _filter_buffer_backing_free(fb);
414 }
387 } 415 }
388 if ((fb->w && (fb->w != w)) || (fb->h && (fb->h != h))) 416 if ((fb->w && (fb->w != w)) || (fb->h && (fb->h != h)))
389 { 417 {
390 ERR("Buffer dimensions mismatch!"); 418 ERR("Buffer dimensions mismatch!");
391 //return EINA_FALSE; 419 //return EINA_FALSE;
392 } 420 }
393 if (fb->allocated) return EINA_TRUE; 421 if (fb->allocated && fb->backing)
422 {
423 RGBA_Image *a = fb->backing;
424 INF("Already allocated. Is that true? backing %p and data %p", a, a?a->image.data:NULL);
425 return EINA_TRUE;
426 }
394 fb->w = w; 427 fb->w = w;
395 fb->h = h; 428 fb->h = h;
396 429
397 fb->backing = _rgba_image_alloc(fb, NULL); 430 fb->backing = _rgba_image_alloc(fb, NULL);
398 fb->allocated = (fb->backing != NULL); 431 fb->allocated = (fb->backing != NULL);
432 RGBA_Image *a = fb->backing;
433 INF("Allocated buf %d with backing %p data %p", fb->id, fb->backing, a?a->image.data:0);
399 return fb->allocated; 434 return fb->allocated;
400} 435}
436*/
437
438Eina_Bool
439evas_filter_context_buffers_allocate_all(Evas_Filter_Context *ctx, unsigned w, unsigned h)
440{
441 Evas_Filter_Buffer *fb;
442 Image_Entry *ie;
443 Eina_List *li;
444
445 EINA_SAFETY_ON_NULL_RETURN_VAL(ctx, EINA_FALSE);
446 EINA_LIST_FOREACH(ctx->buffers, li, fb)
447 {
448 if (fb->source) continue;
449
450 ie = fb->backing;
451 if (ie)
452 {
453 if ((ie->w != w) || (ie->h != h))
454 {
455 CRI("Inconsistent buffer size!");
456 continue;
457 }
458 ie->references++;
459 continue;
460 }
461
462 if (!fb->w && !fb->h)
463 {
464 fb->w = w;
465 fb->h = h;
466 }
467 ie = (Image_Entry *) _rgba_image_alloc(fb, NULL);
468 if (!ie)
469 {
470 ERR("Buffer %d allocation failed!", fb->id);
471 continue;
472 }
473
474 fb->backing = ie;
475 }
476
477 // To unref: evas_unref_queue_image_put
478
479 return EINA_TRUE;
480}
401 481
402int 482int
403evas_filter_buffer_empty_new(Evas_Filter_Context *ctx, Eina_Bool alpha_only) 483evas_filter_buffer_empty_new(Evas_Filter_Context *ctx, Eina_Bool alpha_only)
@@ -462,6 +542,7 @@ evas_filter_buffer_image_new(Evas_Filter_Context *ctx, RGBA_Image *image)
462 return fb->id; 542 return fb->id;
463} 543}
464 544
545/*
465int 546int
466evas_filter_buffer_data_new(Evas_Filter_Context *ctx, void *data, int w, int h, 547evas_filter_buffer_data_new(Evas_Filter_Context *ctx, void *data, int w, int h,
467 Eina_Bool alpha_only) 548 Eina_Bool alpha_only)
@@ -487,6 +568,7 @@ evas_filter_buffer_data_new(Evas_Filter_Context *ctx, void *data, int w, int h,
487 568
488 return fb->id; 569 return fb->id;
489} 570}
571*/
490 572
491static void 573static void
492_buffer_free(Evas_Filter_Buffer *fb) 574_buffer_free(Evas_Filter_Buffer *fb)
@@ -525,16 +607,45 @@ evas_filter_buffer_backing_steal(Evas_Filter_Context *ctx, int bufid)
525{ 607{
526 Evas_Filter_Buffer *buffer; 608 Evas_Filter_Buffer *buffer;
527 609
610 EINA_SAFETY_ON_NULL_RETURN_VAL(ctx, NULL);
611
528 buffer = _filter_buffer_get(ctx, bufid); 612 buffer = _filter_buffer_get(ctx, bufid);
529 if (!buffer) return NULL; 613 if (!buffer) return NULL;
530 614
531 if (!buffer->glimage) 615 buffer->stolen = EINA_TRUE;
616 if (buffer->glimage)
617 return buffer->glimage;
618 else
619 return buffer->backing;
620}
621
622Eina_Bool
623evas_filter_buffer_backing_release(Evas_Filter_Context *ctx, void *stolen_buffer)
624{
625 Image_Entry *ie = stolen_buffer;
626 Evas_Filter_Buffer *fb;
627 Eina_List *li;
628
629 if (!stolen_buffer) return EINA_FALSE;
630 EINA_SAFETY_ON_NULL_RETURN_VAL(ctx, EINA_FALSE);
631
632 EINA_LIST_FOREACH(ctx->buffers, li, fb)
532 { 633 {
533 buffer->allocated = EINA_FALSE; 634 if (fb->backing == ie)
534 return buffer->backing; 635 {
636 fb->stolen = EINA_FALSE;
637 if (fb->delete_me)
638 {
639 ctx->buffers = eina_list_remove_list(ctx->buffers, li);
640 _buffer_free(fb);
641 return EINA_TRUE;
642 }
643 return EINA_TRUE;
644 }
535 } 645 }
536 else 646
537 return buffer->glimage; 647 _backing_free(ctx, ie);
648 return EINA_TRUE;
538} 649}
539 650
540static Evas_Filter_Command * 651static Evas_Filter_Command *
@@ -1418,29 +1529,12 @@ _filter_command_run(Evas_Filter_Command *cmd)
1418 return EINA_TRUE; 1529 return EINA_TRUE;
1419 } 1530 }
1420 1531
1421 if (!cmd->output->w && !cmd->output->h)
1422 {
1423 if (!cmd->output->backing)
1424 {
1425 cmd->output->w = cmd->ctx->w;
1426 cmd->output->h = cmd->ctx->h;
1427 }
1428 }
1429
1430 if ((cmd->output->w <= 0) || (cmd->output->h <= 0)) 1532 if ((cmd->output->w <= 0) || (cmd->output->h <= 0))
1431 { 1533 {
1432 ERR("Output size invalid: %dx%d", cmd->output->w, cmd->output->h); 1534 ERR("Output size invalid: %dx%d", cmd->output->w, cmd->output->h);
1433 return EINA_FALSE; 1535 return EINA_FALSE;
1434 } 1536 }
1435 1537
1436 ok = evas_filter_buffer_alloc(cmd->output, cmd->output->w, cmd->output->h);
1437 if (!ok)
1438 {
1439 ERR("Failed to allocate output buffer of size %dx%d",
1440 cmd->output->w, cmd->output->h);
1441 return EINA_FALSE;
1442 }
1443
1444 //func = cmd->ENFN->filter_command_func_get(cmd); 1538 //func = cmd->ENFN->filter_command_func_get(cmd);
1445 // FIXME: Must call engine function, not CPU directly. 1539 // FIXME: Must call engine function, not CPU directly.
1446 1540
diff --git a/src/lib/evas/filters/evas_filter_blend.c b/src/lib/evas/filters/evas_filter_blend.c
index 54f3d75fc2..ac35e03c1a 100644
--- a/src/lib/evas/filters/evas_filter_blend.c
+++ b/src/lib/evas/filters/evas_filter_blend.c
@@ -51,9 +51,6 @@ _filter_blend_cpu_alpha(Evas_Filter_Command *cmd)
51 if (!func) 51 if (!func)
52 return EINA_FALSE; 52 return EINA_FALSE;
53 53
54 if (!evas_filter_buffer_alloc(cmd->output, cmd->output->w, cmd->output->h))
55 return EINA_FALSE;
56
57 in = cmd->input->backing; 54 in = cmd->input->backing;
58 out = cmd->output->backing; 55 out = cmd->output->backing;
59 sw = in->cache_entry.w; 56 sw = in->cache_entry.w;
@@ -96,13 +93,12 @@ _filter_blend_cpu_rgba(Evas_Filter_Command *cmd)
96 RGBA_Draw_Context *drawctx; 93 RGBA_Draw_Context *drawctx;
97 int sw, sh, dx, dy, dw, dh, sx, sy; 94 int sw, sh, dx, dy, dw, dh, sx, sy;
98 95
99 if (!evas_filter_buffer_alloc(cmd->output, cmd->output->w, cmd->output->h))
100 return EINA_FALSE;
101
102 in = cmd->input->backing; 96 in = cmd->input->backing;
103 out = cmd->output->backing; 97 out = cmd->output->backing;
104 EINA_SAFETY_ON_NULL_RETURN_VAL(in, EINA_FALSE); 98 EINA_SAFETY_ON_NULL_RETURN_VAL(in, EINA_FALSE);
105 EINA_SAFETY_ON_NULL_RETURN_VAL(out, EINA_FALSE); 99 EINA_SAFETY_ON_NULL_RETURN_VAL(out, EINA_FALSE);
100 EINA_SAFETY_ON_NULL_RETURN_VAL(in->image.data, EINA_FALSE);
101 EINA_SAFETY_ON_NULL_RETURN_VAL(out->image.data, EINA_FALSE);
106 102
107 sx = 0; 103 sx = 0;
108 sy = 0; 104 sy = 0;
@@ -324,9 +320,6 @@ _filter_blend_cpu_mask_rgba(Evas_Filter_Command *cmd)
324 DATA8 *maskdata; 320 DATA8 *maskdata;
325 int sw, sh, dw, dh, ox, oy, sx = 0, sy = 0, dx = 0, dy = 0, rows, cols, y; 321 int sw, sh, dw, dh, ox, oy, sx = 0, sy = 0, dx = 0, dy = 0, rows, cols, y;
326 322
327 if (!evas_filter_buffer_alloc(cmd->output, cmd->output->w, cmd->output->h))
328 return EINA_FALSE;
329
330 // TODO: Call _mapped_blend_cpu to implement repeat fill mode. 323 // TODO: Call _mapped_blend_cpu to implement repeat fill mode.
331 if (cmd->draw.fillmode != EVAS_FILTER_FILL_MODE_NONE) 324 if (cmd->draw.fillmode != EVAS_FILTER_FILL_MODE_NONE)
332 ERR("Fill modes are not implemented for Alpha --> RGBA"); 325 ERR("Fill modes are not implemented for Alpha --> RGBA");
@@ -343,6 +336,19 @@ _filter_blend_cpu_mask_rgba(Evas_Filter_Command *cmd)
343 maskdata = in->mask.data; 336 maskdata = in->mask.data;
344 col = ARGB_JOIN(cmd->draw.A, cmd->draw.R, cmd->draw.G, cmd->draw.B); 337 col = ARGB_JOIN(cmd->draw.A, cmd->draw.R, cmd->draw.G, cmd->draw.B);
345 338
339 // TODO: Fix this crash. Change proxy image and OUTPUT data is NULL. Why?
340
341 if (!dstdata)
342 {
343 ERR("Empty destination from buffer #%d %dx%d %p", cmd->output->id, dw, dh, out);
344 //abort();
345 return EINA_FALSE;
346 }
347 if (!maskdata)
348 abort();
349 //EINA_SAFETY_ON_NULL_RETURN_VAL(dstdata, EINA_FALSE);
350 //EINA_SAFETY_ON_NULL_RETURN_VAL(maskdata, EINA_FALSE);
351
346 func = evas_common_gfx_func_composite_mask_color_span_get 352 func = evas_common_gfx_func_composite_mask_color_span_get
347 (col, out, 1, cmd->draw.render_op); 353 (col, out, 1, cmd->draw.render_op);
348 354
@@ -417,9 +423,6 @@ _filter_blend_cpu_rgba2alpha(Evas_Filter_Command *cmd)
417 RGBA_Image *in, *out; 423 RGBA_Image *in, *out;
418 int sw, sh, dx, dy, dw, dh, sx, sy; 424 int sw, sh, dx, dy, dw, dh, sx, sy;
419 425
420 if (!evas_filter_buffer_alloc(cmd->output, cmd->output->w, cmd->output->h))
421 return EINA_FALSE;
422
423 in = cmd->input->backing; 426 in = cmd->input->backing;
424 out = cmd->output->backing; 427 out = cmd->output->backing;
425 EINA_SAFETY_ON_NULL_RETURN_VAL(in, EINA_FALSE); 428 EINA_SAFETY_ON_NULL_RETURN_VAL(in, EINA_FALSE);
@@ -439,6 +442,7 @@ _filter_blend_cpu_rgba2alpha(Evas_Filter_Command *cmd)
439 return EINA_TRUE; 442 return EINA_TRUE;
440 443
441 // Stretch if necessary. 444 // Stretch if necessary.
445#warning FIXME Must be in the main loop because of buffer allocation
442 if ((sw != dw || sh != dh) && (cmd->draw.fillmode & EVAS_FILTER_FILL_MODE_STRETCH_XY)) 446 if ((sw != dw || sh != dh) && (cmd->draw.fillmode & EVAS_FILTER_FILL_MODE_STRETCH_XY))
443 { 447 {
444 Evas_Filter_Buffer *fb; 448 Evas_Filter_Buffer *fb;
diff --git a/src/lib/evas/filters/evas_filter_private.h b/src/lib/evas/filters/evas_filter_private.h
index ab73a921d3..939f556513 100644
--- a/src/lib/evas/filters/evas_filter_private.h
+++ b/src/lib/evas/filters/evas_filter_private.h
@@ -154,6 +154,8 @@ struct _Evas_Filter_Buffer
154 Eina_Bool allocated : 1; // allocated on demand, belongs to this context 154 Eina_Bool allocated : 1; // allocated on demand, belongs to this context
155 Eina_Bool transient : 1; // temporary buffer (automatic allocation) 155 Eina_Bool transient : 1; // temporary buffer (automatic allocation)
156 Eina_Bool locked : 1; // internal flag 156 Eina_Bool locked : 1; // internal flag
157 Eina_Bool stolen : 1; // stolen by the client
158 Eina_Bool delete_me : 1; // request delete asap (after released by client)
157}; 159};
158 160
159enum _Evas_Filter_Interpolation_Mode 161enum _Evas_Filter_Interpolation_Mode
diff --git a/src/lib/evas/filters/evas_filter_utils.c b/src/lib/evas/filters/evas_filter_utils.c
index 340c7d272f..5c8d7f805b 100644
--- a/src/lib/evas/filters/evas_filter_utils.c
+++ b/src/lib/evas/filters/evas_filter_utils.c
@@ -10,8 +10,8 @@ evas_filter_buffer_scaled_get(Evas_Filter_Context *ctx,
10 int w, int h) 10 int w, int h)
11{ 11{
12 Evas_Filter_Buffer *fb; 12 Evas_Filter_Buffer *fb;
13 void *dstdata = NULL; 13 Image_Entry *dstdata = NULL;
14 void *srcdata; 14 Image_Entry *srcdata;
15 void *drawctx; 15 void *drawctx;
16 16
17 srcdata = evas_filter_buffer_backing_get(ctx, src->id); 17 srcdata = evas_filter_buffer_backing_get(ctx, src->id);
@@ -20,11 +20,17 @@ evas_filter_buffer_scaled_get(Evas_Filter_Context *ctx,
20 fb = evas_filter_temporary_buffer_get(ctx, w, h, src->alpha_only); 20 fb = evas_filter_temporary_buffer_get(ctx, w, h, src->alpha_only);
21 if (!fb) return NULL; 21 if (!fb) return NULL;
22 22
23 if (evas_filter_buffer_alloc(fb, w, h)) 23 dstdata = evas_filter_buffer_backing_get(ctx, fb->id);
24 dstdata = evas_filter_buffer_backing_get(ctx, fb->id);
25 if (!dstdata) 24 if (!dstdata)
26 { 25 {
27 ERR("Buffer allocation failed for size %dx%d", w, h); 26 CRI("No backing found for buffer %d", fb->id);
27 return NULL;
28 }
29
30 if ((dstdata->w != w) || (dstdata->h != h))
31 {
32 CRI("Buffer size mismatch: got %dx%d requested %dx%d",
33 dstdata->w, dstdata->h, w, h);
28 return NULL; 34 return NULL;
29 } 35 }
30 36
diff --git a/src/lib/evas/include/evas_filter.h b/src/lib/evas/include/evas_filter.h
index 88e24fa60a..7163d770fe 100644
--- a/src/lib/evas/include/evas_filter.h
+++ b/src/lib/evas/include/evas_filter.h
@@ -101,14 +101,18 @@ Evas_Filter_Context *evas_filter_context_new(Evas_Public_Data *evas);
101void evas_filter_context_destroy(Evas_Filter_Context *ctx); 101void evas_filter_context_destroy(Evas_Filter_Context *ctx);
102void evas_filter_context_post_run_callback_set(Evas_Filter_Context *ctx, Evas_Filter_Cb cb, void *data); 102void evas_filter_context_post_run_callback_set(Evas_Filter_Context *ctx, Evas_Filter_Cb cb, void *data);
103#define evas_filter_context_autodestroy(ctx) evas_filter_context_post_run_callback_set(ctx, ((Evas_Filter_Cb) evas_filter_context_destroy), ctx) 103#define evas_filter_context_autodestroy(ctx) evas_filter_context_post_run_callback_set(ctx, ((Evas_Filter_Cb) evas_filter_context_destroy), ctx)
104Eina_Bool evas_filter_context_buffers_allocate_all(Evas_Filter_Context *ctx, unsigned w, unsigned h);
104 105
105int evas_filter_buffer_empty_new(Evas_Filter_Context *ctx, Eina_Bool alpha_only); 106int evas_filter_buffer_empty_new(Evas_Filter_Context *ctx, Eina_Bool alpha_only);
106int evas_filter_buffer_image_new(Evas_Filter_Context *ctx, RGBA_Image *image); 107int evas_filter_buffer_image_new(Evas_Filter_Context *ctx, RGBA_Image *image);
107int evas_filter_buffer_data_new(Evas_Filter_Context *ctx, void *data, int w, int h, Eina_Bool alpha_only); 108//int evas_filter_buffer_data_new(Evas_Filter_Context *ctx, void *data, int w, int h, Eina_Bool alpha_only);
108#define evas_filter_buffer_alloc_new(ctx, w, h, a) evas_filter_buffer_data_new(ctx, NULL, w, h, a) 109#define evas_filter_buffer_alloc_new(ctx, w, h, a) evas_filter_buffer_data_new(ctx, NULL, w, h, a)
109void *evas_filter_buffer_backing_get(Evas_Filter_Context *ctx, int bufid); 110void *evas_filter_buffer_backing_get(Evas_Filter_Context *ctx, int bufid);
110void *evas_filter_buffer_backing_steal(Evas_Filter_Context *ctx, int bufid); 111void *evas_filter_buffer_backing_steal(Evas_Filter_Context *ctx, int bufid);
111Eina_Bool evas_filter_buffer_data_set(Evas_Filter_Context *ctx, int bufid, void *data, int w, int h, Eina_Bool alpha_only); 112Eina_Bool evas_filter_buffer_backing_release(Evas_Filter_Context *ctx, void *stolen_buffer);
113
114// Do not use
115EINA_DEPRECATED Eina_Bool evas_filter_buffer_data_set(Evas_Filter_Context *ctx, int bufid, void *data, int w, int h, Eina_Bool alpha_only);
112 116
113Eina_Bool evas_filter_run(Evas_Filter_Context *ctx, Eina_Bool do_async); 117Eina_Bool evas_filter_run(Evas_Filter_Context *ctx, Eina_Bool do_async);
114 118