summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCedric BAIL <cedric@osg.samsung.com>2015-08-01 01:32:24 +0200
committerCedric BAIL <cedric@osg.samsung.com>2015-08-05 15:12:33 +0200
commit46082eb13d66576f4cbdda427b224c9102bde678 (patch)
tree5751b3dfe0621982b7a054b770bb4186e8267fa7
parentc5c94ce027efd77a5a1a0702f68917fa3f9043da (diff)
evas: make sure that the context is only relevant to the surface we are currently manipulating.
-rw-r--r--src/lib/evas/canvas/evas_render.c46
1 files changed, 24 insertions, 22 deletions
diff --git a/src/lib/evas/canvas/evas_render.c b/src/lib/evas/canvas/evas_render.c
index 3f5dbc82f9..55ce63e2ac 100644
--- a/src/lib/evas/canvas/evas_render.c
+++ b/src/lib/evas/canvas/evas_render.c
@@ -2016,7 +2016,7 @@ end:
2016} 2016}
2017 2017
2018static void 2018static void
2019_evas_render_cutout_add(Evas_Public_Data *e, Evas_Object_Protected_Data *obj, int off_x, int off_y) 2019_evas_render_cutout_add(Evas_Public_Data *e, void *context, Evas_Object_Protected_Data *obj, int off_x, int off_y)
2020{ 2020{
2021 if (evas_object_is_source_invisible(obj->object, obj)) return; 2021 if (evas_object_is_source_invisible(obj->object, obj)) return;
2022 if (evas_object_is_opaque(obj->object, obj)) 2022 if (evas_object_is_opaque(obj->object, obj))
@@ -2050,7 +2050,7 @@ _evas_render_cutout_add(Evas_Public_Data *e, Evas_Object_Protected_Data *obj, in
2050 } 2050 }
2051 } 2051 }
2052 e->engine.func->context_cutout_add 2052 e->engine.func->context_cutout_add
2053 (e->engine.data.output, e->engine.data.context, 2053 (e->engine.data.output, context,
2054 cox + off_x, coy + off_y, cow, coh); 2054 cox + off_x, coy + off_y, cow, coh);
2055 } 2055 }
2056 else 2056 else
@@ -2070,7 +2070,7 @@ _evas_render_cutout_add(Evas_Public_Data *e, Evas_Object_Protected_Data *obj, in
2070 obj->cur->cache.clip.w, 2070 obj->cur->cache.clip.w,
2071 obj->cur->cache.clip.h); 2071 obj->cur->cache.clip.h);
2072 e->engine.func->context_cutout_add 2072 e->engine.func->context_cutout_add
2073 (e->engine.data.output, e->engine.data.context, 2073 (e->engine.data.output, context,
2074 obx, oby, obw, obh); 2074 obx, oby, obw, obh);
2075 } 2075 }
2076 } 2076 }
@@ -2132,7 +2132,7 @@ _cb_always_call(Evas *eo_e, Evas_Callback_Type type, void *event_info)
2132 2132
2133static Eina_Bool 2133static Eina_Bool
2134evas_render_updates_internal_loop(Evas *eo_e, Evas_Public_Data *e, 2134evas_render_updates_internal_loop(Evas *eo_e, Evas_Public_Data *e,
2135 void *surface, 2135 void *surface, void *context,
2136 Evas_Object_Protected_Data *top, 2136 Evas_Object_Protected_Data *top,
2137 int ux, int uy, int uw, int uh, 2137 int ux, int uy, int uw, int uh,
2138 int cx, int cy, int cw, int ch, 2138 int cx, int cy, int cw, int ch,
@@ -2175,7 +2175,7 @@ evas_render_updates_internal_loop(Evas *eo_e, Evas_Public_Data *e,
2175 if (alpha) 2175 if (alpha)
2176 { 2176 {
2177 e->engine.func->context_clip_set(e->engine.data.output, 2177 e->engine.func->context_clip_set(e->engine.data.output,
2178 e->engine.data.context, 2178 context,
2179 ux + off_x, uy + off_y, uw, uh); 2179 ux + off_x, uy + off_y, uw, uh);
2180 } 2180 }
2181 for (i = 0; i < e->obscuring_objects.count; ++i) 2181 for (i = 0; i < e->obscuring_objects.count; ++i)
@@ -2186,29 +2186,28 @@ evas_render_updates_internal_loop(Evas *eo_e, Evas_Public_Data *e,
2186 { 2186 {
2187 OBJ_ARRAY_PUSH(&e->temporary_objects, obj); 2187 OBJ_ARRAY_PUSH(&e->temporary_objects, obj);
2188 2188
2189 if (obj == top) break;
2190
2189 /* reset the background of the area if needed (using cutout and engine alpha flag to help) */ 2191 /* reset the background of the area if needed (using cutout and engine alpha flag to help) */
2190 if (alpha) 2192 if (alpha)
2191 _evas_render_cutout_add(e, obj, off_x + fx, off_y + fy); 2193 _evas_render_cutout_add(e, context, obj, off_x + fx, off_y + fy);
2192 } 2194 }
2193 } 2195 }
2194 if (alpha) 2196 if (alpha)
2195 { 2197 {
2196 e->engine.func->context_color_set(e->engine.data.output, 2198 e->engine.func->context_color_set(e->engine.data.output,
2197 e->engine.data.context, 2199 context,
2198 0, 0, 0, 0); 2200 0, 0, 0, 0);
2199 e->engine.func->context_multiplier_unset 2201 e->engine.func->context_multiplier_unset
2200 (e->engine.data.output, e->engine.data.context); 2202 (e->engine.data.output, e->engine.data.context);
2201 e->engine.func->context_render_op_set(e->engine.data.output, 2203 e->engine.func->context_render_op_set(e->engine.data.output,
2202 e->engine.data.context, 2204 context,
2203 EVAS_RENDER_COPY); 2205 EVAS_RENDER_COPY);
2204 e->engine.func->rectangle_draw(e->engine.data.output, 2206 e->engine.func->rectangle_draw(e->engine.data.output,
2205 e->engine.data.context, 2207 context, surface,
2206 surface,
2207 cx, cy, cw, ch, do_async); 2208 cx, cy, cw, ch, do_async);
2208 e->engine.func->context_cutout_clear(e->engine.data.output, 2209 e->engine.func->context_cutout_clear(e->engine.data.output, context);
2209 e->engine.data.context); 2210 e->engine.func->context_clip_unset(e->engine.data.output, context);
2210 e->engine.func->context_clip_unset(e->engine.data.output,
2211 e->engine.data.context);
2212 } 2211 }
2213 eina_evlog("-render_setup", eo_e, 0.0, NULL); 2212 eina_evlog("-render_setup", eo_e, 0.0, NULL);
2214 2213
@@ -2256,7 +2255,7 @@ evas_render_updates_internal_loop(Evas *eo_e, Evas_Public_Data *e,
2256 } 2255 }
2257 2256
2258 e->engine.func->context_clip_set(e->engine.data.output, 2257 e->engine.func->context_clip_set(e->engine.data.output,
2259 e->engine.data.context, 2258 context,
2260 x, y, w, h); 2259 x, y, w, h);
2261 2260
2262 /* Clipper masks */ 2261 /* Clipper masks */
@@ -2275,7 +2274,7 @@ evas_render_updates_internal_loop(Evas *eo_e, Evas_Public_Data *e,
2275 { 2274 {
2276 e->engine.func->context_clip_image_set 2275 e->engine.func->context_clip_image_set
2277 (e->engine.data.output, 2276 (e->engine.data.output,
2278 e->engine.data.context, 2277 context,
2279 mask->mask->surface, 2278 mask->mask->surface,
2280 mask->cur->geometry.x + off_x, 2279 mask->cur->geometry.x + off_x,
2281 mask->cur->geometry.y + off_y, 2280 mask->cur->geometry.y + off_y,
@@ -2293,10 +2292,10 @@ evas_render_updates_internal_loop(Evas *eo_e, Evas_Public_Data *e,
2293 2292
2294 if (obj2 == top) break; 2293 if (obj2 == top) break;
2295 2294
2296 _evas_render_cutout_add(e, obj2, off_x + fx, off_y + fy); 2295 _evas_render_cutout_add(e, context, obj2, off_x + fx, off_y + fy);
2297 } 2296 }
2298#endif 2297#endif
2299 clean_them |= evas_render_mapped(e, eo_obj, obj, e->engine.data.context, 2298 clean_them |= evas_render_mapped(e, eo_obj, obj, context,
2300 surface, off_x + fx, 2299 surface, off_x + fx,
2301 off_y + fy, 0, 2300 off_y + fy, 0,
2302 cx, cy, cw, ch, 2301 cx, cy, cw, ch,
@@ -2304,12 +2303,12 @@ evas_render_updates_internal_loop(Evas *eo_e, Evas_Public_Data *e,
2304 EINA_FALSE, 2303 EINA_FALSE,
2305 do_async); 2304 do_async);
2306 e->engine.func->context_cutout_clear(e->engine.data.output, 2305 e->engine.func->context_cutout_clear(e->engine.data.output,
2307 e->engine.data.context); 2306 context);
2308 2307
2309 if (mask) 2308 if (mask)
2310 { 2309 {
2311 e->engine.func->context_clip_image_unset 2310 e->engine.func->context_clip_image_unset
2312 (e->engine.data.output, e->engine.data.context); 2311 (e->engine.data.output, context);
2313 } 2312 }
2314 } 2313 }
2315 } 2314 }
@@ -2606,6 +2605,7 @@ evas_render_updates_internal(Evas *eo_e,
2606 2605
2607 if (eina_rectangle_intersection(&ur, &output)) 2606 if (eina_rectangle_intersection(&ur, &output))
2608 { 2607 {
2608 void *ctx;
2609 void *pseudo_canvas; 2609 void *pseudo_canvas;
2610 unsigned int restore_offset = offset; 2610 unsigned int restore_offset = offset;
2611 2611
@@ -2615,13 +2615,15 @@ evas_render_updates_internal(Evas *eo_e,
2615 2615
2616 pseudo_canvas = _evas_object_image_surface_get(obj->object, obj); 2616 pseudo_canvas = _evas_object_image_surface_get(obj->object, obj);
2617 2617
2618 clean_them |= evas_render_updates_internal_loop(eo_e, e, pseudo_canvas, 2618 ctx = e->engine.func->context_new(e->engine.data.output);
2619 clean_them |= evas_render_updates_internal_loop(eo_e, e, pseudo_canvas, ctx,
2619 obj, 2620 obj,
2620 ur.x, ur.y, ur.w, ur.h, 2621 ur.x, ur.y, ur.w, ur.h,
2621 cr.x, cr.y, cr.w, cr.h, 2622 cr.x, cr.y, cr.w, cr.h,
2622 fx, fy, alpha, 2623 fx, fy, alpha,
2623 make_updates, do_async, 2624 make_updates, do_async,
2624 &offset); 2625 &offset);
2626 e->engine.func->context_free(e->engine.data.output, ctx);
2625 2627
2626 // Force the object has changed for filter to take it into 2628 // Force the object has changed for filter to take it into
2627 // account. It won't be in the pending object array. 2629 // account. It won't be in the pending object array.
@@ -2632,7 +2634,7 @@ evas_render_updates_internal(Evas *eo_e,
2632 } 2634 }
2633 2635
2634 /* phase 6.2 render all the object on the target surface */ 2636 /* phase 6.2 render all the object on the target surface */
2635 clean_them |= evas_render_updates_internal_loop(eo_e, e, surface, 2637 clean_them |= evas_render_updates_internal_loop(eo_e, e, surface, e->engine.data.context,
2636 NULL, 2638 NULL,
2637 ux, uy, uw, uh, 2639 ux, uy, uw, uh,
2638 cx, cy, cw, ch, 2640 cx, cy, cw, ch,