diff options
Diffstat (limited to 'libraries/evas/src/lib/engines/common/evas_tiler.c')
-rw-r--r-- | libraries/evas/src/lib/engines/common/evas_tiler.c | 96 |
1 files changed, 70 insertions, 26 deletions
diff --git a/libraries/evas/src/lib/engines/common/evas_tiler.c b/libraries/evas/src/lib/engines/common/evas_tiler.c index ff359a4..bc5e99c 100644 --- a/libraries/evas/src/lib/engines/common/evas_tiler.c +++ b/libraries/evas/src/lib/engines/common/evas_tiler.c | |||
@@ -1167,40 +1167,84 @@ evas_common_tilebuf_get_render_rects(Tilebuf *tb) | |||
1167 | #elif defined(EVAS_RECT_SPLIT) | 1167 | #elif defined(EVAS_RECT_SPLIT) |
1168 | list_node_t *n; | 1168 | list_node_t *n; |
1169 | Tilebuf_Rect *rects = NULL; | 1169 | Tilebuf_Rect *rects = NULL; |
1170 | int bx1 = 0, bx2 = 0, by1 = 0, by2 = 0, num = 0; | ||
1170 | 1171 | ||
1171 | if (tb->need_merge) { | 1172 | if (tb->need_merge) |
1172 | list_t to_merge; | 1173 | { |
1173 | to_merge = tb->rects; | 1174 | list_t to_merge; |
1174 | tb->rects = list_zeroed; | 1175 | to_merge = tb->rects; |
1175 | rect_list_merge_rects(&tb->rects, &to_merge, FUZZ * FUZZ); | 1176 | tb->rects = list_zeroed; |
1176 | tb->need_merge = 0; | 1177 | rect_list_merge_rects(&tb->rects, &to_merge, FUZZ * FUZZ); |
1177 | } | 1178 | tb->need_merge = 0; |
1178 | 1179 | } | |
1179 | for (n = tb->rects.head; n; n = n->next) { | 1180 | |
1180 | rect_t cur; | 1181 | n = tb->rects.head; |
1182 | if (n) | ||
1183 | { | ||
1184 | bx1 = ((rect_node_t *)n)->rect.left; | ||
1185 | bx2 = bx1 + ((rect_node_t *)n)->rect.width; | ||
1186 | by1 = ((rect_node_t *)n)->rect.top; | ||
1187 | by2 = by1 + ((rect_node_t *)n)->rect.height; | ||
1188 | n = n->next; | ||
1189 | for (; n; n = n->next) | ||
1190 | { | ||
1191 | |||
1192 | int x1, x2, y1, y2; | ||
1193 | |||
1194 | x1 = ((rect_node_t *)n)->rect.left; | ||
1195 | if (x1 < bx1) bx1 = x1; | ||
1196 | x2 = x1 + ((rect_node_t *)n)->rect.width; | ||
1197 | if (x2 > bx2) bx2 = x2; | ||
1198 | |||
1199 | y1 = ((rect_node_t *)n)->rect.top; | ||
1200 | if (y1 < by1) by1 = y1; | ||
1201 | y2 = y1 + ((rect_node_t *)n)->rect.height; | ||
1202 | if (y2 > by2) by2 = y2; | ||
1203 | num++; | ||
1204 | } | ||
1205 | } | ||
1206 | #define MAXREG 24 | ||
1207 | /* magic number - but if we have > MAXREG regions to update, take bounding box */ | ||
1208 | if (num > MAXREG) | ||
1209 | { | ||
1210 | Tilebuf_Rect *r; | ||
1211 | |||
1212 | r = malloc(sizeof(Tilebuf_Rect)); | ||
1213 | r->x = bx1; | ||
1214 | r->y = by1; | ||
1215 | r->w = bx2 - bx1; | ||
1216 | r->h = by2 - by1; | ||
1217 | |||
1218 | rects = (Tilebuf_Rect *)eina_inlist_append(EINA_INLIST_GET(rects), EINA_INLIST_GET(r)); | ||
1219 | return rects; | ||
1220 | } | ||
1181 | 1221 | ||
1182 | cur = ((rect_node_t *)n)->rect; | 1222 | for (n = tb->rects.head; n; n = n->next) |
1223 | { | ||
1224 | rect_t cur; | ||
1225 | |||
1226 | cur = ((rect_node_t *)n)->rect; | ||
1183 | /* disable fuzz - created bugs. | 1227 | /* disable fuzz - created bugs. |
1184 | cur.left <<= 1; | 1228 | cur.left <<= 1; |
1185 | cur.top <<= 1; | 1229 | cur.top <<= 1; |
1186 | cur.width <<= 1; | 1230 | cur.width <<= 1; |
1187 | cur.height <<= 1; | 1231 | cur.height <<= 1; |
1188 | */ | 1232 | */ |
1189 | RECTS_CLIP_TO_RECT(cur.left, cur.top, cur.width, cur.height, | 1233 | RECTS_CLIP_TO_RECT(cur.left, cur.top, cur.width, cur.height, |
1190 | 0, 0, tb->outbuf_w, tb->outbuf_h); | 1234 | 0, 0, tb->outbuf_w, tb->outbuf_h); |
1191 | if ((cur.width > 0) && (cur.height > 0)) | 1235 | if ((cur.width > 0) && (cur.height > 0)) |
1192 | { | 1236 | { |
1193 | Tilebuf_Rect *r; | 1237 | Tilebuf_Rect *r; |
1194 | 1238 | ||
1195 | r = malloc(sizeof(Tilebuf_Rect)); | 1239 | r = malloc(sizeof(Tilebuf_Rect)); |
1196 | r->x = cur.left; | 1240 | r->x = cur.left; |
1197 | r->y = cur.top; | 1241 | r->y = cur.top; |
1198 | r->w = cur.width; | 1242 | r->w = cur.width; |
1199 | r->h = cur.height; | 1243 | r->h = cur.height; |
1200 | 1244 | ||
1201 | rects = (Tilebuf_Rect *)eina_inlist_append(EINA_INLIST_GET(rects), EINA_INLIST_GET(r)); | 1245 | rects = (Tilebuf_Rect *)eina_inlist_append(EINA_INLIST_GET(rects), EINA_INLIST_GET(r)); |
1202 | } | 1246 | } |
1203 | } | 1247 | } |
1204 | return rects; | 1248 | return rects; |
1205 | 1249 | ||
1206 | #else | 1250 | #else |