summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCedric BAIL <cedric@osg.samsung.com>2017-08-25 10:51:31 -0700
committerCedric BAIL <cedric@osg.samsung.com>2017-08-25 10:51:31 -0700
commit3da75d74e3ca3ead9ac2fbcf80ee69b272db47e4 (patch)
treedcc67f7ce68b85e3e5653afb51cfb851b2ef1bdf
parente9cd3e4c7ccbaed1c50bfb0ea14b1031004d8028 (diff)
evas: all context function use already ENC.
-rw-r--r--src/lib/evas/canvas/evas_object_image.c14
-rw-r--r--src/lib/evas/filters/evas_filter.c44
-rw-r--r--src/lib/evas/filters/evas_filter_parser.c18
3 files changed, 38 insertions, 38 deletions
diff --git a/src/lib/evas/canvas/evas_object_image.c b/src/lib/evas/canvas/evas_object_image.c
index 9ad1d68291..b3bd955820 100644
--- a/src/lib/evas/canvas/evas_object_image.c
+++ b/src/lib/evas/canvas/evas_object_image.c
@@ -140,25 +140,25 @@ evas_object_image_render_prepare(Evas_Object *eo_obj EINA_UNUSED, Evas_Object_Pr
140 prep = ENFN->image_surface_noscale_new 140 prep = ENFN->image_surface_noscale_new
141 (ENC, obj->cur->geometry.w, obj->cur->geometry.h, 141 (ENC, obj->cur->geometry.w, obj->cur->geometry.h,
142 o->cur->has_alpha); 142 o->cur->has_alpha);
143 ctx = ENFN->context_new(ENDT); 143 ctx = ENFN->context_new(ENC);
144 ENFN->context_clip_set(ENDT, ctx, 0, 0, 144 ENFN->context_clip_set(ENC, ctx, 0, 0,
145 obj->cur->geometry.w, 145 obj->cur->geometry.w,
146 obj->cur->geometry.h); 146 obj->cur->geometry.h);
147 if (o->cur->has_alpha) 147 if (o->cur->has_alpha)
148 { 148 {
149 ENFN->context_render_op_set(ENDT, ctx, EVAS_RENDER_COPY); 149 ENFN->context_render_op_set(ENC, ctx, EVAS_RENDER_COPY);
150 ENFN->context_color_set(ENDT, ctx, 0, 0, 0, 0); 150 ENFN->context_color_set(ENC, ctx, 0, 0, 0, 0);
151 ENFN->rectangle_draw(ENDT, ctx, prep, 0, 0, 151 ENFN->rectangle_draw(ENC, ENDT, ctx, prep, 0, 0,
152 obj->cur->geometry.w, 152 obj->cur->geometry.w,
153 obj->cur->geometry.h, do_async); 153 obj->cur->geometry.h, do_async);
154 } 154 }
155 ENFN->context_render_op_set(ENDT, ctx, EVAS_RENDER_BLEND); 155 ENFN->context_render_op_set(ENC, ctx, EVAS_RENDER_BLEND);
156 evas_object_image_render(eo_obj, obj, obj->private_data, ENDT, 156 evas_object_image_render(eo_obj, obj, obj->private_data, ENDT,
157 ctx, prep, 157 ctx, prep,
158 -obj->cur->geometry.x, 158 -obj->cur->geometry.x,
159 -obj->cur->geometry.y, 159 -obj->cur->geometry.y,
160 do_async); 160 do_async);
161 ENFN->context_free(ENDT, ctx); 161 ENFN->context_free(ENC, ctx);
162 o->engine_data_prep = prep; 162 o->engine_data_prep = prep;
163 } 163 }
164 } 164 }
diff --git a/src/lib/evas/filters/evas_filter.c b/src/lib/evas/filters/evas_filter.c
index 18969ecaaa..ca03b5dbbe 100644
--- a/src/lib/evas/filters/evas_filter.c
+++ b/src/lib/evas/filters/evas_filter.c
@@ -698,10 +698,10 @@ evas_filter_command_fill_add(Evas_Filter_Context *ctx, void *draw_context,
698 cmd = _command_new(ctx, EVAS_FILTER_MODE_FILL, buf, NULL, buf); 698 cmd = _command_new(ctx, EVAS_FILTER_MODE_FILL, buf, NULL, buf);
699 if (!cmd) return NULL; 699 if (!cmd) return NULL;
700 700
701 ENFN->context_color_get(ENDT, draw_context, &R, &G, &B, &A); 701 ENFN->context_color_get(ENC, draw_context, &R, &G, &B, &A);
702 DRAW_COLOR_SET(R, G, B, A); 702 DRAW_COLOR_SET(R, G, B, A);
703 703
704 ENFN->context_clip_get(ENDT, draw_context, &cx, &cy, &cw, &ch); 704 ENFN->context_clip_get(ENC, draw_context, &cx, &cy, &cw, &ch);
705 DRAW_CLIP_SET(cx, cy, cw, ch); 705 DRAW_CLIP_SET(cx, cy, cw, ch);
706 706
707 XDBG("Add fill %d with color(%d,%d,%d,%d)", buf->id, R, G, B, A); 707 XDBG("Add fill %d with color(%d,%d,%d,%d)", buf->id, R, G, B, A);
@@ -896,7 +896,7 @@ evas_filter_command_blur_add(Evas_Filter_Context *ctx, void *drawctx,
896 out = _filter_buffer_get(ctx, outbuf); 896 out = _filter_buffer_get(ctx, outbuf);
897 EINA_SAFETY_ON_FALSE_GOTO(out, fail); 897 EINA_SAFETY_ON_FALSE_GOTO(out, fail);
898 898
899 ENFN->context_color_get(ENDT, drawctx, &R, &G, &B, &A); 899 ENFN->context_color_get(ENC, drawctx, &R, &G, &B, &A);
900 color = ARGB_JOIN(A, R, G, B); 900 color = ARGB_JOIN(A, R, G, B);
901 if (!color) 901 if (!color)
902 { 902 {
@@ -914,7 +914,7 @@ evas_filter_command_blur_add(Evas_Filter_Context *ctx, void *drawctx,
914 914
915 if (in == out) out->dirty = EINA_FALSE; 915 if (in == out) out->dirty = EINA_FALSE;
916 916
917 render_op = ENFN->context_render_op_get(ENDT, drawctx); 917 render_op = ENFN->context_render_op_get(ENC, drawctx);
918 override = (render_op == EVAS_RENDER_COPY); 918 override = (render_op == EVAS_RENDER_COPY);
919 919
920 switch (type) 920 switch (type)
@@ -960,12 +960,12 @@ evas_filter_command_blur_add(Evas_Filter_Context *ctx, void *drawctx,
960 else 960 else
961 type = EVAS_FILTER_BLUR_BOX; 961 type = EVAS_FILTER_BLUR_BOX;
962 962
963 if (dy) ENFN->context_color_set(ENDT, drawctx, 255, 255, 255, 255); 963 if (dy) ENFN->context_color_set(ENC, drawctx, 255, 255, 255, 255);
964 cmd = evas_filter_command_blur_add(ctx, drawctx, inbuf, tmp_out, 964 cmd = evas_filter_command_blur_add(ctx, drawctx, inbuf, tmp_out,
965 type, dx, 0, tmp_ox, tmp_oy, 0); 965 type, dx, 0, tmp_ox, tmp_oy, 0);
966 if (!cmd) goto fail; 966 if (!cmd) goto fail;
967 cmd->blur.auto_count = EINA_TRUE; 967 cmd->blur.auto_count = EINA_TRUE;
968 if (dy) ENFN->context_color_set(ENDT, drawctx, R, G, B, A); 968 if (dy) ENFN->context_color_set(ENC, drawctx, R, G, B, A);
969 } 969 }
970 970
971 // Y box blur 971 // Y box blur
@@ -977,11 +977,11 @@ evas_filter_command_blur_add(Evas_Filter_Context *ctx, void *drawctx,
977 type = EVAS_FILTER_BLUR_BOX; 977 type = EVAS_FILTER_BLUR_BOX;
978 978
979 if (dx && (inbuf == outbuf)) 979 if (dx && (inbuf == outbuf))
980 ENFN->context_render_op_set(ENDT, drawctx, EVAS_RENDER_COPY); 980 ENFN->context_render_op_set(ENC, drawctx, EVAS_RENDER_COPY);
981 cmd = evas_filter_command_blur_add(ctx, drawctx, tmp_in, outbuf, 981 cmd = evas_filter_command_blur_add(ctx, drawctx, tmp_in, outbuf,
982 type, 0, dy, ox, oy, 0); 982 type, 0, dy, ox, oy, 0);
983 if (dx && (inbuf == outbuf)) 983 if (dx && (inbuf == outbuf))
984 ENFN->context_render_op_set(ENDT, drawctx, render_op); 984 ENFN->context_render_op_set(ENC, drawctx, render_op);
985 if (!cmd) goto fail; 985 if (!cmd) goto fail;
986 cmd->blur.auto_count = EINA_TRUE; 986 cmd->blur.auto_count = EINA_TRUE;
987 } 987 }
@@ -1137,13 +1137,13 @@ evas_filter_command_blur_add(Evas_Filter_Context *ctx, void *drawctx,
1137 Evas_Filter_Command *copycmd; 1137 Evas_Filter_Command *copycmd;
1138 1138
1139 XDBG("Add extra copy %d -> %d: offset: %d,%d", copybuf->id, out->id, ox, oy); 1139 XDBG("Add extra copy %d -> %d: offset: %d,%d", copybuf->id, out->id, ox, oy);
1140 ENFN->context_color_set(ENDT, drawctx, 255, 255, 255, 255); 1140 ENFN->context_color_set(ENC, drawctx, 255, 255, 255, 255);
1141 ENFN->context_render_op_set(ENDT, drawctx, EVAS_RENDER_COPY); 1141 ENFN->context_render_op_set(ENC, drawctx, EVAS_RENDER_COPY);
1142 copycmd = evas_filter_command_blend_add(ctx, drawctx, 1142 copycmd = evas_filter_command_blend_add(ctx, drawctx,
1143 copybuf->id, out->id, ox, oy, 1143 copybuf->id, out->id, ox, oy,
1144 EVAS_FILTER_FILL_MODE_NONE); 1144 EVAS_FILTER_FILL_MODE_NONE);
1145 ENFN->context_color_set(ENDT, drawctx, R, G, B, A); 1145 ENFN->context_color_set(ENC, drawctx, R, G, B, A);
1146 ENFN->context_render_op_set(ENDT, drawctx, render_op); 1146 ENFN->context_render_op_set(ENC, drawctx, render_op);
1147 if (!copycmd) goto fail; 1147 if (!copycmd) goto fail;
1148 ox = oy = 0; 1148 ox = oy = 0;
1149 } 1149 }
@@ -1193,19 +1193,19 @@ evas_filter_command_blend_add(Evas_Filter_Context *ctx, void *drawctx,
1193 cmd = _command_new(ctx, EVAS_FILTER_MODE_BLEND, in, NULL, out); 1193 cmd = _command_new(ctx, EVAS_FILTER_MODE_BLEND, in, NULL, out);
1194 if (!cmd) return NULL; 1194 if (!cmd) return NULL;
1195 1195
1196 if (ENFN->context_render_op_get(ENDT, drawctx) == EVAS_RENDER_COPY) 1196 if (ENFN->context_render_op_get(ENC, drawctx) == EVAS_RENDER_COPY)
1197 copy = EINA_TRUE; 1197 copy = EINA_TRUE;
1198 else 1198 else
1199 copy = EINA_FALSE; 1199 copy = EINA_FALSE;
1200 1200
1201 ENFN->context_color_get(ENDT, drawctx, &R, &G, &B, &A); 1201 ENFN->context_color_get(ENC, drawctx, &R, &G, &B, &A);
1202 DRAW_COLOR_SET(R, G, B, A); 1202 DRAW_COLOR_SET(R, G, B, A);
1203 DRAW_FILL_SET(fillmode); 1203 DRAW_FILL_SET(fillmode);
1204 cmd->draw.ox = ox; 1204 cmd->draw.ox = ox;
1205 cmd->draw.oy = oy; 1205 cmd->draw.oy = oy;
1206 cmd->draw.rop = copy ? EFL_GFX_RENDER_OP_COPY : EFL_GFX_RENDER_OP_BLEND; 1206 cmd->draw.rop = copy ? EFL_GFX_RENDER_OP_COPY : EFL_GFX_RENDER_OP_BLEND;
1207 cmd->draw.clip_use = 1207 cmd->draw.clip_use =
1208 ENFN->context_clip_get(ENDT, drawctx, 1208 ENFN->context_clip_get(ENC, drawctx,
1209 &cmd->draw.clip.x, &cmd->draw.clip.y, 1209 &cmd->draw.clip.x, &cmd->draw.clip.y,
1210 &cmd->draw.clip.w, &cmd->draw.clip.h); 1210 &cmd->draw.clip.w, &cmd->draw.clip.h);
1211 1211
@@ -1392,7 +1392,7 @@ evas_filter_command_displacement_map_add(Evas_Filter_Context *ctx,
1392 DRAW_FILL_SET(fillmode); 1392 DRAW_FILL_SET(fillmode);
1393 cmd->displacement.flags = flags & EVAS_FILTER_DISPLACE_BITMASK; 1393 cmd->displacement.flags = flags & EVAS_FILTER_DISPLACE_BITMASK;
1394 cmd->displacement.intensity = intensity; 1394 cmd->displacement.intensity = intensity;
1395 cmd->draw.rop = _evas_to_gfx_render_op(ENFN->context_render_op_get(ENDT, draw_context)); 1395 cmd->draw.rop = _evas_to_gfx_render_op(ENFN->context_render_op_get(ENC, draw_context));
1396 1396
1397 if (tmp) 1397 if (tmp)
1398 { 1398 {
@@ -1425,8 +1425,8 @@ evas_filter_command_mask_add(Evas_Filter_Context *ctx, void *draw_context,
1425 1425
1426 EINA_SAFETY_ON_NULL_RETURN_VAL(ctx, NULL); 1426 EINA_SAFETY_ON_NULL_RETURN_VAL(ctx, NULL);
1427 1427
1428 render_op = _evas_to_gfx_render_op(ENFN->context_render_op_get(ENDT, draw_context)); 1428 render_op = _evas_to_gfx_render_op(ENFN->context_render_op_get(ENC, draw_context));
1429 ENFN->context_color_get(ENDT, draw_context, &R, &G, &B, &A); 1429 ENFN->context_color_get(ENC, draw_context, &R, &G, &B, &A);
1430 1430
1431 in = _filter_buffer_get(ctx, inbuf); 1431 in = _filter_buffer_get(ctx, inbuf);
1432 out = _filter_buffer_get(ctx, outbuf); 1432 out = _filter_buffer_get(ctx, outbuf);
@@ -1549,15 +1549,15 @@ evas_filter_target_set(Evas_Filter_Context *ctx, void *draw_context,
1549 ctx->target.x = x; 1549 ctx->target.x = x;
1550 ctx->target.y = y; 1550 ctx->target.y = y;
1551 ctx->target.clip_use = ENFN->context_clip_get 1551 ctx->target.clip_use = ENFN->context_clip_get
1552 (ENDT, draw_context, &ctx->target.cx, &ctx->target.cy, 1552 (ENC, draw_context, &ctx->target.cx, &ctx->target.cy,
1553 &ctx->target.cw, &ctx->target.ch); 1553 &ctx->target.cw, &ctx->target.ch);
1554 ctx->target.color_use = ENFN->context_multiplier_get 1554 ctx->target.color_use = ENFN->context_multiplier_get
1555 (ENDT, draw_context, &ctx->target.r, &ctx->target.g, 1555 (ENC, draw_context, &ctx->target.r, &ctx->target.g,
1556 &ctx->target.b, &ctx->target.a); 1556 &ctx->target.b, &ctx->target.a);
1557 if (ctx->target.r == 255 && ctx->target.g == 255 && 1557 if (ctx->target.r == 255 && ctx->target.g == 255 &&
1558 ctx->target.b == 255 && ctx->target.a == 255) 1558 ctx->target.b == 255 && ctx->target.a == 255)
1559 ctx->target.color_use = EINA_FALSE; 1559 ctx->target.color_use = EINA_FALSE;
1560 ctx->target.rop = ENFN->context_render_op_get(ENDT, draw_context); 1560 ctx->target.rop = ENFN->context_render_op_get(ENC, draw_context);
1561 1561
1562 free(ctx->target.map); 1562 free(ctx->target.map);
1563 if (!map) ctx->target.map = NULL; 1563 if (!map) ctx->target.map = NULL;
@@ -1569,7 +1569,7 @@ evas_filter_target_set(Evas_Filter_Context *ctx, void *draw_context,
1569 } 1569 }
1570 1570
1571 ENFN->context_clip_image_get 1571 ENFN->context_clip_image_get
1572 (ENDT, draw_context, &mask, &ctx->target.mask_x, &ctx->target.mask_y); 1572 (ENC, draw_context, &mask, &ctx->target.mask_x, &ctx->target.mask_y);
1573 if (ctx->target.mask) 1573 if (ctx->target.mask)
1574 ctx->evas->engine.func->image_free(_evas_engine_context(ctx->evas), ctx->target.mask); 1574 ctx->evas->engine.func->image_free(_evas_engine_context(ctx->evas), ctx->target.mask);
1575 ctx->target.mask = mask; // FIXME: why no ref??? 1575 ctx->target.mask = mask; // FIXME: why no ref???
diff --git a/src/lib/evas/filters/evas_filter_parser.c b/src/lib/evas/filters/evas_filter_parser.c
index df68b03580..c9fbe1e387 100644
--- a/src/lib/evas/filters/evas_filter_parser.c
+++ b/src/lib/evas/filters/evas_filter_parser.c
@@ -3006,14 +3006,14 @@ evas_filter_program_data_set_all(Evas_Filter_Program *pgm, Eina_Inlist *data)
3006#define CG(color) ((color >> 8) & 0xFF) 3006#define CG(color) ((color >> 8) & 0xFF)
3007#define CB(color) ((color) & 0xFF) 3007#define CB(color) ((color) & 0xFF)
3008 3008
3009#define SETCOLOR(c) do { ENFN->context_color_get(ENDT, dc, &R, &G, &B, &A); \ 3009#define SETCOLOR(c) do { ENFN->context_color_get(ENC, dc, &R, &G, &B, &A); \
3010 ENFN->context_color_set(ENDT, dc, CR(c), CG(c), CB(c), CA(c)); } while (0) 3010 ENFN->context_color_set(ENC, dc, CR(c), CG(c), CB(c), CA(c)); } while (0)
3011#define RESETCOLOR() do { ENFN->context_color_set(ENDT, dc, R, G, B, A); } while (0) 3011#define RESETCOLOR() do { ENFN->context_color_set(ENC, dc, R, G, B, A); } while (0)
3012 3012
3013#define SETCLIP(l, r, t, b) int _l = 0, _r = 0, _t = 0, _b = 0; \ 3013#define SETCLIP(l, r, t, b) int _l = 0, _r = 0, _t = 0, _b = 0; \
3014 do { ENFN->context_clip_get(ENDT, dc, &_l, &_r, &_t, &_b); \ 3014 do { ENFN->context_clip_get(ENC, dc, &_l, &_r, &_t, &_b); \
3015 ENFN->context_clip_set(ENDT, dc, l, r, t, b); } while (0) 3015 ENFN->context_clip_set(ENC, dc, l, r, t, b); } while (0)
3016#define RESETCLIP() do { ENFN->context_clip_set(ENDT, dc, _l, _r, _t, _b); } while (0) 3016#define RESETCLIP() do { ENFN->context_clip_set(ENC, dc, _l, _r, _t, _b); } while (0)
3017 3017
3018static Evas_Filter_Fill_Mode 3018static Evas_Filter_Fill_Mode
3019_fill_mode_get(Evas_Filter_Instruction *instr) 3019_fill_mode_get(Evas_Filter_Instruction *instr)
@@ -3521,8 +3521,8 @@ evas_filter_context_program_use(Evas_Filter_Context *ctx,
3521 // Compute and save padding info 3521 // Compute and save padding info
3522 evas_filter_program_padding_get(pgm, &ctx->pad.final, &ctx->pad.calculated); 3522 evas_filter_program_padding_get(pgm, &ctx->pad.final, &ctx->pad.calculated);
3523 3523
3524 dc = ENFN->context_new(ENDT); 3524 dc = ENFN->context_new(ENC);
3525 ENFN->context_color_set(ENDT, dc, 255, 255, 255, 255); 3525 ENFN->context_color_set(ENC, dc, 255, 255, 255, 255);
3526 3526
3527 // Apply all commands 3527 // Apply all commands
3528 EINA_INLIST_FOREACH(pgm->instructions, instr) 3528 EINA_INLIST_FOREACH(pgm->instructions, instr)
@@ -3537,7 +3537,7 @@ evas_filter_context_program_use(Evas_Filter_Context *ctx,
3537 3537
3538end: 3538end:
3539 if (!success) evas_filter_context_clear(ctx, EINA_FALSE); 3539 if (!success) evas_filter_context_clear(ctx, EINA_FALSE);
3540 if (dc) ENFN->context_free(ENDT, dc); 3540 if (dc) ENFN->context_free(ENC, dc);
3541 return success; 3541 return success;
3542} 3542}
3543 3543