summaryrefslogtreecommitdiff
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
parent1fae1b979a5bd4af4146d33127c456475c1be00e (diff)
downloadefl-6e460922bb0b0d257b5f328229e53ab6c57c1a85.tar.gz
tiler - add maxreg for newtiler - not used atm but matches current
-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 @@
#ifdef NEWTILER
+#define MAXREG 24
+
EAPI void
evas_common_tilebuf_init(void)
{
@@ -99,7 +101,7 @@ evas_common_tilebuf_get_render_rects(Tilebuf *tb)
Tilebuf_Rect *rects = NULL, *r, *rend, *rbuf;
Region *region2;
Box *rects2, *rs;
- int n;
+ int n, num, minx, miny, maxx, maxy;
region2 = _region_round(tb->region, 16);
if (!region2) return NULL;
@@ -126,8 +128,18 @@ evas_common_tilebuf_get_render_rects(Tilebuf *tb)
rend = rbuf + n;
rs = rects2;
+ num = 0;
+
+ minx = rs->x1;
+ miny = rs->y1;
+ maxx = rs->x2;
+ maxy = rs->y2;
for (r = rbuf; r < rend; r++)
{
+ if (rs->x1 < minx) minx = rs->x1;
+ if (rs->y1 < miny) miny = rs->y1;
+ if (rs->x2 > maxx) maxx = rs->x2;
+ if (rs->y2 > maxy) maxy = rs->y2;
EINA_INLIST_GET(r)->next = NULL;
EINA_INLIST_GET(r)->prev = NULL;
EINA_INLIST_GET(r)->last = NULL;
@@ -139,6 +151,19 @@ evas_common_tilebuf_get_render_rects(Tilebuf *tb)
rects = (Tilebuf_Rect *)
eina_inlist_append(EINA_INLIST_GET(rects),
EINA_INLIST_GET(r));
+ num++;
+ }
+ // if > max, then bounding box
+ if (num > MAXREG)
+ {
+ r = rects;
+ EINA_INLIST_GET(r)->next = NULL;
+ EINA_INLIST_GET(r)->prev = NULL;
+ EINA_INLIST_GET(r)->last = NULL;
+ r->x = minx;
+ r->y = miny;
+ r->w = maxx - minx;
+ r->h = maxy - miny;
}
region_free(region2);
return rects;