summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLeandro Pereira <leandro@profusion.mobi>2012-12-18 16:28:55 +0000
committerLeandro Pereira <leandro@profusion.mobi>2012-12-18 16:28:55 +0000
commitcb10c7d01974b6afbc75839da4988f259335c1e0 (patch)
tree8c2e6ad72b786dac783c83b541dbcbe9c87b2133 /src
parent613659b1d8c398da3fe6e54b4f7c41840520e894 (diff)
evas: Modify software_generic and gl_x11 to with with threaded renderer
SVN revision: 81284
Diffstat (limited to 'src')
-rw-r--r--src/lib/evas/canvas/evas_object_image.c59
-rw-r--r--src/lib/evas/canvas/evas_object_line.c7
-rw-r--r--src/lib/evas/canvas/evas_object_polygon.c7
-rw-r--r--src/lib/evas/canvas/evas_object_rectangle.c7
-rw-r--r--src/lib/evas/canvas/evas_object_smart.c4
-rw-r--r--src/lib/evas/canvas/evas_object_text.c7
-rw-r--r--src/lib/evas/canvas/evas_object_textblock.c9
-rw-r--r--src/lib/evas/canvas/evas_object_textgrid.c13
-rw-r--r--src/lib/evas/canvas/evas_render.c31
-rw-r--r--src/lib/evas/include/evas_common.h3
-rw-r--r--src/lib/evas/include/evas_private.h14
-rw-r--r--src/modules/evas/engines/gl_x11/evas_engine.c14
-rw-r--r--src/modules/evas/engines/software_generic/evas_engine.c711
13 files changed, 788 insertions, 98 deletions
diff --git a/src/lib/evas/canvas/evas_object_image.c b/src/lib/evas/canvas/evas_object_image.c
index 5f2f02c..5913f36 100644
--- a/src/lib/evas/canvas/evas_object_image.c
+++ b/src/lib/evas/canvas/evas_object_image.c
@@ -111,7 +111,7 @@ static Evas_Coord evas_object_image_figure_y_fill(Evas_Object *eo_obj, Evas_Obje
111 111
112static void evas_object_image_init(Evas_Object *eo_obj); 112static void evas_object_image_init(Evas_Object *eo_obj);
113static void evas_object_image_new(Evas_Object *eo_obj); 113static void evas_object_image_new(Evas_Object *eo_obj);
114static void evas_object_image_render(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, void *output, void *context, void *surface, int x, int y); 114static void evas_object_image_render(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, void *output, void *context, void *surface, int x, int y, Eina_Bool do_async);
115static void evas_object_image_free(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj); 115static void evas_object_image_free(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj);
116static void evas_object_image_render_pre(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj); 116static void evas_object_image_render_pre(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj);
117static void evas_object_image_render_post(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj); 117static void evas_object_image_render_post(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj);
@@ -132,7 +132,7 @@ static void evas_object_image_filled_resize_listener(void *data, Evas *eo_e, Eva
132 132
133static void _proxy_unset(Evas_Object *proxy); 133static void _proxy_unset(Evas_Object *proxy);
134static void _proxy_set(Evas_Object *proxy, Evas_Object *src); 134static void _proxy_set(Evas_Object *proxy, Evas_Object *src);
135static void _proxy_error(Evas_Object *proxy, void *context, void *output, void *surface, int x, int y); 135static void _proxy_error(Evas_Object *proxy, void *context, void *output, void *surface, int x, int y, Eina_Bool do_async);
136 136
137static void _cleanup_tmpf(Evas_Object *eo_obj); 137static void _cleanup_tmpf(Evas_Object *eo_obj);
138 138
@@ -1272,6 +1272,9 @@ _image_data_get(Eo *eo_obj, void *_pd, va_list *list)
1272 } 1272 }
1273 1273
1274 Evas_Object_Protected_Data *obj = eo_data_get(eo_obj, EVAS_OBJ_CLASS); 1274 Evas_Object_Protected_Data *obj = eo_data_get(eo_obj, EVAS_OBJ_CLASS);
1275
1276 if (for_writing) evas_render_rendering_wait(obj->layer->evas);
1277
1275 data = NULL; 1278 data = NULL;
1276 if (obj->layer->evas->engine.func->image_scale_hint_set) 1279 if (obj->layer->evas->engine.func->image_scale_hint_set)
1277 obj->layer->evas->engine.func->image_scale_hint_set 1280 obj->layer->evas->engine.func->image_scale_hint_set
@@ -2744,7 +2747,7 @@ _proxy_set(Evas_Object *eo_proxy, Evas_Object *eo_src)
2744 */ 2747 */
2745static void 2748static void
2746_proxy_error(Evas_Object *eo_proxy, void *context, void *output, void *surface, 2749_proxy_error(Evas_Object *eo_proxy, void *context, void *output, void *surface,
2747 int x, int y) 2750 int x, int y, Eina_Bool do_async)
2748{ 2751{
2749 Evas_Func *func; 2752 Evas_Func *func;
2750 int r = rand() % 255; 2753 int r = rand() % 255;
@@ -2763,7 +2766,8 @@ _proxy_error(Evas_Object *eo_proxy, void *context, void *output, void *surface,
2763 func->rectangle_draw(output, context, surface, proxy->cur.geometry.x + x, 2766 func->rectangle_draw(output, context, surface, proxy->cur.geometry.x + x,
2764 proxy->cur.geometry.y + y, 2767 proxy->cur.geometry.y + y,
2765 proxy->cur.geometry.w, 2768 proxy->cur.geometry.w,
2766 proxy->cur.geometry.h); 2769 proxy->cur.geometry.h,
2770 do_async);
2767 return; 2771 return;
2768} 2772}
2769 2773
@@ -2808,7 +2812,7 @@ _proxy_subrender_recurse(Evas_Object *eo_obj, Evas_Object *clip, void *output, v
2808 * Used to force a draw if necessary, else just makes sures it's available. 2812 * Used to force a draw if necessary, else just makes sures it's available.
2809 */ 2813 */
2810static void 2814static void
2811_proxy_subrender(Evas *eo_e, Evas_Object *eo_source) 2815_proxy_subrender(Evas *eo_e, Evas_Object *eo_source, Eina_Bool do_async)
2812{ 2816{
2813 Evas_Public_Data *e = eo_data_get(eo_e, EVAS_CLASS); 2817 Evas_Public_Data *e = eo_data_get(eo_e, EVAS_CLASS);
2814 void *ctx; 2818 void *ctx;
@@ -2848,7 +2852,8 @@ _proxy_subrender(Evas *eo_e, Evas_Object *eo_source)
2848 e->engine.func->context_color_set(e->engine.data.output, ctx, 0, 0, 0, 0); 2852 e->engine.func->context_color_set(e->engine.data.output, ctx, 0, 0, 0, 0);
2849 e->engine.func->context_render_op_set(e->engine.data.output, ctx, EVAS_RENDER_COPY); 2853 e->engine.func->context_render_op_set(e->engine.data.output, ctx, EVAS_RENDER_COPY);
2850 e->engine.func->rectangle_draw(e->engine.data.output, ctx, 2854 e->engine.func->rectangle_draw(e->engine.data.output, ctx,
2851 source->proxy.surface, 0, 0, w, h); 2855 source->proxy.surface, 0, 0, w, h,
2856 do_async);
2852 e->engine.func->context_free(e->engine.data.output, ctx); 2857 e->engine.func->context_free(e->engine.data.output, ctx);
2853 2858
2854 ctx = e->engine.func->context_new(e->engine.data.output); 2859 ctx = e->engine.func->context_new(e->engine.data.output);
@@ -2859,7 +2864,7 @@ _proxy_subrender(Evas *eo_e, Evas_Object *eo_source)
2859#ifdef REND_DBG 2864#ifdef REND_DBG
2860 , 1 2865 , 1
2861#endif 2866#endif
2862 ); 2867 , do_async);
2863 2868
2864 e->engine.func->context_free(e->engine.data.output, ctx); 2869 e->engine.func->context_free(e->engine.data.output, ctx);
2865 source->proxy.surface = e->engine.func->image_dirty_region 2870 source->proxy.surface = e->engine.func->image_dirty_region
@@ -3130,7 +3135,7 @@ evas_object_image_free(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj)
3130} 3135}
3131 3136
3132static void 3137static void
3133evas_object_image_render(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, void *output, void *context, void *surface, int x, int y) 3138evas_object_image_render(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, void *output, void *context, void *surface, int x, int y, Eina_Bool do_async)
3134{ 3139{
3135 Evas_Object_Image *o = eo_data_get(eo_obj, MY_CLASS); 3140 Evas_Object_Image *o = eo_data_get(eo_obj, MY_CLASS);
3136 int imagew, imageh, uvw, uvh; 3141 int imagew, imageh, uvw, uvh;
@@ -3142,7 +3147,7 @@ evas_object_image_render(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, v
3142 /* Proxy sanity */ 3147 /* Proxy sanity */
3143 if (o->proxyrendering) 3148 if (o->proxyrendering)
3144 { 3149 {
3145 _proxy_error(eo_obj, context, output, surface, x, y); 3150 _proxy_error(eo_obj, context, output, surface, x, y, EINA_FALSE);
3146 return; 3151 return;
3147 } 3152 }
3148 3153
@@ -3163,9 +3168,10 @@ evas_object_image_render(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, v
3163 obj->cur.geometry.x + x, 3168 obj->cur.geometry.x + x,
3164 obj->cur.geometry.y + y, 3169 obj->cur.geometry.y + y,
3165 obj->cur.geometry.w, 3170 obj->cur.geometry.w,
3166 obj->cur.geometry.h); 3171 obj->cur.geometry.h,
3172 do_async);
3167 3173
3168 return ; 3174 return;
3169 } 3175 }
3170 3176
3171 obj->layer->evas->engine.func->context_color_set(output, 3177 obj->layer->evas->engine.func->context_color_set(output,
@@ -3225,7 +3231,7 @@ evas_object_image_render(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, v
3225 else 3231 else
3226 { 3232 {
3227 o->proxyrendering = EINA_TRUE; 3233 o->proxyrendering = EINA_TRUE;
3228 _proxy_subrender(obj->layer->evas->evas, o->cur.source); 3234 _proxy_subrender(obj->layer->evas->evas, o->cur.source, EINA_FALSE);
3229 pixels = source->proxy.surface; 3235 pixels = source->proxy.surface;
3230 imagew = source->proxy.w; 3236 imagew = source->proxy.w;
3231 imageh = source->proxy.h; 3237 imageh = source->proxy.h;
@@ -3278,7 +3284,8 @@ evas_object_image_render(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, v
3278 3284
3279 obj->layer->evas->engine.func->image_map_draw 3285 obj->layer->evas->engine.func->image_map_draw
3280 (output, context, surface, pixels, obj->spans, 3286 (output, context, surface, pixels, obj->spans,
3281 o->cur.smooth_scale | obj->cur.map->smooth, 0); 3287 o->cur.smooth_scale | obj->cur.map->smooth, 0,
3288 do_async);
3282 } 3289 }
3283 else 3290 else
3284 { 3291 {
@@ -3357,7 +3364,8 @@ evas_object_image_render(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, v
3357 obj->cur.geometry.x + ix + x, 3364 obj->cur.geometry.x + ix + x,
3358 obj->cur.geometry.y + iy + y, 3365 obj->cur.geometry.y + iy + y,
3359 iw, ih, 3366 iw, ih,
3360 o->cur.smooth_scale); 3367 o->cur.smooth_scale,
3368 do_async);
3361 } 3369 }
3362 else 3370 else
3363#endif 3371#endif
@@ -3369,7 +3377,8 @@ evas_object_image_render(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, v
3369 obj->cur.geometry.x + ix + x, 3377 obj->cur.geometry.x + ix + x,
3370 obj->cur.geometry.y + iy + y, 3378 obj->cur.geometry.y + iy + y,
3371 iw, ih, 3379 iw, ih,
3372 o->cur.smooth_scale); 3380 o->cur.smooth_scale,
3381 do_async);
3373 } 3382 }
3374 } 3383 }
3375 else 3384 else
@@ -3423,28 +3432,28 @@ evas_object_image_render(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, v
3423 inw = bl; inh = bt; 3432 inw = bl; inh = bt;
3424 outx = ox; outy = oy; 3433 outx = ox; outy = oy;
3425 outw = bsl; outh = bst; 3434 outw = bsl; outh = bst;
3426 obj->layer->evas->engine.func->image_draw(output, context, surface, pixels, inx, iny, inw, inh, outx, outy, outw, outh, o->cur.smooth_scale); 3435 obj->layer->evas->engine.func->image_draw(output, context, surface, pixels, inx, iny, inw, inh, outx, outy, outw, outh, o->cur.smooth_scale, do_async);
3427 // .## 3436 // .##
3428 // | 3437 // |
3429 inx = bl; iny = 0; 3438 inx = bl; iny = 0;
3430 inw = imw - bl - br; inh = bt; 3439 inw = imw - bl - br; inh = bt;
3431 outx = ox + bsl; outy = oy; 3440 outx = ox + bsl; outy = oy;
3432 outw = iw - bsl - bsr; outh = bst; 3441 outw = iw - bsl - bsr; outh = bst;
3433 obj->layer->evas->engine.func->image_draw(output, context, surface, pixels, inx, iny, inw, inh, outx, outy, outw, outh, o->cur.smooth_scale); 3442 obj->layer->evas->engine.func->image_draw(output, context, surface, pixels, inx, iny, inw, inh, outx, outy, outw, outh, o->cur.smooth_scale, do_async);
3434 // --# 3443 // --#
3435 // | 3444 // |
3436 inx = imw - br; iny = 0; 3445 inx = imw - br; iny = 0;
3437 inw = br; inh = bt; 3446 inw = br; inh = bt;
3438 outx = ox + iw - bsr; outy = oy; 3447 outx = ox + iw - bsr; outy = oy;
3439 outw = bsr; outh = bst; 3448 outw = bsr; outh = bst;
3440 obj->layer->evas->engine.func->image_draw(output, context, surface, pixels, inx, iny, inw, inh, outx, outy, outw, outh, o->cur.smooth_scale); 3449 obj->layer->evas->engine.func->image_draw(output, context, surface, pixels, inx, iny, inw, inh, outx, outy, outw, outh, o->cur.smooth_scale, do_async);
3441 // .-- 3450 // .--
3442 // # 3451 // #
3443 inx = 0; iny = bt; 3452 inx = 0; iny = bt;
3444 inw = bl; inh = imh - bt - bb; 3453 inw = bl; inh = imh - bt - bb;
3445 outx = ox; outy = oy + bst; 3454 outx = ox; outy = oy + bst;
3446 outw = bsl; outh = ih - bst - bsb; 3455 outw = bsl; outh = ih - bst - bsb;
3447 obj->layer->evas->engine.func->image_draw(output, context, surface, pixels, inx, iny, inw, inh, outx, outy, outw, outh, o->cur.smooth_scale); 3456 obj->layer->evas->engine.func->image_draw(output, context, surface, pixels, inx, iny, inw, inh, outx, outy, outw, outh, o->cur.smooth_scale, do_async);
3448 // .--. 3457 // .--.
3449 // |##| 3458 // |##|
3450 if (o->cur.border.fill > EVAS_BORDER_FILL_NONE) 3459 if (o->cur.border.fill > EVAS_BORDER_FILL_NONE)
@@ -3459,12 +3468,12 @@ evas_object_image_render(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, v
3459 { 3468 {
3460 obj->layer->evas->engine.func->context_render_op_set(output, context, 3469 obj->layer->evas->engine.func->context_render_op_set(output, context,
3461 EVAS_RENDER_COPY); 3470 EVAS_RENDER_COPY);
3462 obj->layer->evas->engine.func->image_draw(output, context, surface, pixels, inx, iny, inw, inh, outx, outy, outw, outh, o->cur.smooth_scale); 3471 obj->layer->evas->engine.func->image_draw(output, context, surface, pixels, inx, iny, inw, inh, outx, outy, outw, outh, o->cur.smooth_scale, do_async);
3463 obj->layer->evas->engine.func->context_render_op_set(output, context, 3472 obj->layer->evas->engine.func->context_render_op_set(output, context,
3464 obj->cur.render_op); 3473 obj->cur.render_op);
3465 } 3474 }
3466 else 3475 else
3467 obj->layer->evas->engine.func->image_draw(output, context, surface, pixels, inx, iny, inw, inh, outx, outy, outw, outh, o->cur.smooth_scale); 3476 obj->layer->evas->engine.func->image_draw(output, context, surface, pixels, inx, iny, inw, inh, outx, outy, outw, outh, o->cur.smooth_scale, do_async);
3468 } 3477 }
3469 // --. 3478 // --.
3470 // # 3479 // #
@@ -3472,28 +3481,28 @@ evas_object_image_render(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, v
3472 inw = br; inh = imh - bt - bb; 3481 inw = br; inh = imh - bt - bb;
3473 outx = ox + iw - bsr; outy = oy + bst; 3482 outx = ox + iw - bsr; outy = oy + bst;
3474 outw = bsr; outh = ih - bst - bsb; 3483 outw = bsr; outh = ih - bst - bsb;
3475 obj->layer->evas->engine.func->image_draw(output, context, surface, pixels, inx, iny, inw, inh, outx, outy, outw, outh, o->cur.smooth_scale); 3484 obj->layer->evas->engine.func->image_draw(output, context, surface, pixels, inx, iny, inw, inh, outx, outy, outw, outh, o->cur.smooth_scale, do_async);
3476 // | 3485 // |
3477 // #-- 3486 // #--
3478 inx = 0; iny = imh - bb; 3487 inx = 0; iny = imh - bb;
3479 inw = bl; inh = bb; 3488 inw = bl; inh = bb;
3480 outx = ox; outy = oy + ih - bsb; 3489 outx = ox; outy = oy + ih - bsb;
3481 outw = bsl; outh = bsb; 3490 outw = bsl; outh = bsb;
3482 obj->layer->evas->engine.func->image_draw(output, context, surface, pixels, inx, iny, inw, inh, outx, outy, outw, outh, o->cur.smooth_scale); 3491 obj->layer->evas->engine.func->image_draw(output, context, surface, pixels, inx, iny, inw, inh, outx, outy, outw, outh, o->cur.smooth_scale, do_async);
3483 // | 3492 // |
3484 // .## 3493 // .##
3485 inx = bl; iny = imh - bb; 3494 inx = bl; iny = imh - bb;
3486 inw = imw - bl - br; inh = bb; 3495 inw = imw - bl - br; inh = bb;
3487 outx = ox + bsl; outy = oy + ih - bsb; 3496 outx = ox + bsl; outy = oy + ih - bsb;
3488 outw = iw - bsl - bsr; outh = bsb; 3497 outw = iw - bsl - bsr; outh = bsb;
3489 obj->layer->evas->engine.func->image_draw(output, context, surface, pixels, inx, iny, inw, inh, outx, outy, outw, outh, o->cur.smooth_scale); 3498 obj->layer->evas->engine.func->image_draw(output, context, surface, pixels, inx, iny, inw, inh, outx, outy, outw, outh, o->cur.smooth_scale, do_async);
3490 // | 3499 // |
3491 // --# 3500 // --#
3492 inx = imw - br; iny = imh - bb; 3501 inx = imw - br; iny = imh - bb;
3493 inw = br; inh = bb; 3502 inw = br; inh = bb;
3494 outx = ox + iw - bsr; outy = oy + ih - bsb; 3503 outx = ox + iw - bsr; outy = oy + ih - bsb;
3495 outw = bsr; outh = bsb; 3504 outw = bsr; outh = bsb;
3496 obj->layer->evas->engine.func->image_draw(output, context, surface, pixels, inx, iny, inw, inh, outx, outy, outw, outh, o->cur.smooth_scale); 3505 obj->layer->evas->engine.func->image_draw(output, context, surface, pixels, inx, iny, inw, inh, outx, outy, outw, outh, o->cur.smooth_scale, do_async);
3497 } 3506 }
3498 idy += idh; 3507 idy += idh;
3499 if (dobreak_h) break; 3508 if (dobreak_h) break;
diff --git a/src/lib/evas/canvas/evas_object_line.c b/src/lib/evas/canvas/evas_object_line.c
index 76a6263..ac39fce 100644
--- a/src/lib/evas/canvas/evas_object_line.c
+++ b/src/lib/evas/canvas/evas_object_line.c
@@ -31,7 +31,7 @@ struct _Evas_Object_Line
31 31
32/* private methods for line objects */ 32/* private methods for line objects */
33static void evas_object_line_init(Evas_Object *eo_obj); 33static void evas_object_line_init(Evas_Object *eo_obj);
34static void evas_object_line_render(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, void *output, void *context, void *surface, int x, int y); 34static void evas_object_line_render(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, void *output, void *context, void *surface, int x, int y, Eina_Bool do_async);
35static void evas_object_line_render_pre(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj); 35static void evas_object_line_render_pre(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj);
36static void evas_object_line_render_post(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj); 36static void evas_object_line_render_post(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj);
37 37
@@ -253,7 +253,7 @@ _destructor(Eo *eo_obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
253} 253}
254 254
255static void 255static void
256evas_object_line_render(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, void *output, void *context, void *surface, int x, int y) 256evas_object_line_render(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, void *output, void *context, void *surface, int x, int y, Eina_Bool do_async)
257{ 257{
258 Evas_Object_Line *o = eo_data_get(eo_obj, MY_CLASS); 258 Evas_Object_Line *o = eo_data_get(eo_obj, MY_CLASS);
259 259
@@ -277,7 +277,8 @@ evas_object_line_render(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, vo
277 o->cur.cache.x1 + x, 277 o->cur.cache.x1 + x,
278 o->cur.cache.y1 + y, 278 o->cur.cache.y1 + y,
279 o->cur.cache.x2 + x, 279 o->cur.cache.x2 + x,
280 o->cur.cache.y2 + y); 280 o->cur.cache.y2 + y,
281 do_async);
281} 282}
282 283
283static void 284static void
diff --git a/src/lib/evas/canvas/evas_object_polygon.c b/src/lib/evas/canvas/evas_object_polygon.c
index 475c555..9e57b45 100644
--- a/src/lib/evas/canvas/evas_object_polygon.c
+++ b/src/lib/evas/canvas/evas_object_polygon.c
@@ -32,7 +32,7 @@ struct _Evas_Polygon_Point
32 32
33/* private methods for polygon objects */ 33/* private methods for polygon objects */
34static void evas_object_polygon_init(Evas_Object *eo_obj); 34static void evas_object_polygon_init(Evas_Object *eo_obj);
35static void evas_object_polygon_render(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, void *output, void *context, void *surface, int x, int y); 35static void evas_object_polygon_render(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, void *output, void *context, void *surface, int x, int y, Eina_Bool do_async);
36static void evas_object_polygon_free(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj); 36static void evas_object_polygon_free(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj);
37static void evas_object_polygon_render_pre(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj); 37static void evas_object_polygon_render_pre(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj);
38static void evas_object_polygon_render_post(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj); 38static void evas_object_polygon_render_post(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj);
@@ -297,7 +297,7 @@ evas_object_polygon_free(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj)
297} 297}
298 298
299static void 299static void
300evas_object_polygon_render(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, void *output, void *context, void *surface, int x, int y) 300evas_object_polygon_render(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, void *output, void *context, void *surface, int x, int y, Eina_Bool do_async)
301{ 301{
302 Evas_Object_Polygon *o = eo_data_get(eo_obj, MY_CLASS); 302 Evas_Object_Polygon *o = eo_data_get(eo_obj, MY_CLASS);
303 Eina_List *l; 303 Eina_List *l;
@@ -335,7 +335,8 @@ evas_object_polygon_render(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj,
335 context, 335 context,
336 surface, 336 surface,
337 o->engine_data, 337 o->engine_data,
338 o->offset.x + x, o->offset.y + y); 338 o->offset.x + x, o->offset.y + y,
339 do_async);
339} 340}
340 341
341static void 342static void
diff --git a/src/lib/evas/canvas/evas_object_rectangle.c b/src/lib/evas/canvas/evas_object_rectangle.c
index a90aeb7..1b132e5 100644
--- a/src/lib/evas/canvas/evas_object_rectangle.c
+++ b/src/lib/evas/canvas/evas_object_rectangle.c
@@ -22,7 +22,7 @@ struct _Evas_Object_Rectangle
22 22
23/* private methods for rectangle objects */ 23/* private methods for rectangle objects */
24static void evas_object_rectangle_init(Evas_Object *eo_obj); 24static void evas_object_rectangle_init(Evas_Object *eo_obj);
25static void evas_object_rectangle_render(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, void *output, void *context, void *surface, int x, int y); 25static void evas_object_rectangle_render(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, void *output, void *context, void *surface, int x, int y, Eina_Bool do_async);
26static void evas_object_rectangle_render_pre(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj); 26static void evas_object_rectangle_render_pre(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj);
27static void evas_object_rectangle_render_post(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj); 27static void evas_object_rectangle_render_post(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj);
28 28
@@ -122,7 +122,7 @@ _destructor(Eo *eo_obj, void *_obj EINA_UNUSED, va_list *list EINA_UNUSED)
122} 122}
123 123
124static void 124static void
125evas_object_rectangle_render(Evas_Object *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj, void *output, void *context, void *surface, int x, int y) 125evas_object_rectangle_render(Evas_Object *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj, void *output, void *context, void *surface, int x, int y, Eina_Bool do_async)
126{ 126{
127 /* render object to surface with context, and offxet by x,y */ 127 /* render object to surface with context, and offxet by x,y */
128 obj->layer->evas->engine.func->context_color_set(output, 128 obj->layer->evas->engine.func->context_color_set(output,
@@ -141,7 +141,8 @@ evas_object_rectangle_render(Evas_Object *eo_obj EINA_UNUSED, Evas_Object_Protec
141 obj->cur.geometry.x + x, 141 obj->cur.geometry.x + x,
142 obj->cur.geometry.y + y, 142 obj->cur.geometry.y + y,
143 obj->cur.geometry.w, 143 obj->cur.geometry.w,
144 obj->cur.geometry.h); 144 obj->cur.geometry.h,
145 do_async);
145//// obj->cur.cache.geometry.x + x, 146//// obj->cur.cache.geometry.x + x,
146//// obj->cur.cache.geometry.y + y, 147//// obj->cur.cache.geometry.y + y,
147//// obj->cur.cache.geometry.w, 148//// obj->cur.cache.geometry.w,
diff --git a/src/lib/evas/canvas/evas_object_smart.c b/src/lib/evas/canvas/evas_object_smart.c
index 9502aef..86a0f78 100644
--- a/src/lib/evas/canvas/evas_object_smart.c
+++ b/src/lib/evas/canvas/evas_object_smart.c
@@ -41,7 +41,7 @@ struct _Evas_Smart_Callback
41/* private methods for smart objects */ 41/* private methods for smart objects */
42static void evas_object_smart_callbacks_clear(Evas_Object *eo_obj); 42static void evas_object_smart_callbacks_clear(Evas_Object *eo_obj);
43static void evas_object_smart_init(Evas_Object *eo_obj); 43static void evas_object_smart_init(Evas_Object *eo_obj);
44static void evas_object_smart_render(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, void *output, void *context, void *surface, int x, int y); 44static void evas_object_smart_render(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, void *output, void *context, void *surface, int x, int y, Eina_Bool do_async);
45static void evas_object_smart_render_pre(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj); 45static void evas_object_smart_render_pre(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj);
46static void evas_object_smart_render_post(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj); 46static void evas_object_smart_render_post(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj);
47 47
@@ -1322,7 +1322,7 @@ evas_object_smart_init(Evas_Object *eo_obj)
1322} 1322}
1323 1323
1324static void 1324static void
1325evas_object_smart_render(Evas_Object *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj EINA_UNUSED, void *output EINA_UNUSED, void *context EINA_UNUSED, void *surface EINA_UNUSED, int x EINA_UNUSED, int y EINA_UNUSED) 1325evas_object_smart_render(Evas_Object *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj EINA_UNUSED, void *output EINA_UNUSED, void *context EINA_UNUSED, void *surface EINA_UNUSED, int x EINA_UNUSED, int y EINA_UNUSED, Eina_Bool do_async EINA_UNUSED)
1326{ 1326{
1327 return; 1327 return;
1328} 1328}
diff --git a/src/lib/evas/canvas/evas_object_text.c b/src/lib/evas/canvas/evas_object_text.c
index 0c410d1..2f0f229 100644
--- a/src/lib/evas/canvas/evas_object_text.c
+++ b/src/lib/evas/canvas/evas_object_text.c
@@ -66,7 +66,7 @@ struct _Evas_Object_Text_Item
66 66
67/* private methods for text objects */ 67/* private methods for text objects */
68static void evas_object_text_init(Evas_Object *eo_obj); 68static void evas_object_text_init(Evas_Object *eo_obj);
69static void evas_object_text_render(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, void *output, void *context, void *surface, int x, int y); 69static void evas_object_text_render(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, void *output, void *context, void *surface, int x, int y, Eina_Bool do_async);
70static void evas_object_text_free(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj); 70static void evas_object_text_free(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj);
71static void evas_object_text_render_pre(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj); 71static void evas_object_text_render_pre(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj);
72static void evas_object_text_render_post(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj); 72static void evas_object_text_render_post(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj);
@@ -1886,7 +1886,7 @@ evas_object_text_free(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj)
1886} 1886}
1887 1887
1888static void 1888static void
1889evas_object_text_render(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, void *output, void *context, void *surface, int x, int y) 1889evas_object_text_render(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, void *output, void *context, void *surface, int x, int y, Eina_Bool do_async)
1890{ 1890{
1891 int i, j; 1891 int i, j;
1892 Evas_Object_Text *o = eo_data_get(eo_obj, MY_CLASS); 1892 Evas_Object_Text *o = eo_data_get(eo_obj, MY_CLASS);
@@ -1977,7 +1977,8 @@ evas_object_text_render(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, vo
1977 obj->cur.geometry.h, \ 1977 obj->cur.geometry.h, \
1978 obj->cur.geometry.w, \ 1978 obj->cur.geometry.w, \
1979 obj->cur.geometry.h, \ 1979 obj->cur.geometry.h, \
1980 &it->text_props); 1980 &it->text_props, \
1981 do_async);
1981 1982
1982 /* shadows */ 1983 /* shadows */
1983 shad_dst = shad_sz = dx = dy = haveshad = 0; 1984 shad_dst = shad_sz = dx = dy = haveshad = 0;
diff --git a/src/lib/evas/canvas/evas_object_textblock.c b/src/lib/evas/canvas/evas_object_textblock.c
index fa7cad7..8ce1a6d 100644
--- a/src/lib/evas/canvas/evas_object_textblock.c
+++ b/src/lib/evas/canvas/evas_object_textblock.c
@@ -506,7 +506,7 @@ struct _Evas_Object_Textblock
506 506
507/* private methods for textblock objects */ 507/* private methods for textblock objects */
508static void evas_object_textblock_init(Evas_Object *eo_obj); 508static void evas_object_textblock_init(Evas_Object *eo_obj);
509static void evas_object_textblock_render(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, void *output, void *context, void *surface, int x, int y); 509static void evas_object_textblock_render(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, void *output, void *context, void *surface, int x, int y, Eina_Bool do_async);
510static void evas_object_textblock_free(Evas_Object *eo_obj); 510static void evas_object_textblock_free(Evas_Object *eo_obj);
511static void evas_object_textblock_render_pre(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj); 511static void evas_object_textblock_render_pre(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj);
512static void evas_object_textblock_render_post(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj); 512static void evas_object_textblock_render_post(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj);
@@ -9608,7 +9608,7 @@ evas_object_textblock_free(Evas_Object *eo_obj)
9608 9608
9609 9609
9610static void 9610static void
9611evas_object_textblock_render(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, void *output, void *context, void *surface, int x, int y) 9611evas_object_textblock_render(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, void *output, void *context, void *surface, int x, int y, Eina_Bool do_async)
9612{ 9612{
9613 Evas_Object_Textblock_Paragraph *par, *start = NULL; 9613 Evas_Object_Textblock_Paragraph *par, *start = NULL;
9614 Evas_Object_Textblock_Line *ln; 9614 Evas_Object_Textblock_Line *ln;
@@ -9703,7 +9703,7 @@ evas_object_textblock_render(Evas_Object *eo_obj, Evas_Object_Protected_Data *ob
9703 obj->cur.geometry.x + ln->x + ti->parent.x + x + (ox), \ 9703 obj->cur.geometry.x + ln->x + ti->parent.x + x + (ox), \
9704 obj->cur.geometry.y + ln->par->y + ln->y + yoff + y + (oy), \ 9704 obj->cur.geometry.y + ln->par->y + ln->y + yoff + y + (oy), \
9705 ti->parent.w, ti->parent.h, ti->parent.w, ti->parent.h, \ 9705 ti->parent.w, ti->parent.h, ti->parent.w, ti->parent.h, \
9706 &ti->text_props); 9706 &ti->text_props, do_async);
9707 9707
9708 /* backing */ 9708 /* backing */
9709#define DRAW_RECT(ox, oy, ow, oh, or, og, ob, oa) \ 9709#define DRAW_RECT(ox, oy, ow, oh, or, og, ob, oa) \
@@ -9721,7 +9721,8 @@ evas_object_textblock_render(Evas_Object *eo_obj, Evas_Object_Protected_Data *ob
9721 obj->cur.geometry.x + ln->x + x + (ox), \ 9721 obj->cur.geometry.x + ln->x + x + (ox), \
9722 obj->cur.geometry.y + ln->par->y + ln->y + y + (oy), \ 9722 obj->cur.geometry.y + ln->par->y + ln->y + y + (oy), \
9723 (ow), \ 9723 (ow), \
9724 (oh)); \ 9724 (oh), \
9725 do_async); \
9725 } \ 9726 } \
9726 while (0) 9727 while (0)
9727 9728
diff --git a/src/lib/evas/canvas/evas_object_textgrid.c b/src/lib/evas/canvas/evas_object_textgrid.c
index fcb6892..c82122e 100644
--- a/src/lib/evas/canvas/evas_object_textgrid.c
+++ b/src/lib/evas/canvas/evas_object_textgrid.c
@@ -114,7 +114,7 @@ struct _Evas_Object_Textgrid_Line
114 114
115/* private methods for textgrid objects */ 115/* private methods for textgrid objects */
116static void evas_object_textgrid_init(Evas_Object *eo_obj); 116static void evas_object_textgrid_init(Evas_Object *eo_obj);
117static void evas_object_textgrid_render(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, void *output, void *context, void *surface, int x, int y); 117static void evas_object_textgrid_render(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, void *output, void *context, void *surface, int x, int y, Eina_Bool do_async);
118static void evas_object_textgrid_render_pre(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj); 118static void evas_object_textgrid_render_pre(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj);
119static void evas_object_textgrid_render_post(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj); 119static void evas_object_textgrid_render_post(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj);
120 120
@@ -551,7 +551,7 @@ evas_object_textgrid_row_line_append(Evas_Object_Textgrid_Row *row, int x, int w
551} 551}
552 552
553static void 553static void
554evas_object_textgrid_render(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, void *output, void *context, void *surface, int x, int y) 554evas_object_textgrid_render(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, void *output, void *context, void *surface, int x, int y, Eina_Bool do_async)
555{ 555{
556 Evas_Textgrid_Cell *cells; 556 Evas_Textgrid_Cell *cells;
557 Evas_Object_Textgrid_Color *c; 557 Evas_Object_Textgrid_Color *c;
@@ -670,7 +670,8 @@ evas_object_textgrid_render(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj
670 row->rects[xx].b, row->rects[xx].a); 670 row->rects[xx].b, row->rects[xx].a);
671 ENFN->rectangle_draw(output, context, surface, 671 ENFN->rectangle_draw(output, context, surface,
672 xp + row->rects[xx].x, yp, 672 xp + row->rects[xx].x, yp,
673 row->rects[xx].w, h); 673 row->rects[xx].w, h,
674 do_async);
674 } 675 }
675 for (xx = 0; xx < row->texts_num; xx++) 676 for (xx = 0; xx < row->texts_num; xx++)
676 { 677 {
@@ -680,7 +681,8 @@ evas_object_textgrid_render(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj
680 ENFN->font_draw(output, context, surface, o->font, 681 ENFN->font_draw(output, context, surface, o->font,
681 xp + row->texts[xx].x, yp + o->max_ascent, 682 xp + row->texts[xx].x, yp + o->max_ascent,
682 ww, hh, ww, hh, 683 ww, hh, ww, hh,
683 evas_object_textgrid_textprop_int_to(o, row->texts[xx].text_props)); 684 evas_object_textgrid_textprop_int_to(o, row->texts[xx].text_props),
685 do_async);
684 } 686 }
685 for (xx = 0; xx < row->lines_num; xx++) 687 for (xx = 0; xx < row->lines_num; xx++)
686 { 688 {
@@ -689,7 +691,8 @@ evas_object_textgrid_render(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj
689 row->lines[xx].b, row->lines[xx].a); 691 row->lines[xx].b, row->lines[xx].a);
690 ENFN->rectangle_draw(output, context, surface, 692 ENFN->rectangle_draw(output, context, surface,
691 xp + row->lines[xx].x, yp + row->lines[xx].y, 693 xp + row->lines[xx].x, yp + row->lines[xx].y,
692 row->lines[xx].w, 1); 694 row->lines[xx].w, 1,
695 do_async);
693 } 696 }
694 yp += h; 697 yp += h;
695 } 698 }
diff --git a/src/lib/evas/canvas/evas_render.c b/src/lib/evas/canvas/evas_render.c
index eb4f823..7e1f80b 100644
--- a/src/lib/evas/canvas/evas_render.c
+++ b/src/lib/evas/canvas/evas_render.c
@@ -49,8 +49,15 @@ rend_dbg(const char *txt)
49#define RDI(x) 49#define RDI(x)
50#endif 50#endif
51 51
52static Eina_List * 52typedef struct _Render_Updates Render_Updates;
53evas_render_updates_internal(Evas *eo_e, unsigned char make_updates, unsigned char do_draw); 53struct _Render_Updates
54{
55 void *surface;
56 Eina_Rectangle *area;
57};
58
59static Eina_Bool
60evas_render_updates_internal(Evas *eo_e, unsigned char make_updates, unsigned char do_draw, Evas_Render_Done_Cb done_func, void *done_data, Eina_Bool do_async);
54 61
55EAPI void 62EAPI void
56evas_damage_rectangle_add(Evas *eo_e, int x, int y, int w, int h) 63evas_damage_rectangle_add(Evas *eo_e, int x, int y, int w, int h)
@@ -870,7 +877,7 @@ evas_render_mapped(Evas_Public_Data *e, Evas_Object *eo_obj,
870#ifdef REND_DBG 877#ifdef REND_DBG
871 , int level 878 , int level
872#endif 879#endif
873 ) 880 , Eina_Bool do_async)
874{ 881{
875 void *ctx; 882 void *ctx;
876 Evas_Object_Protected_Data *obj2; 883 Evas_Object_Protected_Data *obj2;
@@ -1007,7 +1014,8 @@ evas_render_mapped(Evas_Public_Data *e, Evas_Object *eo_obj,
1007 obj->map.surface, 1014 obj->map.surface,
1008 0, 0, 1015 0, 0,
1009 obj->map.surface_w, 1016 obj->map.surface_w,
1010 obj->map.surface_h); 1017 obj->map.surface_h,
1018 EINA_FALSE);
1011 e->engine.func->context_free(e->engine.data.output, ctx); 1019 e->engine.func->context_free(e->engine.data.output, ctx);
1012 } 1020 }
1013 ctx = e->engine.func->context_new(e->engine.data.output); 1021 ctx = e->engine.func->context_new(e->engine.data.output);
@@ -1027,7 +1035,7 @@ evas_render_mapped(Evas_Public_Data *e, Evas_Object *eo_obj,
1027#ifdef REND_DBG 1035#ifdef REND_DBG
1028 , level + 1 1036 , level + 1
1029#endif 1037#endif
1030 ); 1038 , do_async);
1031 } 1039 }
1032 } 1040 }
1033 else 1041 else
@@ -1045,7 +1053,8 @@ evas_render_mapped(Evas_Public_Data *e, Evas_Object *eo_obj,
1045 e->engine.func->context_clip_set(e->engine.data.output, 1053 e->engine.func->context_clip_set(e->engine.data.output,
1046 ctx, x, y, w, h); 1054 ctx, x, y, w, h);
1047 obj->func->render(eo_obj, obj, e->engine.data.output, ctx, 1055 obj->func->render(eo_obj, obj, e->engine.data.output, ctx,
1048 obj->map.surface, off_x2, off_y2); 1056 obj->map.surface, off_x2, off_y2,
1057 EINA_FALSE);
1049 } 1058 }
1050 e->engine.func->context_free(e->engine.data.output, ctx); 1059 e->engine.func->context_free(e->engine.data.output, ctx);
1051 rendered = EINA_TRUE; 1060 rendered = EINA_TRUE;
@@ -1107,7 +1116,7 @@ evas_render_mapped(Evas_Public_Data *e, Evas_Object *eo_obj,
1107 obj->layer->evas->engine.func->image_map_draw 1116 obj->layer->evas->engine.func->image_map_draw
1108 (e->engine.data.output, context, surface, 1117 (e->engine.data.output, context, surface,
1109 obj->map.surface, obj->spans, 1118 obj->map.surface, obj->spans,
1110 obj->cur.map->smooth, 0); 1119 obj->cur.map->smooth, 0, do_async);
1111 } 1120 }
1112 // FIXME: needs to cache these maps and 1121 // FIXME: needs to cache these maps and
1113 // keep them only rendering updates 1122 // keep them only rendering updates
@@ -1140,7 +1149,7 @@ evas_render_mapped(Evas_Public_Data *e, Evas_Object *eo_obj,
1140#ifdef REND_DBG 1149#ifdef REND_DBG
1141 , level + 1 1150 , level + 1
1142#endif 1151#endif
1143 ); 1152 , do_async);
1144 } 1153 }
1145 } 1154 }
1146 else 1155 else
@@ -1185,7 +1194,7 @@ evas_render_mapped(Evas_Public_Data *e, Evas_Object *eo_obj,
1185 ctx, x, y, w, h); 1194 ctx, x, y, w, h);
1186 } 1195 }
1187 obj->func->render(eo_obj, obj, e->engine.data.output, ctx, 1196 obj->func->render(eo_obj, obj, e->engine.data.output, ctx,
1188 surface, off_x, off_y); 1197 surface, off_x, off_y, EINA_FALSE);
1189 } 1198 }
1190 e->engine.func->context_free(e->engine.data.output, ctx); 1199 e->engine.func->context_free(e->engine.data.output, ctx);
1191 } 1200 }
@@ -1217,7 +1226,7 @@ evas_render_mapped(Evas_Public_Data *e, Evas_Object *eo_obj,
1217 RDI(level); 1226 RDI(level);
1218 RD(" draw normal obj\n"); 1227 RD(" draw normal obj\n");
1219 obj->func->render(eo_obj, obj, e->engine.data.output, context, surface, 1228 obj->func->render(eo_obj, obj, e->engine.data.output, context, surface,
1220 off_x, off_y); 1229 off_x, off_y, do_async);
1221 } 1230 }
1222 if (obj->changed_map) clean_them = EINA_TRUE; 1231 if (obj->changed_map) clean_them = EINA_TRUE;
1223 } 1232 }
@@ -1607,7 +1616,7 @@ evas_render_updates_internal(Evas *eo_e,
1607 e->engine.func->rectangle_draw(e->engine.data.output, 1616 e->engine.func->rectangle_draw(e->engine.data.output,
1608 e->engine.data.context, 1617 e->engine.data.context,
1609 surface, 1618 surface,
1610 cx, cy, cw, ch); 1619 cx, cy, cw, ch, do_async);
1611 e->engine.func->context_cutout_clear(e->engine.data.output, 1620 e->engine.func->context_cutout_clear(e->engine.data.output,
1612 e->engine.data.context); 1621 e->engine.data.context);
1613 e->engine.func->context_clip_unset(e->engine.data.output, 1622 e->engine.func->context_clip_unset(e->engine.data.output,
diff --git a/src/lib/evas/include/evas_common.h b/src/lib/evas/include/evas_common.h
index 5b231ac..15c1d3a 100644
--- a/src/lib/evas/include/evas_common.h
+++ b/src/lib/evas/include/evas_common.h
@@ -428,6 +428,9 @@ typedef void (*Gfx_Func_Copy) (DATA32 *src, DATA32 *dst, int len);
428 428
429typedef void (*Gfx_Func_Convert) (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal); 429typedef void (*Gfx_Func_Convert) (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal);
430 430
431
432typedef void (*Evas_Render_Done_Cb)(void *);
433
431#include "../cache/evas_cache.h" 434#include "../cache/evas_cache.h"
432#ifdef EVAS_CSERVE2 435#ifdef EVAS_CSERVE2
433#include "../cache2/evas_cache2.h" 436#include "../cache2/evas_cache2.h"
diff --git a/src/lib/evas/include/evas_private.h b/src/lib/evas/include/evas_private.h
index 8f68171..56ddc4c 100644
--- a/src/lib/evas/include/evas_private.h
+++ b/src/lib/evas/include/evas_private.h
@@ -795,13 +795,13 @@ struct _Evas_Func
795 void (*context_render_op_set) (void *data, void *context, int render_op); 795 void (*context_render_op_set) (void *data, void *context, int render_op);
796 int (*context_render_op_get) (void *data, void *context); 796 int (*context_render_op_get) (void *data, void *context);
797 797
798 void (*rectangle_draw) (void *data, void *context, void *surface, int x, int y, int w, int h); 798 void (*rectangle_draw) (void *data, void *context, void *surface, int x, int y, int w, int h, Eina_Bool do_async);
799 799
800 void (*line_draw) (void *data, void *context, void *surface, int x1, int y1, int x2, int y2); 800 void (*line_draw) (void *data, void *context, void *surface, int x1, int y1, int x2, int y2, Eina_Bool do_async);
801 801
802 void *(*polygon_point_add) (void *data, void *context, void *polygon, int x, int y); 802 void *(*polygon_point_add) (void *data, void *context, void *polygon, int x, int y);
803 void *(*polygon_points_clear) (void *data, void *context, void *polygon); 803 void *(*polygon_points_clear) (void *data, void *context, void *polygon);
804 void (*polygon_draw) (void *data, void *context, void *surface, void *polygon, int x, int y); 804 void (*polygon_draw) (void *data, void *context, void *surface, void *polygon, int x, int y, Eina_Bool do_async);
805 805
806 void *(*image_load) (void *data, const char *file, const char *key, int *error, Evas_Image_Load_Opts *lo); 806 void *(*image_load) (void *data, const char *file, const char *key, int *error, Evas_Image_Load_Opts *lo);
807 void *(*image_new_from_data) (void *data, int w, int h, DATA32 *image_data, int alpha, int cspace); 807 void *(*image_new_from_data) (void *data, int w, int h, DATA32 *image_data, int alpha, int cspace);
@@ -819,7 +819,7 @@ struct _Evas_Func
819 int (*image_alpha_get) (void *data, void *image); 819 int (*image_alpha_get) (void *data, void *image);
820 void *(*image_border_set) (void *data, void *image, int l, int r, int t, int b); 820 void *(*image_border_set) (void *data, void *image, int l, int r, int t, int b);
821 void (*image_border_get) (void *data, void *image, int *l, int *r, int *t, int *b); 821 void (*image_border_get) (void *data, void *image, int *l, int *r, int *t, int *b);
822 void (*image_draw) (void *data, void *context, void *surface, void *image, int src_x, int src_y, int src_w, int src_h, int dst_x, int dst_y, int dst_w, int dst_h, int smooth); 822 void (*image_draw) (void *data, void *context, void *surface, void *image, int src_x, int src_y, int src_w, int src_h, int dst_x, int dst_y, int dst_w, int dst_h, int smooth, Eina_Bool do_async);
823 char *(*image_comment_get) (void *data, void *image, char *key); 823 char *(*image_comment_get) (void *data, void *image, char *key);
824 char *(*image_format_get) (void *data, void *image); 824 char *(*image_format_get) (void *data, void *image);
825 void (*image_colorspace_set) (void *data, void *image, int cspace); 825 void (*image_colorspace_set) (void *data, void *image, int cspace);
@@ -847,7 +847,7 @@ struct _Evas_Func
847 int (*font_v_advance_get) (void *data, Evas_Font_Set *font, const Evas_Text_Props *intl_props); 847 int (*font_v_advance_get) (void *data, Evas_Font_Set *font, const Evas_Text_Props *intl_props);
848 int (*font_char_coords_get) (void *data, Evas_Font_Set *font, const Evas_Text_Props *intl_props, int pos, int *cx, int *cy, int *cw, int *ch); 848 int (*font_char_coords_get) (void *data, Evas_Font_Set *font, const Evas_Text_Props *intl_props, int pos, int *cx, int *cy, int *cw, int *ch);
849 int (*font_char_at_coords_get) (void *data, Evas_Font_Set *font, const Evas_Text_Props *intl_props, int x, int y, int *cx, int *cy, int *cw, int *ch); 849 int (*font_char_at_coords_get) (void *data, Evas_Font_Set *font, const Evas_Text_Props *intl_props, int x, int y, int *cx, int *cy, int *cw, int *ch);
850 void (*font_draw) (void *data, void *context, void *surface, Evas_Font_Set *font, int x, int y, int w, int h, int ow, int oh, Evas_Text_Props *intl_props); 850 void (*font_draw) (void *data, void *context, void *surface, Evas_Font_Set *font, int x, int y, int w, int h, int ow, int oh, Evas_Text_Props *intl_props, Eina_Bool do_async);
851 851
852 void (*font_cache_flush) (void *data); 852 void (*font_cache_flush) (void *data);
853 void (*font_cache_set) (void *data, int bytes); 853 void (*font_cache_set) (void *data, int bytes);
@@ -864,7 +864,7 @@ struct _Evas_Func
864 int (*image_scale_hint_get) (void *data, void *image); 864 int (*image_scale_hint_get) (void *data, void *image);
865 int (*font_last_up_to_pos) (void *data, Evas_Font_Set *font, const Evas_Text_Props *intl_props, int x, int y); 865 int (*font_last_up_to_pos) (void *data, Evas_Font_Set *font, const Evas_Text_Props *intl_props, int x, int y);
866 866
867 void (*image_map_draw) (void *data, void *context, void *surface, void *image, RGBA_Map *m, int smooth, int level); 867 void (*image_map_draw) (void *data, void *context, void *surface, void *image, RGBA_Map *m, int smooth, int level, Eina_Bool do_async);
868 void *(*image_map_surface_new) (void *data, int w, int h, int alpha); 868 void *(*image_map_surface_new) (void *data, int w, int h, int alpha);
869 void (*image_map_surface_free) (void *data, void *surface); 869 void (*image_map_surface_free) (void *data, void *surface);
870 void (*image_map_clean) (void *data, RGBA_Map *m); 870 void (*image_map_clean) (void *data, RGBA_Map *m);
@@ -1207,7 +1207,7 @@ Eina_Bool evas_render_mapped(Evas_Public_Data *e, Evas_Object *obj,
1207#ifdef REND_DBG 1207#ifdef REND_DBG
1208 , int level 1208 , int level
1209#endif 1209#endif
1210 ); 1210 , Eina_Bool do_async);
1211void evas_render_invalidate(Evas *e); 1211void evas_render_invalidate(Evas *e);
1212void evas_render_object_recalc(Evas_Object *obj); 1212void evas_render_object_recalc(Evas_Object *obj);
1213 1213
diff --git a/src/modules/evas/engines/gl_x11/evas_engine.c b/src/modules/evas/engines/gl_x11/evas_engine.c
index 35bbd95..63dd919 100644
--- a/src/modules/evas/engines/gl_x11/evas_engine.c
+++ b/src/modules/evas/engines/gl_x11/evas_engine.c
@@ -1293,7 +1293,7 @@ eng_context_cutout_clear(void *data EINA_UNUSED, void *context)
1293} 1293}
1294 1294
1295static void 1295static void
1296eng_rectangle_draw(void *data, void *context, void *surface, int x, int y, int w, int h) 1296eng_rectangle_draw(void *data, void *context, void *surface, int x, int y, int w, int h, Eina_Bool do_async EINA_UNUSED)
1297{ 1297{
1298 Render_Engine *re; 1298 Render_Engine *re;
1299 1299
@@ -1305,7 +1305,7 @@ eng_rectangle_draw(void *data, void *context, void *surface, int x, int y, int w
1305} 1305}
1306 1306
1307static void 1307static void
1308eng_line_draw(void *data, void *context, void *surface, int p1x, int p1y, int p2x, int p2y) 1308eng_line_draw(void *data, void *context, void *surface, int p1x, int p1y, int p2x, int p2y, Eina_Bool do_async EINA_UNUSED)
1309{ 1309{
1310 Render_Engine *re; 1310 Render_Engine *re;
1311 1311
@@ -1337,7 +1337,7 @@ eng_polygon_points_clear(void *data, void *context EINA_UNUSED, void *polygon)
1337} 1337}
1338 1338
1339static void 1339static void
1340eng_polygon_draw(void *data, void *context, void *surface EINA_UNUSED, void *polygon, int x, int y) 1340eng_polygon_draw(void *data, void *context, void *surface EINA_UNUSED, void *polygon, int x, int y, Eina_Bool do_async EINA_UNUSED)
1341{ 1341{
1342 Render_Engine *re; 1342 Render_Engine *re;
1343 1343
@@ -2430,7 +2430,7 @@ eng_image_data_preload_cancel(void *data EINA_UNUSED, void *image, const void *t
2430} 2430}
2431 2431
2432static void 2432static void
2433eng_image_draw(void *data, void *context, void *surface, void *image, int src_x, int src_y, int src_w, int src_h, int dst_x, int dst_y, int dst_w, int dst_h, int smooth) 2433eng_image_draw(void *data, void *context, void *surface, void *image, int src_x, int src_y, int src_w, int src_h, int dst_x, int dst_y, int dst_w, int dst_h, int smooth, Eina_Bool do_async EINA_UNUSED)
2434{ 2434{
2435 Render_Engine *re; 2435 Render_Engine *re;
2436 re = (Render_Engine *)data; 2436 re = (Render_Engine *)data;
@@ -2474,7 +2474,7 @@ eng_image_scale_hint_get(void *data EINA_UNUSED, void *image)
2474} 2474}
2475 2475
2476static void 2476static void
2477eng_image_map_draw(void *data, void *context, void *surface, void *image, RGBA_Map *m, int smooth, int level) 2477eng_image_map_draw(void *data, void *context, void *surface, void *image, RGBA_Map *m, int smooth, int level, Eina_Bool do_async)
2478{ 2478{
2479 Evas_GL_Image *gim = image; 2479 Evas_GL_Image *gim = image;
2480 Render_Engine *re; 2480 Render_Engine *re;
@@ -2515,7 +2515,7 @@ eng_image_map_draw(void *data, void *context, void *surface, void *image, RGBA_M
2515 dw = (m->pts[2].x >> FP) - dx; 2515 dw = (m->pts[2].x >> FP) - dx;
2516 dh = (m->pts[2].y >> FP) - dy; 2516 dh = (m->pts[2].y >> FP) - dy;
2517 eng_image_draw(data, context, surface, image, 2517 eng_image_draw(data, context, surface, image,
2518 0, 0, gim->w, gim->h, dx, dy, dw, dh, smooth); 2518 0, 0, gim->w, gim->h, dx, dy, dw, dh, smooth, do_async);
2519 } 2519 }
2520 else 2520 else
2521 { 2521 {
@@ -2602,7 +2602,7 @@ eng_image_stride_get(void *data EINA_UNUSED, void *image, int *stride)
2602} 2602}
2603 2603
2604static void 2604static void
2605eng_font_draw(void *data, void *context, void *surface, Evas_Font_Set *font EINA_UNUSED, int x, int y, int w EINA_UNUSED, int h EINA_UNUSED, int ow EINA_UNUSED, int oh EINA_UNUSED, Evas_Text_Props *intl_props) 2605eng_font_draw(void *data, void *context, void *surface, Evas_Font_Set *font EINA_UNUSED, int x, int y, int w EINA_UNUSED, int h EINA_UNUSED, int ow EINA_UNUSED, int oh EINA_UNUSED, Evas_Text_Props *intl_props, Eina_Bool do_async EINA_UNUSED)
2606{ 2606{
2607 Render_Engine *re; 2607 Render_Engine *re;
2608 2608
diff --git a/src/modules/evas/engines/software_generic/evas_engine.c b/src/modules/evas/engines/software_generic/evas_engine.c
index e16795d..6b8fa8b 100644
--- a/src/modules/evas/engines/software_generic/evas_engine.c
+++ b/src/modules/evas/engines/software_generic/evas_engine.c
@@ -1,5 +1,6 @@
1#include "evas_common.h" /* Also includes international specific stuff */ 1#include "evas_common.h" /* Also includes international specific stuff */
2#include "evas_private.h" 2#include "evas_private.h"
3#include "evas_blend_private.h"
3#ifdef EVAS_CSERVE2 4#ifdef EVAS_CSERVE2
4#include "evas_cs2_private.h" 5#include "evas_cs2_private.h"
5#endif 6#endif
@@ -273,6 +274,83 @@ static void (*_sym_glViewport) (GLint x, GLint
273/* static void (*_sym_glProgramParameteri) (GLuint a, GLuint b, GLint d) = NULL; */ 274/* static void (*_sym_glProgramParameteri) (GLuint a, GLuint b, GLint d) = NULL; */
274#endif 275#endif
275 276
277// Threaded Render
278
279typedef struct _Evas_Thread_Command_Rect Evas_Thread_Command_Rect;
280typedef struct _Evas_Thread_Command_Line Evas_Thread_Command_Line;
281typedef struct _Evas_Thread_Command_Polygon Evas_Thread_Command_Polygon;
282typedef struct _Evas_Thread_Command_Image Evas_Thread_Command_Image;
283typedef struct _Evas_Thread_Command_Font Evas_Thread_Command_Font;
284typedef struct _Evas_Thread_Command_Map Evas_Thread_Command_Map;
285
286struct _Evas_Thread_Command_Rect
287{
288 void *surface;
289 DATA32 color;
290 int render_op;
291 int x, y, w, h;
292};
293
294struct _Evas_Thread_Command_Line
295{
296 void *surface;
297 Eina_Rectangle clip;
298 DATA32 color;
299 int render_op;
300 Eina_Bool anti_alias;
301 int x1, y1;
302 int x2, y2;
303};
304
305struct _Evas_Thread_Command_Polygon
306{
307 Eina_Rectangle ext;
308 DATA32 col;
309 int render_op;
310 void *surface;
311 RGBA_Polygon_Point *points;
312 int x, y;
313};
314
315struct _Evas_Thread_Command_Image
316{
317 void *surface;
318 void *image;
319 Eina_Rectangle src, dst, clip;
320 DATA32 mul_col;
321 int render_op;
322 int smooth;
323};
324
325struct _Evas_Thread_Command_Font
326{
327 RGBA_Image *dst;
328 int x;
329 int y;
330 Evas_Glyph_Array *glyphs;
331 RGBA_Gfx_Func func;
332 void *gl_new;
333 void *gl_free;
334 void *gl_draw;
335 void *font_ext_data;
336 DATA32 col;
337 Eina_Bool clip_use : 1;
338 Eina_Rectangle clip_rect, ext;
339 int im_w, im_h;
340};
341
342struct _Evas_Thread_Command_Map
343{
344 void *image;
345 RGBA_Draw_Context image_ctx;
346 void *surface;
347 Eina_Rectangle clip;
348 DATA32 mul_col;
349 int render_op;
350 RGBA_Map *map;
351 int smooth, level, offset;
352};
353
276/* 354/*
277 ***** 355 *****
278 ** 356 **
@@ -416,33 +494,154 @@ eng_context_render_op_get(void *data EINA_UNUSED, void *context)
416 return ((RGBA_Draw_Context *)context)->render_op; 494 return ((RGBA_Draw_Context *)context)->render_op;
417} 495}
418 496
497static void
498_draw_thread_rectangle_draw(void *data)
499{
500 Evas_Thread_Command_Rect *rect = data;
419 501
502 evas_common_rectangle_rgba_draw(rect->surface,
503 rect->color, rect->render_op,
504 rect->x, rect->y, rect->w, rect->h);
505}
420 506
421static void 507static void
422eng_rectangle_draw(void *data EINA_UNUSED, void *context, void *surface, int x, int y, int w, int h) 508_draw_rectangle_thread_cmd(RGBA_Image *dst, RGBA_Draw_Context *dc, int x, int y, int w, int h)
423{ 509{
510 Evas_Thread_Command_Rect cr;
511
512 RECTS_CLIP_TO_RECT(x, y, w, h, dc->clip.x, dc->clip.y, dc->clip.w, dc->clip.h);
513 if ((w <= 0) || (h <= 0)) return;
514
515 cr.surface = dst;
516 cr.color = dc->col.col;
517 cr.render_op = dc->render_op;
518 cr.x = x;
519 cr.y = y;
520 cr.w = w;
521 cr.h = h;
522
523 evas_thread_cmd_enqueue(_draw_thread_rectangle_draw, &cr, sizeof(cr));
524}
525
526static void
527eng_rectangle_draw(void *data EINA_UNUSED, void *context, void *surface, int x, int y, int w, int h, Eina_Bool do_async)
528{
529 if (do_async)
530 evas_common_rectangle_draw_cb(surface, context, x, y, w, h,
531 _draw_rectangle_thread_cmd);
424#ifdef BUILD_PIPE_RENDER 532#ifdef BUILD_PIPE_RENDER
425 if ((cpunum > 1)) 533 else if ((cpunum > 1))
426 evas_common_pipe_rectangle_draw(surface, context, x, y, w, h); 534 evas_common_pipe_rectangle_draw(surface, context, x, y, w, h);
427 else
428#endif 535#endif
536 else
429 { 537 {
430 evas_common_rectangle_draw(surface, context, x, y, w, h); 538 evas_common_rectangle_draw(surface, context, x, y, w, h);
431 evas_common_cpu_end_opt(); 539 evas_common_cpu_end_opt();
540 }
541}
542
543static void
544_draw_thread_line_draw(void *data)
545{
546 Evas_Thread_Command_Line *line = data;
547 int clip_x, clip_y, clip_w, clip_h;
548
549 clip_x = line->clip.x;
550 clip_y = line->clip.y;
551 clip_w = line->clip.w;
552 clip_h = line->clip.h;
553
554 if ((line->x1 == line->x2) && (line->y1 == line->y2))
555 {
556 evas_common_line_point_draw(line->surface,
557 clip_x, clip_y, clip_w, clip_h,
558 line->color, line->render_op,
559 line->x1, line->y1);
560 return;
432 } 561 }
562
563 if (line->anti_alias)
564 evas_common_line_draw_line_aa
565 (line->surface,
566 clip_x, clip_y, clip_w, clip_h,
567 line->color, line->render_op,
568 line->x1, line->y1,
569 line->x2, line->y2);
570 else
571 evas_common_line_draw_line
572 (line->surface,
573 clip_x, clip_y, clip_w, clip_h,
574 line->color, line->render_op,
575 line->x1, line->y1,
576 line->x2, line->y2);
433} 577}
434 578
435static void 579static void
436eng_line_draw(void *data EINA_UNUSED, void *context, void *surface, int x1, int y1, int x2, int y2) 580_line_draw_thread_cmd(RGBA_Image *dst, RGBA_Draw_Context *dc, int x1, int y1, int x2, int y2)
437{ 581{
582 Evas_Thread_Command_Line cl;
583 int clx, cly, clw, clh;
584 int cx, cy, cw, ch;
585 int x, y, w, h;
586
587 cl.surface = dst;
588
589 if ((x1 == x2) && (y1 == y2))
590 {
591 EINA_RECTANGLE_SET(&cl.clip,
592 dc->clip.x, dc->clip.y, dc->clip.w, dc->clip.h);
593 goto done;
594 }
595
596 clx = cly = 0;
597 clw = dst->cache_entry.w;
598 clh = dst->cache_entry.h;
599
600 cx = dc->clip.x;
601 cy = dc->clip.y;
602 cw = dc->clip.w;
603 ch = dc->clip.h;
604
605 if (dc->clip.use)
606 {
607 RECTS_CLIP_TO_RECT(clx, cly, clw, clh, cx, cy, cw, ch);
608 if ((clw < 1) || (clh < 1)) return;
609 }
610
611 x = MIN(x1, x2);
612 y = MIN(y1, y2);
613 w = MAX(x1, x2) - x + 1;
614 h = MAX(y1, y2) - y + 1;
615
616 RECTS_CLIP_TO_RECT(clx, cly, clw, clh, x, y, w, h);
617 if ((clw < 1) || (clh < 1)) return;
618
619 EINA_RECTANGLE_SET(&cl.clip, clx, cly, clw, clh);
620
621 done:
622 cl.color = dc->col.col;
623 cl.render_op = dc->render_op;
624 cl.anti_alias = dc->anti_alias;
625 cl.x1 = x1;
626 cl.y1 = y1;
627 cl.x2 = x2;
628 cl.y2 = y2;
629
630 evas_thread_cmd_enqueue(_draw_thread_line_draw, &cl, sizeof(cl));
631}
632
633static void
634eng_line_draw(void *data EINA_UNUSED, void *context, void *surface, int x1, int y1, int x2, int y2, Eina_Bool do_async)
635{
636 if (do_async) _line_draw_thread_cmd(surface, context, x1, y1, x2, y2);
438#ifdef BUILD_PIPE_RENDER 637#ifdef BUILD_PIPE_RENDER
439 if ((cpunum > 1)) 638 else if ((cpunum > 1))
440 evas_common_pipe_line_draw(surface, context, x1, y1, x2, y2); 639 evas_common_pipe_line_draw(surface, context, x1, y1, x2, y2);
640#endif
441 else 641 else
442#endif
443 { 642 {
444 evas_common_line_draw(surface, context, x1, y1, x2, y2); 643 evas_common_line_draw(surface, context, x1, y1, x2, y2);
445 evas_common_cpu_end_opt(); 644 evas_common_cpu_end_opt();
446 } 645 }
447} 646}
448 647
@@ -459,13 +658,115 @@ eng_polygon_points_clear(void *data EINA_UNUSED, void *context EINA_UNUSED, void
459} 658}
460 659
461static void 660static void
462eng_polygon_draw(void *data EINA_UNUSED, void *context, void *surface, void *polygon, int x, int y) 661_draw_thread_polygon_cleanup(Evas_Thread_Command_Polygon *poly)
662{
663 RGBA_Polygon_Point *points = poly->points;
664
665 while (points)
666 {
667 RGBA_Polygon_Point *p;
668
669 p = points;
670 points =
671 (RGBA_Polygon_Point *)eina_inlist_remove(EINA_INLIST_GET(points),
672 EINA_INLIST_GET(points));
673 free(p);
674 }
675
676 poly->points = NULL;
677}
678
679static void
680_draw_thread_polygon_draw(void *data)
681{
682 Evas_Thread_Command_Polygon *poly = data;
683
684 evas_common_polygon_rgba_draw
685 (poly->surface,
686 poly->ext.x, poly->ext.y, poly->ext.w, poly->ext.h,
687 poly->col, poly->render_op,
688 poly->points, poly->x, poly->y);
689
690 _draw_thread_polygon_cleanup(poly);
691}
692
693static void
694_polygon_draw_thread_points_populate(Evas_Thread_Command_Polygon *cp, RGBA_Polygon_Point *points)
695{
696 RGBA_Polygon_Point *cur, *npoints = NULL;
697
698 if (!points) return;
699
700 EINA_INLIST_FOREACH(EINA_INLIST_GET(points), cur)
701 {
702 RGBA_Polygon_Point *point;
703
704 point = malloc(sizeof *point);
705 point->x = cur->x;
706 point->y = cur->y;
707
708 npoints =
709 (RGBA_Polygon_Point *)eina_inlist_append(EINA_INLIST_GET(npoints),
710 EINA_INLIST_GET(point));
711 }
712
713 cp->points = npoints;
714}
715
716static void
717_polygon_draw_thread_cmd(RGBA_Image *dst, RGBA_Draw_Context *dc, RGBA_Polygon_Point *points, int x, int y)
718{
719 int ext_x, ext_y, ext_w, ext_h;
720 Evas_Thread_Command_Polygon cp;
721
722 ext_x = 0;
723 ext_y = 0;
724 ext_w = dst->cache_entry.w;
725 ext_h = dst->cache_entry.h;
726
727 if (dc->clip.use)
728 {
729 if (dc->clip.x > ext_x)
730 {
731 ext_w += ext_x - dc->clip.x;
732 ext_x = dc->clip.x;
733 }
734
735 if ((ext_x + ext_w) > (dc->clip.x + dc->clip.w))
736 ext_w = (dc->clip.x + dc->clip.w) - ext_x;
737
738 if (dc->clip.y > ext_y)
739 {
740 ext_h += ext_y - dc->clip.y;
741 ext_y = dc->clip.y;
742 }
743
744 if ((ext_y + ext_h) > (dc->clip.y + dc->clip.h))
745 ext_h = (dc->clip.y + dc->clip.h) - ext_y;
746 }
747
748 EINA_RECTANGLE_SET(&cp.ext, ext_x, ext_y, ext_w, ext_h);
749 cp.col = dc->col.col;
750 cp.render_op = dc->render_op;
751 cp.surface = dst;
752
753 _polygon_draw_thread_points_populate(&cp, points);
754
755 cp.x = x;
756 cp.y = y;
757
758 evas_thread_cmd_enqueue(_draw_thread_polygon_draw, &cp, sizeof(cp));
759}
760
761static void
762eng_polygon_draw(void *data EINA_UNUSED, void *context, void *surface, void *polygon, int x, int y, Eina_Bool do_async)
463{ 763{
764 if (do_async) _polygon_draw_thread_cmd(surface, context, polygon, x, y);
464#ifdef BUILD_PIPE_RENDER 765#ifdef BUILD_PIPE_RENDER
465 if ((cpunum > 1)) 766 else if ((cpunum > 1))
466 evas_common_pipe_poly_draw(surface, context, polygon, x, y); 767 evas_common_pipe_poly_draw(surface, context, polygon, x, y);
467 else
468#endif 768#endif
769 else
469 { 770 {
470 evas_common_polygon_draw(surface, context, polygon, x, y); 771 evas_common_polygon_draw(surface, context, polygon, x, y);
471 evas_common_cpu_end_opt(); 772 evas_common_cpu_end_opt();
@@ -825,14 +1126,132 @@ eng_image_data_preload_cancel(void *data EINA_UNUSED, void *image, const void *t
825} 1126}
826 1127
827static void 1128static void
828eng_image_draw(void *data EINA_UNUSED, void *context, void *surface, void *image, int src_x, int src_y, int src_w, int src_h, int dst_x, int dst_y, int dst_w, int dst_h, int smooth) 1129_drop_cache_ref(void *target, Evas_Callback_Type type EINA_UNUSED, void *event_info EINA_UNUSED)
1130{
1131 evas_cache_image_drop((Image_Entry *)target);
1132}
1133
1134static void
1135draw_thread_image_draw(void *data)
1136{
1137 Evas_Thread_Command_Image *image = data;
1138
1139 if (image->smooth)
1140 evas_common_scale_rgba_smooth_draw
1141 (image->image, image->surface,
1142 image->clip.x, image->clip.y, image->clip.w, image->clip.h,
1143 image->mul_col, image->render_op,
1144 image->src.x, image->src.y, image->src.w, image->src.h,
1145 image->dst.x, image->dst.y, image->dst.w, image->dst.h);
1146 else
1147 evas_common_scale_rgba_sample_draw
1148 (image->image, image->surface,
1149 image->clip.x, image->clip.y, image->clip.w, image->clip.h,
1150 image->mul_col, image->render_op,
1151 image->src.x, image->src.y, image->src.w, image->src.h,
1152 image->dst.x, image->dst.y, image->dst.w, image->dst.h);
1153
1154 evas_async_events_put(image->image, 0, NULL, _drop_cache_ref);
1155}
1156
1157static void
1158_image_draw_thread_cmd(RGBA_Image *src, RGBA_Image *dst, RGBA_Draw_Context *dc, int src_region_x, int src_region_y, int src_region_w, int src_region_h, int dst_region_x, int dst_region_y, int dst_region_w, int dst_region_h, int smooth)
1159{
1160 Evas_Thread_Command_Image cr;
1161 int clip_x, clip_y, clip_w, clip_h;
1162
1163 if ((dst_region_w <= 0) || (dst_region_h <= 0)) return;
1164 if (!(RECTS_INTERSECT(dst_region_x, dst_region_y, dst_region_w, dst_region_h,
1165 0, 0, dst->cache_entry.w, dst->cache_entry.h))) return;
1166
1167 evas_cache_image_ref((Image_Entry *)src);
1168
1169 cr.image = src;
1170 cr.surface = dst;
1171 EINA_RECTANGLE_SET(&cr.src, src_region_x, src_region_y, src_region_w, src_region_h);
1172 EINA_RECTANGLE_SET(&cr.dst, dst_region_x, dst_region_y, dst_region_w, dst_region_h);
1173
1174 if (dc->clip.use)
1175 {
1176 clip_x = dc->clip.x;
1177 clip_y = dc->clip.y;
1178 clip_w = dc->clip.w;
1179 clip_h = dc->clip.h;
1180 }
1181 else
1182 {
1183 clip_x = 0;
1184 clip_y = 0;
1185 clip_w = dst->cache_entry.w;
1186 clip_h = dst->cache_entry.h;
1187 }
1188
1189 EINA_RECTANGLE_SET(&cr.clip, clip_x, clip_y, clip_w, clip_h);
1190
1191 cr.mul_col = dc->mul.use ? dc->mul.col : 0xffffffff;
1192 cr.render_op = dc->render_op;
1193 cr.smooth = smooth;
1194
1195 evas_thread_cmd_enqueue(draw_thread_image_draw, &cr, sizeof(cr));
1196}
1197
1198static void
1199_image_draw_thread_cmd_smooth(RGBA_Image *src, RGBA_Image *dst, RGBA_Draw_Context *dc, int src_region_x, int src_region_y, int src_region_w, int src_region_h, int dst_region_x, int dst_region_y, int dst_region_w, int dst_region_h)
1200{
1201 _image_draw_thread_cmd
1202 (src, dst, dc,
1203 src_region_x, src_region_y, src_region_w, src_region_h,
1204 dst_region_x, dst_region_y, dst_region_w, dst_region_h,
1205 1);
1206}
1207
1208static void
1209_image_draw_thread_cmd_sample(RGBA_Image *src, RGBA_Image *dst, RGBA_Draw_Context *dc, int src_region_x, int src_region_y, int src_region_w, int src_region_h, int dst_region_x, int dst_region_y, int dst_region_w, int dst_region_h)
1210{
1211 _image_draw_thread_cmd
1212 (src, dst, dc,
1213 src_region_x, src_region_y, src_region_w, src_region_h,
1214 dst_region_x, dst_region_y, dst_region_w, dst_region_h,
1215 0);
1216}
1217
1218static void
1219eng_image_draw(void *data EINA_UNUSED, void *context, void *surface, void *image, int src_x, int src_y, int src_w, int src_h, int dst_x, int dst_y, int dst_w, int dst_h, int smooth, Eina_Bool do_async)
829{ 1220{
830 RGBA_Image *im; 1221 RGBA_Image *im;
831 1222
832 if (!image) return; 1223 if (!image) return;
833 im = image; 1224 im = image;
1225
1226 if (do_async)
1227 {
1228 if (im->cache_entry.space == EVAS_COLORSPACE_ARGB8888)
1229 {
1230#if EVAS_CSERVE2
1231 if (evas_cserve2_use_get())
1232 evas_cache2_image_load_data(&im->cache_entry);
1233 else
1234#endif
1235 evas_cache_image_load_data(&im->cache_entry);
1236 }
1237
1238 evas_common_image_colorspace_normalize(im);
1239
1240 if (smooth)
1241 evas_common_scale_rgba_in_to_out_clip_cb
1242 (image, surface, context,
1243 src_x, src_y, src_w, src_h,
1244 dst_x, dst_y, dst_w, dst_h,
1245 _image_draw_thread_cmd_smooth);
1246 else
1247 evas_common_scale_rgba_in_to_out_clip_cb
1248 (image, surface, context,
1249 src_x, src_y, src_w, src_h,
1250 dst_x, dst_y, dst_w, dst_h,
1251 _image_draw_thread_cmd_sample);
1252 }
834#ifdef BUILD_PIPE_RENDER 1253#ifdef BUILD_PIPE_RENDER
835 if ((cpunum > 1)) 1254 else if ((cpunum > 1))
836 { 1255 {
837#ifdef EVAS_CSERVE2 1256#ifdef EVAS_CSERVE2
838 if (evas_cserve2_use_get()) 1257 if (evas_cserve2_use_get())
@@ -847,8 +1266,8 @@ eng_image_draw(void *data EINA_UNUSED, void *context, void *surface, void *image
847 src_x, src_y, src_w, src_h, 1266 src_x, src_y, src_w, src_h,
848 dst_x, dst_y, dst_w, dst_h); 1267 dst_x, dst_y, dst_w, dst_h);
849 } 1268 }
850 else
851#endif 1269#endif
1270 else
852 { 1271 {
853#if 0 1272#if 0
854#ifdef EVAS_CSERVE2 1273#ifdef EVAS_CSERVE2
@@ -901,7 +1320,185 @@ image_loaded:
901} 1320}
902 1321
903static void 1322static void
904evas_software_image_map_draw(void *data, void *context, RGBA_Image *surface, RGBA_Image *im, RGBA_Map *m, int smooth, int level, int offset) 1323_map_image_draw(RGBA_Image *src, RGBA_Image *dst, RGBA_Draw_Context *dc, int src_region_x, int src_region_y, int src_region_w, int src_region_h, int dst_region_x, int dst_region_y, int dst_region_w, int dst_region_h, int smooth)
1324{
1325 int clip_x, clip_y, clip_w, clip_h;
1326 DATA32 mul_col;
1327
1328 if ((dst_region_w <= 0) || (dst_region_h <= 0)) return;
1329 if (!(RECTS_INTERSECT(dst_region_x, dst_region_y, dst_region_w, dst_region_h,
1330 0, 0, dst->cache_entry.w, dst->cache_entry.h))) return;
1331
1332 if (dc->clip.use)
1333 {
1334 clip_x = dc->clip.x;
1335 clip_y = dc->clip.y;
1336 clip_w = dc->clip.w;
1337 clip_h = dc->clip.h;
1338 }
1339 else
1340 {
1341 clip_x = clip_y = 0;
1342 clip_w = dst->cache_entry.w;
1343 clip_h = dst->cache_entry.h;
1344 }
1345
1346 mul_col = dc->mul.use ? dc->mul.col : 0xffffffff;
1347
1348 if (smooth)
1349 evas_common_scale_rgba_smooth_draw
1350 (src, dst,
1351 clip_x, clip_y, clip_w, clip_h,
1352 mul_col, dc->render_op,
1353 src_region_x, src_region_y, src_region_w, src_region_h,
1354 dst_region_x, dst_region_y, dst_region_w, dst_region_h);
1355 else
1356 evas_common_scale_rgba_sample_draw
1357 (src, dst,
1358 clip_x, clip_y, clip_w, clip_h,
1359 mul_col, dc->render_op,
1360 src_region_x, src_region_y, src_region_w, src_region_h,
1361 dst_region_x, dst_region_y, dst_region_w, dst_region_h);
1362}
1363
1364static void
1365_map_image_sample_draw(RGBA_Image *src, RGBA_Image *dst, RGBA_Draw_Context *dc, int src_region_x, int src_region_y, int src_region_w, int src_region_h, int dst_region_x, int dst_region_y, int dst_region_w, int dst_region_h)
1366{
1367 _map_image_draw(src, dst, dc,
1368 src_region_x, src_region_y, src_region_w, src_region_h,
1369 dst_region_x, dst_region_y, dst_region_w, dst_region_h,
1370 0);
1371}
1372
1373static void
1374_map_image_smooth_draw(RGBA_Image *src, RGBA_Image *dst, RGBA_Draw_Context *dc, int src_region_x, int src_region_y, int src_region_w, int src_region_h, int dst_region_x, int dst_region_y, int dst_region_w, int dst_region_h)
1375{
1376 _map_image_draw(src, dst, dc,
1377 src_region_x, src_region_y, src_region_w, src_region_h,
1378 dst_region_x, dst_region_y, dst_region_w, dst_region_h,
1379 1);
1380}
1381
1382static void
1383_draw_thread_map_draw(void *data)
1384{
1385 Evas_Thread_Command_Map *map = data;
1386 int offset = map->offset;
1387 RGBA_Map *m = map->map;
1388 RGBA_Image *im = map->image;
1389 int dx, dy, dw, dh;
1390
1391 if (m->count - offset < 3) goto free_out;
1392
1393 do
1394 {
1395 if ((m->pts[0 + offset].x == m->pts[3 + offset].x) &&
1396 (m->pts[1 + offset].x == m->pts[2 + offset].x) &&
1397 (m->pts[0 + offset].y == m->pts[1 + offset].y) &&
1398 (m->pts[3 + offset].y == m->pts[2 + offset].y) &&
1399 (m->pts[0 + offset].x <= m->pts[1 + offset].x) &&
1400 (m->pts[0 + offset].y <= m->pts[2 + offset].y) &&
1401 (m->pts[0 + offset].u == 0) &&
1402 (m->pts[0 + offset].v == 0) &&
1403 (m->pts[1 + offset].u == (int)(im->cache_entry.w << FP)) &&
1404 (m->pts[1 + offset].v == 0) &&
1405 (m->pts[2 + offset].u == (int)(im->cache_entry.w << FP)) &&
1406 (m->pts[2 + offset].v == (int)(im->cache_entry.h << FP)) &&
1407 (m->pts[3 + offset].u == 0) &&
1408 (m->pts[3 + offset].v == (int)(im->cache_entry.h << FP)) &&
1409 (m->pts[0 + offset].col == 0xffffffff) &&
1410 (m->pts[1 + offset].col == 0xffffffff) &&
1411 (m->pts[2 + offset].col == 0xffffffff) &&
1412 (m->pts[3 + offset].col == 0xffffffff))
1413 {
1414 dx = m->pts[0 + offset].x >> FP;
1415 dy = m->pts[0 + offset].y >> FP;
1416 dw = (m->pts[2 + offset].x >> FP) - dx;
1417 dh = (m->pts[2 + offset].y >> FP) - dy;
1418
1419 if (map->smooth)
1420 evas_common_scale_rgba_in_to_out_clip_cb
1421 (im, map->surface, &map->image_ctx,
1422 0, 0, im->cache_entry.w, im->cache_entry.h,
1423 dx, dy, dw, dh, _map_image_smooth_draw);
1424 else
1425 evas_common_scale_rgba_in_to_out_clip_cb
1426 (im, map->surface, &map->image_ctx,
1427 0, 0, im->cache_entry.w, im->cache_entry.h,
1428 dx, dy, dw, dh, _map_image_sample_draw);
1429 }
1430 else
1431 {
1432 evas_common_map_rgba_draw
1433 (im, map->surface,
1434 map->clip.x, map->clip.y, map->clip.w, map->clip.h,
1435 map->mul_col, map->render_op, m->count - offset, &m->pts[offset],
1436 map->smooth, map->level);
1437 }
1438
1439 evas_common_cpu_end_opt();
1440
1441 offset += 2;
1442 }
1443 while ((m->count > 4) && (m->count - offset >= 3));
1444
1445 free_out:
1446 free(m);
1447 evas_async_events_put(map->image, 0, NULL, _drop_cache_ref);
1448}
1449
1450static void
1451_map_draw_thread_cmd(RGBA_Image *src, RGBA_Image *dst, RGBA_Draw_Context *dc, RGBA_Map *map, int smooth, int level, int offset)
1452{
1453 Evas_Thread_Command_Map cm;
1454 int clip_x, clip_y, clip_w, clip_h;
1455
1456 evas_cache_image_ref((Image_Entry *)src);
1457
1458 cm.image = src;
1459 memcpy(&cm.image_ctx, dc, sizeof(*dc));
1460 cm.surface = dst;
1461
1462 if (dc->clip.use)
1463 {
1464 clip_x = dc->clip.x;
1465 clip_y = dc->clip.y;
1466 clip_w = dc->clip.w;
1467 clip_h = dc->clip.h;
1468 }
1469 else
1470 {
1471 clip_x = clip_y = 0;
1472 clip_w = dst->cache_entry.w;
1473 clip_h = dst->cache_entry.h;
1474 }
1475
1476 EINA_RECTANGLE_SET(&cm.clip, clip_x, clip_y, clip_w, clip_h);
1477
1478 cm.mul_col = dc->mul.use ? dc->mul.col : 0xffffffff;
1479 cm.render_op = dc->render_op;
1480
1481 cm.map = calloc(1, sizeof(RGBA_Map) +
1482 sizeof(RGBA_Map_Point) * map->count);
1483 cm.map->engine_data = map->engine_data;
1484 cm.map->image.w = map->image.w;
1485 cm.map->image.h = map->image.h;
1486 cm.map->uv.w = map->uv.w;
1487 cm.map->uv.h = map->uv.h;
1488 cm.map->x = map->x;
1489 cm.map->y = map->y;
1490 cm.map->count = map->count;
1491 memcpy(&cm.map->pts[0], &map->pts[0], sizeof(RGBA_Map_Point) * map->count);
1492
1493 cm.smooth = smooth;
1494 cm.level = level;
1495 cm.offset = offset;
1496
1497 evas_thread_cmd_enqueue(_draw_thread_map_draw, &cm, sizeof(cm));
1498}
1499
1500static void
1501evas_software_image_map_draw(void *data, void *context, RGBA_Image *surface, RGBA_Image *im, RGBA_Map *m, int smooth, int level, int offset, Eina_Bool do_async)
905{ 1502{
906 if (m->count - offset < 3) return; 1503 if (m->count - offset < 3) return;
907 1504
@@ -933,7 +1530,8 @@ evas_software_image_map_draw(void *data, void *context, RGBA_Image *surface, RGB
933 eng_image_draw 1530 eng_image_draw
934 (data, context, surface, im, 1531 (data, context, surface, im,
935 0, 0, im->cache_entry.w, im->cache_entry.h, 1532 0, 0, im->cache_entry.w, im->cache_entry.h,
936 dx, dy, dw, dh, smooth); 1533 dx, dy, dw, dh, smooth,
1534 do_async);
937 } 1535 }
938 else 1536 else
939 { 1537 {
@@ -953,17 +1551,22 @@ evas_software_image_map_draw(void *data, void *context, RGBA_Image *surface, RGB
953 1551
954 if (m->count > 4) 1552 if (m->count > 4)
955 { 1553 {
956 evas_software_image_map_draw(data, context, surface, im, m, smooth, level, offset + 2); 1554 evas_software_image_map_draw(data, context, surface, im, m, smooth, level, offset + 2, do_async);
957 } 1555 }
958} 1556}
959 1557
960static void 1558static void
961eng_image_map_draw(void *data, void *context, void *surface, void *image, RGBA_Map *m, int smooth, int level) 1559eng_image_map_draw(void *data, void *context, void *surface, void *image, RGBA_Map *m, int smooth, int level, Eina_Bool do_async)
962{ 1560{
963 if (!image) return; 1561 if (!image) return;
964 if (m->count < 3) return; 1562 if (m->count < 3) return;
965 1563
966 evas_software_image_map_draw(data, context, surface, image, m, smooth, level, 0); 1564 if (do_async)
1565 evas_common_map_thread_rgba_cb(image, surface, context,
1566 m, smooth, level, 0, _map_draw_thread_cmd);
1567 else
1568 evas_software_image_map_draw(data, context, surface, image, m,
1569 smooth, level, 0, do_async);
967} 1570}
968 1571
969static void 1572static void
@@ -1251,13 +1854,71 @@ eng_font_run_font_end_get(void *data EINA_UNUSED, Evas_Font_Set *font, Evas_Font
1251} 1854}
1252 1855
1253static void 1856static void
1254eng_font_draw(void *data EINA_UNUSED, void *context, void *surface, Evas_Font_Set *font EINA_UNUSED, int x, int y, int w EINA_UNUSED, int h EINA_UNUSED, int ow EINA_UNUSED, int oh EINA_UNUSED, Evas_Text_Props *text_props) 1857_draw_thread_font_draw(void *data)
1255{ 1858{
1859 Evas_Thread_Command_Font *font = data;
1860 RGBA_Draw_Context dc;
1861
1862 dc.font_ext.data = font->font_ext_data;
1863 dc.font_ext.func.gl_new = font->gl_new;
1864 dc.font_ext.func.gl_free = font->gl_free;
1865 dc.font_ext.func.gl_draw = font->gl_draw;
1866 dc.col.col = font->col;
1867 dc.clip.use = font->clip_use;
1868 dc.clip.x = font->clip_rect.x;
1869 dc.clip.y = font->clip_rect.y;
1870 dc.clip.w = font->clip_rect.w;
1871 dc.clip.h = font->clip_rect.h;
1872
1873 evas_common_font_rgba_draw
1874 (font->dst, &dc,
1875 font->x, font->y, font->glyphs, font->func,
1876 font->ext.x, font->ext.y, font->ext.w, font->ext.h,
1877 font->im_w, font->im_h);
1878
1879 evas_common_font_glyphs_unref(font->glyphs);
1880}
1881
1882static void
1883_font_draw_thread_cmd(RGBA_Image *dst, RGBA_Draw_Context *dc, int x, int y, Evas_Glyph_Array *glyphs, RGBA_Gfx_Func func, int ext_x, int ext_y, int ext_w, int ext_h, int im_w, int im_h)
1884{
1885 Evas_Thread_Command_Font cf;
1886
1887 cf.dst = dst;
1888 cf.x = x;
1889 cf.y = y;
1890 cf.gl_new = dc->font_ext.func.gl_new;
1891 cf.gl_free = dc->font_ext.func.gl_free;
1892 cf.gl_draw = dc->font_ext.func.gl_draw;
1893 cf.font_ext_data = dc->font_ext.data;
1894 cf.col = dc->col.col;
1895 cf.clip_use = dc->clip.use;
1896 EINA_RECTANGLE_SET(&cf.clip_rect,
1897 dc->clip.x, dc->clip.y, dc->clip.w, dc->clip.h);
1898 cf.glyphs = glyphs;
1899 cf.func = func;
1900 EINA_RECTANGLE_SET(&cf.ext, ext_x, ext_y, ext_w, ext_h);
1901 cf.im_w = im_w;
1902 cf.im_h = im_h;
1903
1904 evas_common_font_glyphs_ref(glyphs);
1905 evas_thread_cmd_enqueue(_draw_thread_font_draw, &cf, sizeof(cf));
1906}
1907
1908static void
1909eng_font_draw(void *data EINA_UNUSED, void *context, void *surface, Evas_Font_Set *font EINA_UNUSED, int x, int y, int w EINA_UNUSED, int h EINA_UNUSED, int ow EINA_UNUSED, int oh EINA_UNUSED, Evas_Text_Props *text_props, Eina_Bool do_async)
1910{
1911 if (do_async)
1912 {
1913 evas_common_font_draw_prepare(text_props);
1914 evas_common_font_draw_cb(surface, context, x, y, text_props->glyphs,
1915 _font_draw_thread_cmd);
1916 }
1256#ifdef BUILD_PIPE_RENDER 1917#ifdef BUILD_PIPE_RENDER
1257 if ((cpunum > 1)) 1918 else if ((cpunum > 1))
1258 evas_common_pipe_text_draw(surface, context, x, y, text_props); 1919 evas_common_pipe_text_draw(surface, context, x, y, text_props);
1259 else
1260#endif 1920#endif
1921 else
1261 { 1922 {
1262 evas_common_font_draw_prepare(text_props); 1923 evas_common_font_draw_prepare(text_props);
1263 evas_common_font_draw(surface, context, x, y, text_props->glyphs); 1924 evas_common_font_draw(surface, context, x, y, text_props->glyphs);