summaryrefslogtreecommitdiff
path: root/legacy/evas/src/lib/engines/common/evas_draw_main.c
diff options
context:
space:
mode:
authorCedric BAIL <cedric.bail@free.fr>2012-07-04 09:39:23 +0000
committerCedric BAIL <cedric.bail@free.fr>2012-07-04 09:39:23 +0000
commit1d415b796bf0f506ef7888195faa8ec0ed1f0d06 (patch)
tree7b79753ca57cf5d98c831f19609fccc6749aa214 /legacy/evas/src/lib/engines/common/evas_draw_main.c
parent5ef3b00eaf4886d130dfd938354abbc7a8e5a702 (diff)
evas: add more infrastructure to the prepare stage of pipe rendering.
NOTE: this improve some test by 10 to 15% some other are down by 5%. Their is still more tunning and improvement possible now (Particularly with Map), but it will do for now. SVN revision: 73264
Diffstat (limited to '')
-rw-r--r--legacy/evas/src/lib/engines/common/evas_draw_main.c30
1 files changed, 21 insertions, 9 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 d08e7885eb..28b54cd0ae 100644
--- a/legacy/evas/src/lib/engines/common/evas_draw_main.c
+++ b/legacy/evas/src/lib/engines/common/evas_draw_main.c
@@ -14,6 +14,7 @@ evas_common_draw_context_cutouts_new(void)
14EAPI void 14EAPI void
15evas_common_draw_context_cutouts_free(Cutout_Rects* rects) 15evas_common_draw_context_cutouts_free(Cutout_Rects* rects)
16{ 16{
17 if (!rects) return ;
17 rects->active = 0; 18 rects->active = 0;
18} 19}
19 20
@@ -90,7 +91,7 @@ evas_common_draw_context_free(RGBA_Draw_Context *dc)
90EAPI void 91EAPI void
91evas_common_draw_context_clear_cutouts(RGBA_Draw_Context *dc) 92evas_common_draw_context_clear_cutouts(RGBA_Draw_Context *dc)
92{ 93{
93 evas_common_draw_context_apply_clean_cutouts(&dc->cutout); 94 evas_common_draw_context_cutouts_free(&dc->cutout);
94} 95}
95 96
96EAPI void 97EAPI void
@@ -557,9 +558,9 @@ evas_common_draw_context_cutout_split(Cutout_Rects* res, int idx, Cutout_Rect *s
557} 558}
558 559
559EAPI Cutout_Rects* 560EAPI Cutout_Rects*
560evas_common_draw_context_apply_cutouts(RGBA_Draw_Context *dc) 561evas_common_draw_context_apply_cutouts(RGBA_Draw_Context *dc, Cutout_Rects *reuse)
561{ 562{
562 Cutout_Rects* res, *res2; 563 Cutout_Rects* res = NULL;
563 int i; 564 int i;
564 int j; 565 int j;
565 566
@@ -567,7 +568,15 @@ evas_common_draw_context_apply_cutouts(RGBA_Draw_Context *dc)
567 if ((dc->clip.w <= 0) || (dc->clip.h <= 0)) return NULL; 568 if ((dc->clip.w <= 0) || (dc->clip.h <= 0)) return NULL;
568 569
569 570
570 res = evas_common_draw_context_cutouts_new(); 571 if (!reuse)
572 {
573 res = evas_common_draw_context_cutouts_new();
574 }
575 else
576 {
577 evas_common_draw_context_cutouts_free(reuse);
578 res = reuse;
579 }
571 evas_common_draw_context_cutouts_add(res, dc->clip.x, dc->clip.y, dc->clip.w, dc->clip.h); 580 evas_common_draw_context_cutouts_add(res, dc->clip.x, dc->clip.y, dc->clip.w, dc->clip.h);
572 581
573 for (i = 0; i < dc->cutout.active; ++i) 582 for (i = 0; i < dc->cutout.active; ++i)
@@ -636,15 +645,18 @@ evas_common_draw_context_apply_cutouts(RGBA_Draw_Context *dc)
636 } 645 }
637 } 646 }
638 } 647 }
639 res2 = evas_common_draw_context_cutouts_new(); 648
649 /* Repack the cutout */
650 j = 0;
640 for (i = 0; i < res->active; i++) 651 for (i = 0; i < res->active; i++)
641 { 652 {
642 if (RI.w == 0) continue; 653 if (RI.w == 0) continue;
643 evas_common_draw_context_cutouts_add(res2, RI.x, RI.y, RI.w, RI.h); 654 if (i != j)
655 RJ = RI;
656 j++;
644 } 657 }
645 free(res->rects); 658 res->active = j;
646 free(res); 659 return res;
647 return res2;
648 } 660 }
649 return res; 661 return res;
650} 662}