summaryrefslogtreecommitdiff
path: root/src/lib/evas/common
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2013-12-05 20:02:39 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2013-12-05 20:04:26 +0900
commit9c3682b7462a82344b264d6a98d4e1c681588e76 (patch)
treed9fe54ed68903c0c8155874a733b99c2684b3254 /src/lib/evas/common
parent931d02378b3152b530d84bff09fd842cf0998f53 (diff)
evas - fix overdraw + too many rects problem found in some expedite tests
stable release - cherry-pick me! there way a problem with software rendering - it rendered some areas more than once per frame due to overlapping rectangles. it also had more rectangles to cover the same update area that it should have had. this fixes this.
Diffstat (limited to 'src/lib/evas/common')
-rw-r--r--src/lib/evas/common/evas_tiler.c28
1 files changed, 17 insertions, 11 deletions
diff --git a/src/lib/evas/common/evas_tiler.c b/src/lib/evas/common/evas_tiler.c
index 9f0fef58af..0a7353b032 100644
--- a/src/lib/evas/common/evas_tiler.c
+++ b/src/lib/evas/common/evas_tiler.c
@@ -749,14 +749,13 @@ rect_list_add_split_fuzzy_and_merge(list_t *rects,
749} 749}
750 750
751static inline int 751static inline int
752_add_redraw(list_t *rects, int x, int y, int w, int h) 752_add_redraw(list_t *rects, int x, int y, int w, int h, int fuzz)
753{ 753{
754 rect_node_t *rn; 754 rect_node_t *rn;
755 rn = (rect_node_t *)rect_list_node_pool_get(); 755 rn = (rect_node_t *)rect_list_node_pool_get();
756 rn->_lst = list_node_zeroed; 756 rn->_lst = list_node_zeroed;
757 rect_init(&rn->rect, x, y, w, h); 757 rect_init(&rn->rect, x, y, w, h);
758 rect_list_add_split_fuzzy_and_merge(rects, (list_node_t *)rn, 758 rect_list_add_split_fuzzy_and_merge(rects, (list_node_t *)rn, fuzz, fuzz);
759 FUZZ * FUZZ, FUZZ * FUZZ);
760 return 1; 759 return 1;
761} 760}
762 761
@@ -821,7 +820,7 @@ evas_common_tilebuf_add_redraw(Tilebuf *tb, int x, int y, int w, int h)
821 tb->prev_add.x = x; tb->prev_add.y = y; 820 tb->prev_add.x = x; tb->prev_add.y = y;
822 tb->prev_add.w = w; tb->prev_add.h = h; 821 tb->prev_add.w = w; tb->prev_add.h = h;
823 tb->prev_del.w = 0; tb->prev_del.h = 0; 822 tb->prev_del.w = 0; tb->prev_del.h = 0;
824 return _add_redraw(&tb->rects, x, y, w, h); 823 return _add_redraw(&tb->rects, x, y, w, h, FUZZ * FUZZ);
825} 824}
826 825
827EAPI int 826EAPI int
@@ -868,14 +867,18 @@ evas_common_tilebuf_get_render_rects(Tilebuf *tb)
868 Tilebuf_Rect *rects = NULL, *rbuf, *r; 867 Tilebuf_Rect *rects = NULL, *rbuf, *r;
869 int bx1 = 0, bx2 = 0, by1 = 0, by2 = 0, num = 0, x1, x2, y1, y2, i; 868 int bx1 = 0, bx2 = 0, by1 = 0, by2 = 0, num = 0, x1, x2, y1, y2, i;
870 869
870/* don't need this since the below is now always on
871 if (tb->need_merge) 871 if (tb->need_merge)
872 { 872 {
873 to_merge = tb->rects; 873 to_merge = tb->rects;
874 tb->rects = list_zeroed; 874 tb->rects = list_zeroed;
875 rect_list_merge_rects(&tb->rects, &to_merge, FUZZ * FUZZ); 875 rect_list_merge_rects(&tb->rects, &to_merge, 0);
876 tb->need_merge = 0; 876 tb->need_merge = 0;
877 } 877 }
878 if (tb->strict_tiles) 878 */
879 if (1)
880// always fuzz merge for optimal perf
881// if (!tb->strict_tiles)
879 { 882 {
880 // round up rects to tb->tile_size.w and tb->tile_size.h 883 // round up rects to tb->tile_size.w and tb->tile_size.h
881 to_merge = list_zeroed; 884 to_merge = list_zeroed;
@@ -889,11 +892,11 @@ evas_common_tilebuf_get_render_rects(Tilebuf *tb)
889 y1 = tb->tile_size.h * (y1 / tb->tile_size.h); 892 y1 = tb->tile_size.h * (y1 / tb->tile_size.h);
890 x2 = tb->tile_size.w * ((x2 + tb->tile_size.w - 1) / tb->tile_size.w); 893 x2 = tb->tile_size.w * ((x2 + tb->tile_size.w - 1) / tb->tile_size.w);
891 y2 = tb->tile_size.h * ((y2 + tb->tile_size.h - 1) / tb->tile_size.h); 894 y2 = tb->tile_size.h * ((y2 + tb->tile_size.h - 1) / tb->tile_size.h);
892 _add_redraw(&to_merge, x1, y1, x2 - x1, y2 - y1); 895 _add_redraw(&to_merge, x1, y1, x2 - x1, y2 - y1, 0);
893 } 896 }
894 rect_list_merge_rects(&tb->rects, &to_merge, FUZZ * FUZZ); 897 rect_list_clear(&tb->rects);
898 rect_list_merge_rects(&tb->rects, &to_merge, 0);
895 } 899 }
896
897 n = tb->rects.head; 900 n = tb->rects.head;
898 if (n) 901 if (n)
899 { 902 {
@@ -905,6 +908,11 @@ evas_common_tilebuf_get_render_rects(Tilebuf *tb)
905 n = n->next; 908 n = n->next;
906 for (; n; n = n->next) 909 for (; n; n = n->next)
907 { 910 {
911 RECTS_CLIP_TO_RECT(((rect_node_t *)n)->rect.left,
912 ((rect_node_t *)n)->rect.top,
913 ((rect_node_t *)n)->rect.width,
914 ((rect_node_t *)n)->rect.height,
915 0, 0, tb->outbuf_w, tb->outbuf_h);
908 x1 = ((rect_node_t *)n)->rect.left; 916 x1 = ((rect_node_t *)n)->rect.left;
909 if (x1 < bx1) bx1 = x1; 917 if (x1 < bx1) bx1 = x1;
910 x2 = x1 + ((rect_node_t *)n)->rect.width; 918 x2 = x1 + ((rect_node_t *)n)->rect.width;
@@ -948,8 +956,6 @@ evas_common_tilebuf_get_render_rects(Tilebuf *tb)
948 rect_t cur; 956 rect_t cur;
949 957
950 cur = ((rect_node_t *)n)->rect; 958 cur = ((rect_node_t *)n)->rect;
951 RECTS_CLIP_TO_RECT(cur.left, cur.top, cur.width, cur.height,
952 0, 0, tb->outbuf_w, tb->outbuf_h);
953 if ((cur.width > 0) && (cur.height > 0)) 959 if ((cur.width > 0) && (cur.height > 0))
954 { 960 {
955 r = &(rbuf[i]); 961 r = &(rbuf[i]);