summaryrefslogtreecommitdiff
path: root/src/lib/evas/canvas/evas_object_image.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/evas/canvas/evas_object_image.c')
-rw-r--r--src/lib/evas/canvas/evas_object_image.c59
1 files changed, 34 insertions, 25 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;