summaryrefslogtreecommitdiff
path: root/src/lib/evas/common/evas_tiler.c
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2020-06-04 20:22:03 +0100
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2020-06-04 20:22:03 +0100
commit6e460922bb0b0d257b5f328229e53ab6c57c1a85 (patch)
tree9c17734f84cffa56bba2c590c13edc6b930c82d6 /src/lib/evas/common/evas_tiler.c
parent1fae1b979a5bd4af4146d33127c456475c1be00e (diff)
tiler - add maxreg for newtiler - not used atm but matches current
Diffstat (limited to '')
-rw-r--r--src/lib/evas/common/evas_tiler.c27
1 files changed, 26 insertions, 1 deletions
diff --git a/src/lib/evas/common/evas_tiler.c b/src/lib/evas/common/evas_tiler.c
index 0aff533b40..8105ec6f1d 100644
--- a/src/lib/evas/common/evas_tiler.c
+++ b/src/lib/evas/common/evas_tiler.c
@@ -3,6 +3,8 @@
3 3
4 4
5#ifdef NEWTILER 5#ifdef NEWTILER
6#define MAXREG 24
7
6EAPI void 8EAPI void
7evas_common_tilebuf_init(void) 9evas_common_tilebuf_init(void)
8{ 10{
@@ -99,7 +101,7 @@ evas_common_tilebuf_get_render_rects(Tilebuf *tb)
99 Tilebuf_Rect *rects = NULL, *r, *rend, *rbuf; 101 Tilebuf_Rect *rects = NULL, *r, *rend, *rbuf;
100 Region *region2; 102 Region *region2;
101 Box *rects2, *rs; 103 Box *rects2, *rs;
102 int n; 104 int n, num, minx, miny, maxx, maxy;
103 105
104 region2 = _region_round(tb->region, 16); 106 region2 = _region_round(tb->region, 16);
105 if (!region2) return NULL; 107 if (!region2) return NULL;
@@ -126,8 +128,18 @@ evas_common_tilebuf_get_render_rects(Tilebuf *tb)
126 128
127 rend = rbuf + n; 129 rend = rbuf + n;
128 rs = rects2; 130 rs = rects2;
131 num = 0;
132
133 minx = rs->x1;
134 miny = rs->y1;
135 maxx = rs->x2;
136 maxy = rs->y2;
129 for (r = rbuf; r < rend; r++) 137 for (r = rbuf; r < rend; r++)
130 { 138 {
139 if (rs->x1 < minx) minx = rs->x1;
140 if (rs->y1 < miny) miny = rs->y1;
141 if (rs->x2 > maxx) maxx = rs->x2;
142 if (rs->y2 > maxy) maxy = rs->y2;
131 EINA_INLIST_GET(r)->next = NULL; 143 EINA_INLIST_GET(r)->next = NULL;
132 EINA_INLIST_GET(r)->prev = NULL; 144 EINA_INLIST_GET(r)->prev = NULL;
133 EINA_INLIST_GET(r)->last = NULL; 145 EINA_INLIST_GET(r)->last = NULL;
@@ -139,6 +151,19 @@ evas_common_tilebuf_get_render_rects(Tilebuf *tb)
139 rects = (Tilebuf_Rect *) 151 rects = (Tilebuf_Rect *)
140 eina_inlist_append(EINA_INLIST_GET(rects), 152 eina_inlist_append(EINA_INLIST_GET(rects),
141 EINA_INLIST_GET(r)); 153 EINA_INLIST_GET(r));
154 num++;
155 }
156 // if > max, then bounding box
157 if (num > MAXREG)
158 {
159 r = rects;
160 EINA_INLIST_GET(r)->next = NULL;
161 EINA_INLIST_GET(r)->prev = NULL;
162 EINA_INLIST_GET(r)->last = NULL;
163 r->x = minx;
164 r->y = miny;
165 r->w = maxx - minx;
166 r->h = maxy - miny;
142 } 167 }
143 region_free(region2); 168 region_free(region2);
144 return rects; 169 return rects;