summaryrefslogtreecommitdiff
path: root/legacy/evas/src/lib/engines/common/evas_draw_main.c
diff options
context:
space:
mode:
authorCarsten Haitzler <raster@rasterman.com>2012-02-21 07:01:39 +0000
committerCarsten Haitzler <raster@rasterman.com>2012-02-21 07:01:39 +0000
commit396572a355dff573361a7a6e616e5ba87e07f8d2 (patch)
tree605a92de801f2fb9dbd48b3a5e261f77a05387ac /legacy/evas/src/lib/engines/common/evas_draw_main.c
parentaaaa571c8d1221b9953f4a3c69c5a26eafd0d61d (diff)
fix regression during 1.1 dev (towards 1.2) that made evas over-render
way too much! FIXED SVN revision: 68204
Diffstat (limited to '')
-rw-r--r--legacy/evas/src/lib/engines/common/evas_draw_main.c65
1 files changed, 64 insertions, 1 deletions
diff --git a/legacy/evas/src/lib/engines/common/evas_draw_main.c b/legacy/evas/src/lib/engines/common/evas_draw_main.c
index def19a822c..d08e7885eb 100644
--- a/legacy/evas/src/lib/engines/common/evas_draw_main.c
+++ b/legacy/evas/src/lib/engines/common/evas_draw_main.c
@@ -559,7 +559,7 @@ evas_common_draw_context_cutout_split(Cutout_Rects* res, int idx, Cutout_Rect *s
559EAPI Cutout_Rects* 559EAPI Cutout_Rects*
560evas_common_draw_context_apply_cutouts(RGBA_Draw_Context *dc) 560evas_common_draw_context_apply_cutouts(RGBA_Draw_Context *dc)
561{ 561{
562 Cutout_Rects* res; 562 Cutout_Rects* res, *res2;
563 int i; 563 int i;
564 int j; 564 int j;
565 565
@@ -583,6 +583,69 @@ evas_common_draw_context_apply_cutouts(RGBA_Draw_Context *dc)
583 active--; 583 active--;
584 } 584 }
585 } 585 }
586 /* merge rects */
587#define RI res->rects[i]
588#define RJ res->rects[j]
589 if (res->active > 1)
590 {
591 int found = 1;
592
593 while (found)
594 {
595 found = 0;
596 for (i = 0; i < res->active; i++)
597 {
598 for (j = i + 1; j < res->active; j++)
599 {
600 /* skip empty rects we are removing */
601 if (RJ.w == 0) continue;
602 /* check if its same width, immediately above or below */
603 if ((RJ.w == RI.w) && (RJ.x == RI.x))
604 {
605 if ((RJ.y + RJ.h) == RI.y) /* above */
606 {
607 RI.y = RJ.y;
608 RI.h += RJ.h;
609 RJ.w = 0;
610 found = 1;
611 }
612 else if ((RI.y + RI.h) == RJ.y) /* below */
613 {
614 RI.h += RJ.h;
615 RJ.w = 0;
616 found = 1;
617 }
618 }
619 /* check if its same height, immediately left or right */
620 else if ((RJ.h == RI.h) && (RJ.y == RI.y))
621 {
622 if ((RJ.x + RJ.w) == RI.x) /* left */
623 {
624 RI.x = RJ.x;
625 RI.w += RJ.w;
626 RJ.w = 0;
627 found = 1;
628 }
629 else if ((RI.x + RI.w) == RJ.x) /* right */
630 {
631 RI.w += RJ.w;
632 RJ.w = 0;
633 found = 1;
634 }
635 }
636 }
637 }
638 }
639 res2 = evas_common_draw_context_cutouts_new();
640 for (i = 0; i < res->active; i++)
641 {
642 if (RI.w == 0) continue;
643 evas_common_draw_context_cutouts_add(res2, RI.x, RI.y, RI.w, RI.h);
644 }
645 free(res->rects);
646 free(res);
647 return res2;
648 }
586 return res; 649 return res;
587} 650}
588 651