summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2016-07-22 09:50:58 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2016-07-24 18:44:15 +0900
commit1c6bb48c11dba18cea927f9dc6b32c54d649fcbb (patch)
tree8eb9089d793ac2cfb984959162132a69679557f8
parent3a726037fa8e9b2042a514f1441719a5ae883807 (diff)
evas image updates - optimize by over-rendering less with hidden content
so if an img obj had some update regions and was opaque, it didnt del an update region first before adding the updates, thus possibly letting update regions pass through the opaque image area @fix
-rw-r--r--src/lib/evas/canvas/evas_object_image.c70
1 files changed, 65 insertions, 5 deletions
diff --git a/src/lib/evas/canvas/evas_object_image.c b/src/lib/evas/canvas/evas_object_image.c
index 408d0b213f..9f126ffd07 100644
--- a/src/lib/evas/canvas/evas_object_image.c
+++ b/src/lib/evas/canvas/evas_object_image.c
@@ -2313,6 +2313,27 @@ evas_object_image_render_pre(Evas_Object *eo_obj,
2313 { 2313 {
2314 Eina_Rectangle *rr; 2314 Eina_Rectangle *rr;
2315 2315
2316 if (evas_object_is_opaque(eo_obj, obj))
2317 {
2318 Evas_Coord x, y, w, h;
2319
2320 x = obj->cur->cache.clip.x;
2321 y = obj->cur->cache.clip.y;
2322 w = obj->cur->cache.clip.w;
2323 h = obj->cur->cache.clip.h;
2324 if (obj->cur->clipper)
2325 {
2326 RECTS_CLIP_TO_RECT(x, y, w, h,
2327 obj->cur->clipper->cur->cache.clip.x,
2328 obj->cur->clipper->cur->cache.clip.y,
2329 obj->cur->clipper->cur->cache.clip.w,
2330 obj->cur->clipper->cur->cache.clip.h);
2331 }
2332 e->engine.func->output_redraws_rect_del(e->engine.data.output,
2333 x + e->framespace.x,
2334 y + e->framespace.y,
2335 w, h);
2336 }
2316 EINA_COW_PIXEL_WRITE_BEGIN(o, pixi_write) 2337 EINA_COW_PIXEL_WRITE_BEGIN(o, pixi_write)
2317 { 2338 {
2318 EINA_LIST_FREE(pixi_write->pixel_updates, rr) 2339 EINA_LIST_FREE(pixi_write->pixel_updates, rr)
@@ -2361,7 +2382,6 @@ evas_object_image_render_pre(Evas_Object *eo_obj,
2361 } 2382 }
2362 } 2383 }
2363 EINA_COW_PIXEL_WRITE_END(o, pixi_write); 2384 EINA_COW_PIXEL_WRITE_END(o, pixi_write);
2364 goto done;
2365 } 2385 }
2366 else 2386 else
2367 { 2387 {
@@ -2377,6 +2397,48 @@ evas_object_image_render_pre(Evas_Object *eo_obj,
2377 { 2397 {
2378 Eina_Rectangle *rr; 2398 Eina_Rectangle *rr;
2379 2399
2400 if (evas_object_is_opaque(eo_obj, obj))
2401 {
2402 Evas_Coord x, y, w, h;
2403
2404 x = obj->cur->cache.clip.x;
2405 y = obj->cur->cache.clip.y;
2406 w = obj->cur->cache.clip.w;
2407 h = obj->cur->cache.clip.h;
2408 if (obj->cur->clipper)
2409 {
2410 RECTS_CLIP_TO_RECT(x, y, w, h,
2411 obj->cur->clipper->cur->cache.clip.x,
2412 obj->cur->clipper->cur->cache.clip.y,
2413 obj->cur->clipper->cur->cache.clip.w,
2414 obj->cur->clipper->cur->cache.clip.h);
2415 }
2416 e->engine.func->output_redraws_rect_del(e->engine.data.output,
2417 x + e->framespace.x,
2418 y + e->framespace.y,
2419 w, h);
2420 }
2421 else if (o->cur->border.fill == EVAS_BORDER_FILL_SOLID)
2422 {
2423 Evas_Coord x, y, w, h;
2424
2425 x = obj->cur->geometry.x + o->cur->border.l;
2426 y = obj->cur->geometry.y + o->cur->border.t;
2427 w = obj->cur->geometry.w - o->cur->border.l - o->cur->border.r;
2428 h = obj->cur->geometry.h - o->cur->border.t - o->cur->border.b;
2429 if (obj->cur->clipper)
2430 {
2431 RECTS_CLIP_TO_RECT(x, y, w, h,
2432 obj->cur->clipper->cur->cache.clip.x,
2433 obj->cur->clipper->cur->cache.clip.y,
2434 obj->cur->clipper->cur->cache.clip.w,
2435 obj->cur->clipper->cur->cache.clip.h);
2436 }
2437 e->engine.func->output_redraws_rect_del(e->engine.data.output,
2438 x + e->framespace.x,
2439 y + e->framespace.y,
2440 w, h);
2441 }
2380 EINA_COW_PIXEL_WRITE_BEGIN(o, pixi_write) 2442 EINA_COW_PIXEL_WRITE_BEGIN(o, pixi_write)
2381 { 2443 {
2382 EINA_LIST_FREE(pixi_write->pixel_updates, rr) 2444 EINA_LIST_FREE(pixi_write->pixel_updates, rr)
@@ -2398,7 +2460,6 @@ evas_object_image_render_pre(Evas_Object *eo_obj,
2398 } 2460 }
2399 } 2461 }
2400 EINA_COW_PIXEL_WRITE_END(o, pixi_write); 2462 EINA_COW_PIXEL_WRITE_END(o, pixi_write);
2401 goto done;
2402 } 2463 }
2403 else 2464 else
2404 { 2465 {
@@ -2414,16 +2475,15 @@ evas_object_image_render_pre(Evas_Object *eo_obj,
2414 2475
2415 evas_object_render_pre_prev_cur_add(&e->clip_changes, eo_obj, 2476 evas_object_render_pre_prev_cur_add(&e->clip_changes, eo_obj,
2416 obj); 2477 obj);
2417 goto done;
2418 } 2478 }
2419 } 2479 }
2480 goto done;
2420 } 2481 }
2421 } 2482 }
2422 /* it obviously didn't change - add a NO obscure - this "unupdates" this */ 2483 /* it obviously didn't change - add a NO obscure - this "unupdates" this */
2423 /* area so if there were updates for it they get wiped. don't do it if we */ 2484 /* area so if there were updates for it they get wiped. don't do it if we */
2424 /* aren't fully opaque and we are visible */ 2485 /* aren't fully opaque and we are visible */
2425 if (evas_object_is_visible(eo_obj, obj) && 2486 if (evas_object_is_opaque(eo_obj, obj))
2426 evas_object_is_opaque(eo_obj, obj))
2427 { 2487 {
2428 Evas_Coord x, y, w, h; 2488 Evas_Coord x, y, w, h;
2429 2489