summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Haitzler <raster@rasterman.com>2005-02-05 02:30:13 +0000
committerCarsten Haitzler <raster@rasterman.com>2005-02-05 02:30:13 +0000
commite79e53e35b01b0197880c317f3c5c223773be6d4 (patch)
treea1283b726ab66ca81dc451b6f1470a05f81dab31
parent871a93a8d1b554af5e16b7b7e075309fa734db99 (diff)
i worked on a regionbuf set of code (exact rectangles). i THINK it has some
bugs... but its disabled right now and it didnt speed anything up :( but it's there for perusal and later work anyway... SVN revision: 13193
Diffstat (limited to '')
-rw-r--r--legacy/evas/src/bin/evas_test_main.c1
-rw-r--r--legacy/evas/src/lib/canvas/evas_object_textblock.c63
-rw-r--r--legacy/evas/src/lib/engines/buffer/evas_engine.c2
-rw-r--r--legacy/evas/src/lib/engines/common/Makefile.am1
-rw-r--r--legacy/evas/src/lib/engines/common/evas_draw_main.c41
-rw-r--r--legacy/evas/src/lib/engines/common/evas_regionbuf.c355
-rw-r--r--legacy/evas/src/lib/engines/common/evas_tiler.c37
-rw-r--r--legacy/evas/src/lib/include/evas_common.h36
8 files changed, 512 insertions, 24 deletions
diff --git a/legacy/evas/src/bin/evas_test_main.c b/legacy/evas/src/bin/evas_test_main.c
index f5b476b69d..9de77f1984 100644
--- a/legacy/evas/src/bin/evas_test_main.c
+++ b/legacy/evas/src/bin/evas_test_main.c
@@ -344,6 +344,7 @@ loop(void)
344 printf("# EVAS BENCH: %3.3f\n", ((double)frames / (t - time_start)) / 60.0); 344 printf("# EVAS BENCH: %3.3f\n", ((double)frames / (t - time_start)) / 60.0);
345 printf("#\n"); 345 printf("#\n");
346 printf("####################################################\n"); 346 printf("####################################################\n");
347 exit(0);
347 for (i = 0; i < 16; i++) evas_object_del(p_s[i]); 348 for (i = 0; i < 16; i++) evas_object_del(p_s[i]);
348 for (i = 0; i < 2; i++) evas_object_del(p_i[i]); 349 for (i = 0; i < 2; i++) evas_object_del(p_i[i]);
349 for (i = 0; i < 16; i++) evas_object_del(p_t[i]); 350 for (i = 0; i < 16; i++) evas_object_del(p_t[i]);
diff --git a/legacy/evas/src/lib/canvas/evas_object_textblock.c b/legacy/evas/src/lib/canvas/evas_object_textblock.c
index 52c8e021fd..54ced1383f 100644
--- a/legacy/evas/src/lib/canvas/evas_object_textblock.c
+++ b/legacy/evas/src/lib/canvas/evas_object_textblock.c
@@ -15,7 +15,6 @@
15 * * strikethrough support 15 * * strikethrough support
16 * * solid bg behind text 16 * * solid bg behind text
17 * * if a word (or char) doesnt fit at all do something sensible 17 * * if a word (or char) doesnt fit at all do something sensible
18 * * layout nodes need to be able to give their source node and offset
19 * * styles (outline, glow, etxra glow, shadow, soft shadow, etc.) 18 * * styles (outline, glow, etxra glow, shadow, soft shadow, etc.)
20 * * anchors (to query text extents) 19 * * anchors (to query text extents)
21 * * query text pos given object-relative co-ords 20 * * query text pos given object-relative co-ords
@@ -69,9 +68,20 @@ struct _Layout
69 } font; 68 } font;
70 struct { 69 struct {
71 unsigned char r, g, b, a; 70 unsigned char r, g, b, a;
72 } color, underline_color, outline_color, shadow_color; 71 } color,
72 underline_color,
73 double_underline_color,
74 outline_color,
75 shadow_color,
76 glow_color,
77 outer_glow_color,
78 backing_color,
79 strikethrough_color
80 ;
73 struct { 81 struct {
74 int inset, x, y, ascent, descent, mascent, mdescent; 82 int inset, x, y,
83 ascent, descent,
84 mascent, mdescent;
75 } line; 85 } line;
76 double align, valign; 86 double align, valign;
77 unsigned char word_wrap : 1; 87 unsigned char word_wrap : 1;
@@ -96,6 +106,10 @@ struct _Layout_Node
96 Layout layout; 106 Layout layout;
97 char *text; /* text data until the next node */ 107 char *text; /* text data until the next node */
98 int w, h; 108 int w, h;
109 Node *source_node;
110 int source_pos;
111 unsigned char line_start : 1;
112 unsigned char line_end : 1;
99}; 113};
100 114
101struct _Evas_Object_Textblock 115struct _Evas_Object_Textblock
@@ -130,18 +144,13 @@ evas_object_textblock_layout_init(Layout *layout)
130 layout->color.g = 255; 144 layout->color.g = 255;
131 layout->color.b = 255; 145 layout->color.b = 255;
132 layout->color.a = 255; 146 layout->color.a = 255;
133 layout->underline_color.r = 255; 147 layout->underline_color = layout->color;
134 layout->underline_color.g = 255; 148 layout->double_underline_color = layout->color;
135 layout->underline_color.b = 255; 149 layout->outline_color = layout->color;
136 layout->underline_color.a = 255; 150 layout->shadow_color = layout->color;
137 layout->outline_color.r = 255; 151 layout->glow_color = layout->color;
138 layout->outline_color.g = 255; 152 layout->outer_glow_color = layout->color;
139 layout->outline_color.b = 255; 153 layout->strikethrough_color = layout->color;
140 layout->outline_color.a = 255;
141 layout->shadow_color.r = 255;
142 layout->shadow_color.g = 255;
143 layout->shadow_color.b = 255;
144 layout->shadow_color.a = 255;
145 layout->line.inset = 0; 154 layout->line.inset = 0;
146 layout->line.x = 0; 155 layout->line.x = 0;
147 layout->line.y = 0; 156 layout->line.y = 0;
@@ -520,9 +529,11 @@ evas_object_textblock_layout(Evas_Object *obj)
520 Layout_Node *lnode; 529 Layout_Node *lnode;
521 Node *node; 530 Node *node;
522 531
523 /* FIXME: if we overflow then this would be punted to an overflow */ 532 /* FIXME: we cant do this - we need to be able to qury text
524 /* object instead */ 533 * overflow amounts */
534 /*
525 if (layout.line.y >= h) goto breakout; 535 if (layout.line.y >= h) goto breakout;
536 */
526 node = (Node *)l; 537 node = (Node *)l;
527// printf("NODE: FMT:\"%s\" TXT:\"%s\"\n", node->format, node->text); 538// printf("NODE: FMT:\"%s\" TXT:\"%s\"\n", node->format, node->text);
528 if (node->format) 539 if (node->format)
@@ -530,12 +541,14 @@ evas_object_textblock_layout(Evas_Object *obj)
530 /* first handle newline, tab etc. etc */ 541 /* first handle newline, tab etc. etc */
531 if (!strcmp(node->format, "\n")) 542 if (!strcmp(node->format, "\n"))
532 { 543 {
544 if (lnode)
545 lnode->line_end = 1;
533 layout.line.x = 0; 546 layout.line.x = 0;
534 if ((layout.line.y + lnode->layout.line.mascent + lnode->layout.line.mdescent) > h) 547 if ((layout.line.y + layout.line.mascent + layout.line.mdescent) > h)
535 { 548 {
536 /* FIXME: this node would overflow to the next textblock */ 549 /* FIXME: this node would overflow to the next textblock */
537 } 550 }
538 layout.line.y += lnode->layout.line.mascent + lnode->layout.line.mdescent; 551 layout.line.y += layout.line.mascent + layout.line.mdescent;
539 } 552 }
540 else 553 else
541 evas_object_textblock_layout_format_modify(&layout, node->format); 554 evas_object_textblock_layout_format_modify(&layout, node->format);
@@ -548,15 +561,22 @@ evas_object_textblock_layout(Evas_Object *obj)
548 void *font = NULL; 561 void *font = NULL;
549 char *text; 562 char *text;
550 int adj, lastnode; 563 int adj, lastnode;
564 int srcpos = 0;
551 565
552 text = strdup(node->text); 566 text = strdup(node->text);
553 new_node: 567 new_node:
568 /* FIXME: we cant do this - we need to be able to qury text
569 * overflow amounts */
570 /*
554 if (layout.line.y >= h) 571 if (layout.line.y >= h)
555 { 572 {
556 free(text); 573 free(text);
557 goto breakout; 574 goto breakout;
558 } 575 }
576 */
559 lnode = calloc(1, sizeof(Layout_Node)); 577 lnode = calloc(1, sizeof(Layout_Node));
578 lnode->source_node = node;
579 lnode->source_pos = srcpos;
560 evas_object_textblock_layout_copy(&layout, &(lnode->layout)); 580 evas_object_textblock_layout_copy(&layout, &(lnode->layout));
561 if (lnode->layout.font.name) 581 if (lnode->layout.font.name)
562 font = evas_font_load(obj->layer->evas, lnode->layout.font.name, lnode->layout.font.source, lnode->layout.font.size); 582 font = evas_font_load(obj->layer->evas, lnode->layout.font.name, lnode->layout.font.source, lnode->layout.font.size);
@@ -569,6 +589,7 @@ evas_object_textblock_layout(Evas_Object *obj)
569 layout.line.mascent = 0; 589 layout.line.mascent = 0;
570 layout.line.mdescent = 0; 590 layout.line.mdescent = 0;
571 line_start = lnode; 591 line_start = lnode;
592 lnode->line_start = 1;
572 } 593 }
573 lnode->layout.font.font = font; 594 lnode->layout.font.font = font;
574 if (font) ascent = ENFN->font_max_ascent_get(ENDT, font); 595 if (font) ascent = ENFN->font_max_ascent_get(ENDT, font);
@@ -663,6 +684,7 @@ evas_object_textblock_layout(Evas_Object *obj)
663 text2 = strdup(text + chrpos); 684 text2 = strdup(text + chrpos);
664 lnode->text = text1; 685 lnode->text = text1;
665 free(text); 686 free(text);
687 srcpos += chrpos;
666 text = text1; 688 text = text1;
667 if (font) ENFN->font_string_size_get(ENDT, font, text, &tw, &th); 689 if (font) ENFN->font_string_size_get(ENDT, font, text, &tw, &th);
668 lnode->w = tw; 690 lnode->w = tw;
@@ -680,9 +702,10 @@ evas_object_textblock_layout(Evas_Object *obj)
680 lnode2->layout.line.mdescent = layout.line.mdescent; 702 lnode2->layout.line.mdescent = layout.line.mdescent;
681 if (ll == (Evas_Object_List *)line_start) break; 703 if (ll == (Evas_Object_List *)line_start) break;
682 } 704 }
705 lnode->line_end = 1;
683 layout.line.inset = 0; 706 layout.line.inset = 0;
684 layout.line.x = 0; 707 layout.line.x = 0;
685 if ((layout.line.y + lnode->layout.line.mascent + lnode->layout.line.mdescent) > h) 708 if ((layout.line.y + layout.line.mascent + layout.line.mdescent) > h)
686 { 709 {
687 /* FIXME: this node would overflow to the next textblock */ 710 /* FIXME: this node would overflow to the next textblock */
688 } 711 }
diff --git a/legacy/evas/src/lib/engines/buffer/evas_engine.c b/legacy/evas/src/lib/engines/buffer/evas_engine.c
index 4970701370..7db37e8441 100644
--- a/legacy/evas/src/lib/engines/buffer/evas_engine.c
+++ b/legacy/evas/src/lib/engines/buffer/evas_engine.c
@@ -284,7 +284,7 @@ evas_engine_buffer_output_setup(int w,
284 } 284 }
285 re->tb = evas_common_tilebuf_new(w, h); 285 re->tb = evas_common_tilebuf_new(w, h);
286 /* in preliminary tests 16x16 gave highest framerates */ 286 /* in preliminary tests 16x16 gave highest framerates */
287 evas_common_tilebuf_set_tile_size(re->tb, 16, 16); 287 evas_common_tilebuf_set_tile_size(re->tb, 16, 16);
288 return re; 288 return re;
289} 289}
290 290
diff --git a/legacy/evas/src/lib/engines/common/Makefile.am b/legacy/evas/src/lib/engines/common/Makefile.am
index 1bb596b202..ce38c3a4e5 100644
--- a/legacy/evas/src/lib/engines/common/Makefile.am
+++ b/legacy/evas/src/lib/engines/common/Makefile.am
@@ -46,6 +46,7 @@ evas_scale_main.c \
46evas_scale_sample.c \ 46evas_scale_sample.c \
47evas_scale_smooth.c \ 47evas_scale_smooth.c \
48evas_tiler.c \ 48evas_tiler.c \
49evas_regionbuf.c \
49evas_blend_ops.h 50evas_blend_ops.h
50 51
51EXTRA_DIST = \ 52EXTRA_DIST = \
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 2161954a0e..2470e04027 100644
--- a/legacy/evas/src/lib/engines/common/evas_draw_main.c
+++ b/legacy/evas/src/lib/engines/common/evas_draw_main.c
@@ -496,6 +496,47 @@ evas_common_draw_context_cutout_split(Cutout_Rect *in, Cutout_Rect *split)
496 return out; 496 return out;
497 } 497 }
498 return NULL; 498 return NULL;
499#undef INX1
500#undef INX2
501#undef SPX1
502#undef SPX2
503#undef INY1
504#undef INY2
505#undef SPY1
506#undef SPY2
507#undef X1_IN
508#undef X2_IN
509#undef Y1_IN
510#undef Y2_IN
511#undef R_NEW
512}
513
514Cutout_Rect *
515evas_common_draw_context_cutout_merge(Cutout_Rect *in, Cutout_Rect *merge)
516{
517 /* 1 input rect, multiple out */
518 Cutout_Rect *out;
519 Cutout_Rect *r;
520 Evas_Object_List *l;
521
522 for (l = (Evas_Object_List *)in; l; l = l->next)
523 {
524 r = (Cutout_Rect *)l;
525
526 merge = evas_common_draw_context_cutouts_split(merge, r);
527 if (!merge) return in;
528 }
529 r = merge;
530 out = in;
531 while (r)
532 {
533 Cutout_Rect *r2;
534
535 r2 = r;
536 r = evas_object_list_remove(r, r);
537 out = evas_object_list_append(out, r2);
538 }
539 return out;
499} 540}
500 541
501Gfx_Func_Blend_Src_Dst 542Gfx_Func_Blend_Src_Dst
diff --git a/legacy/evas/src/lib/engines/common/evas_regionbuf.c b/legacy/evas/src/lib/engines/common/evas_regionbuf.c
new file mode 100644
index 0000000000..5fb38f57bb
--- /dev/null
+++ b/legacy/evas/src/lib/engines/common/evas_regionbuf.c
@@ -0,0 +1,355 @@
1#include "evas_common.h"
2
3Regionbuf *
4evas_common_regionbuf_new(int w, int h)
5{
6 Regionbuf *rb;
7
8 rb = calloc(1, sizeof(Regionbuf) + (h * sizeof(Regionspan)));
9 if (!rb) return NULL;
10 rb->spans = (Regionspan **)(rb + sizeof(Regionbuf));
11 rb->w = w;
12 rb->h = h;
13 return rb;
14}
15
16void
17evas_common_regionbuf_free(Regionbuf *rb)
18{
19 evas_common_regionbuf_clear(rb);
20 free(rb);
21}
22
23void
24evas_common_regionbuf_clear(Regionbuf *rb)
25{
26 int y;
27
28 for (y = 0; y < rb->h; y++)
29 {
30 while (rb->spans[y])
31 {
32 Regionspan *span;
33
34 span = rb->spans[y];
35 rb->spans[y] = evas_object_list_remove(rb->spans[y], rb->spans[y]);
36 free(span);
37 }
38 }
39}
40
41void
42evas_common_regionbuf_span_add(Regionbuf *rb, int x1, int x2, int y)
43{
44 Evas_Object_List *l;
45 Regionspan *span, *span2, *nspan, *sp_start, *sp_stop;
46
47 /* abort if outside */
48 if ((y < 0) ||
49 (y >= rb->h) ||
50 (x2 < 0) ||
51 (x1 >= rb->w)) return;
52 /* clip to horiz bounds */
53 if (x1 < 0) x1 = 0;
54 if (x2 < (rb->w - 1)) x2 = rb->w - 1;
55 sp_start = NULL;
56 sp_stop = NULL;
57 for (l = (Evas_Object_List *)rb->spans[y]; l; l = l->next)
58 {
59 span = (Regionspan *)l;
60 nspan = (Regionspan *)l->next;
61 /* we dont know what t do with the span yet */
62 if (!sp_start)
63 {
64 /* if new span starts before or on this span or just after
65 * with no gap */
66 if (x1 <= (span->x2 + 1))
67 sp_start = span;
68 /* if there is no next span */
69 if (!nspan)
70 {
71 sp_stop = span;
72 break;
73 }
74 /* if new span ends before the next span starts with a gap of
75 * 1 pixel (or more) */
76 else if (x2 < (nspan->x1 - 1))
77 {
78 sp_stop = span;
79 break;
80 }
81 }
82 /* we already know it already starts before or in sp_start */
83 else
84 {
85 /* there is no span after this one, so this has to be the stop */
86 if (!nspan)
87 {
88 sp_stop = span;
89 break;
90 }
91 /* if new span ends before the next span starts with a gap of
92 * 1 pixel (or more) */
93 else if (x2 < (nspan->x1 - 1))
94 {
95 sp_stop = span;
96 break;
97 }
98 }
99 }
100 /* sp_start is where the new span starts in or before */
101 /* sp_stop is where the new span stops in or after */
102 if ((sp_start) && (sp_stop))
103 {
104 /* same start and stop */
105 if (sp_start == sp_stop)
106 {
107 if (x2 < (sp_start->x1 - 1))
108 {
109 span2 = calloc(1, sizeof(Regionspan));
110 span2->x1 = x1;
111 span2->x2 = x2;
112 rb->spans[y] = evas_object_list_prepend_relative(rb->spans[y], span2, sp_start);
113 return;
114 }
115 if (x1 < sp_start->x1)
116 sp_start->x1 = x1;
117 if (x2 > sp_start->x2)
118 sp_start->x2 = x2;
119 return;
120 }
121 else
122 {
123 /* remove all nodes after sp_start and before_sp_stop because
124 * the new */
125 for (l = ((Evas_Object_List *)sp_start)->next; l != (Evas_Object_List *)sp_stop;)
126 {
127 span = (Regionspan *)l;
128 l = l->next;
129 rb->spans[y] = evas_object_list_remove(rb->spans[y], span);
130 free(span);
131 }
132 /* remove the end span */
133 rb->spans[y] = evas_object_list_remove(rb->spans[y], sp_stop);
134 /* if the new span is before the start span - extend */
135 if (x1 < sp_start->x1)
136 sp_start->x1 = x1;
137 /* if it goes beyond the stop span - extend stop span */
138 if (x2 > sp_stop->x2)
139 sp_stop->x2 = x2;
140 /* extend start span to stop span */
141 sp_start->x2 = sp_stop->x2;
142 /* don't need stop span anymore */
143 free(sp_stop);
144 return;
145 }
146 }
147 /* no start AND stop... just append */
148 span2 = calloc(1, sizeof(Regionspan));
149 span2->x1 = x1;
150 span2->x2 = x2;
151 rb->spans[y] = evas_object_list_append(rb->spans[y], span2);
152}
153
154void
155evas_common_regionbuf_span_del(Regionbuf *rb, int x1, int x2, int y)
156{
157 /* FIXME: del span */
158 Evas_Object_List *l;
159 Regionspan *span, *span2, *nspan, *sp_start, *sp_stop;
160
161 /* abort if outside */
162 if ((y < 0) ||
163 (y >= rb->h) ||
164 (x2 < 0) ||
165 (x1 >= rb->w)) return;
166 /* clip to horiz bounds */
167 if (x1 < 0) x1 = 0;
168 if (x2 < (rb->w - 1)) x2 = rb->w - 1;
169 sp_start = NULL;
170 sp_stop = NULL;
171 for (l = (Evas_Object_List *)rb->spans[y]; l; l = l->next)
172 {
173 span = (Regionspan *)l;
174 nspan = (Regionspan *)l->next;
175 /* we dont know what t do with the span yet */
176 if (!sp_start)
177 {
178 /* if new span starts before or on this span or just after
179 * with no gap */
180 if (x1 <= (span->x2))
181 sp_start = span;
182 /* if there is no next span */
183 if (!nspan)
184 {
185 sp_stop = span;
186 break;
187 }
188 /* if new span ends before the next span starts with a gap of
189 * 1 pixel (or more) */
190 else if (x2 < nspan->x1)
191 {
192 sp_stop = span;
193 break;
194 }
195 }
196 /* we already know it already starts before or in sp_start */
197 else
198 {
199 /* there is no span after this one, so this has to be the stop */
200 if (!nspan)
201 {
202 sp_stop = span;
203 break;
204 }
205 /* if new span ends before the next span starts with a gap of
206 * 1 pixel (or more) */
207 else if (x2 < nspan->x1)
208 {
209 sp_stop = span;
210 break;
211 }
212 }
213 }
214 /* sp_start is where the new span starts in or before */
215 /* sp_stop is where the new span stops in or after */
216 if ((sp_start) && (sp_stop))
217 {
218 /* same start and stop */
219 if (sp_start == sp_stop)
220 {
221 /* if it ends before this the span start starts... return */
222 if (x2 < sp_start->x1)
223 return;
224 /* it starts on or before this span */
225 else if (x1 <= sp_start->x1)
226 {
227 /* right edge is within the span */
228 if (x2 < sp_start->x2)
229 {
230 sp_start->x2 = x2;
231 return;
232 }
233 else
234 {
235 rb->spans[y] = evas_object_list_remove(rb->spans[y], sp_start);
236 return;
237 }
238 }
239 /* it ends on or after the end of thsi span */
240 else if (x2 >= sp_start->x2)
241 {
242 /* it starts after the start */
243 if (x1 > sp_start->x1)
244 {
245 sp_start->x1 = x1;
246 return;
247 }
248 /* remove it all */
249 else
250 {
251 rb->spans[y] = evas_object_list_remove(rb->spans[y], sp_start);
252 return;
253 }
254 return;
255 }
256 /* this breaks the span into 2 */
257 else
258 {
259 span2 = calloc(1, sizeof(Regionspan));
260 span2->x1 = sp_start->x1;
261 span2->x2 = x1 - 1;
262 rb->spans[y] = evas_object_list_prepend_relative(rb->spans[y], span2, sp_start);
263 sp_start->x1 = x2 + 1;
264 return;
265 }
266 }
267 else
268 {
269 /* remove all nodes after sp_start and before_sp_stop because
270 * the new */
271 for (l = ((Evas_Object_List *)sp_start)->next; l != (Evas_Object_List *)sp_stop;)
272 {
273 span = (Regionspan *)l;
274 l = l->next;
275 rb->spans[y] = evas_object_list_remove(rb->spans[y], span);
276 free(span);
277 }
278 /* all of the start span is cut out */
279 if (x1 <= sp_start->x1)
280 {
281 rb->spans[y] = evas_object_list_remove(rb->spans[y], sp_start);
282 free(sp_start);
283 }
284 /* chup it off at the new span start */
285 else
286 sp_start->x2 = x1 - 1;
287 /* all of the end span is cut out */
288 if (x2 >= sp_stop->x2)
289 {
290 rb->spans[y] = evas_object_list_remove(rb->spans[y], sp_stop);
291 free(sp_stop);
292 }
293 /* chop it up at the end */
294 else
295 sp_stop->x1 = x2 + 1;
296 return;
297 }
298 }
299}
300
301Tilebuf_Rect *
302evas_common_regionbuf_rects_get(Regionbuf *rb)
303{
304 Tilebuf_Rect *rects = NULL, *r;
305 int y;
306
307 /* FIXME: take spans, make rects */
308 for (y = 0; y < rb->h; y++)
309 {
310 Evas_Object_List *l, *ll;
311
312 for (l = (Evas_Object_List *)rb->spans[y]; l;)
313 {
314 Regionspan *span;
315 Regionspan *sp_start;
316 int yy;
317
318 sp_start = (Regionspan *)l;
319 l = l->next;
320 rb->spans[y] = evas_object_list_remove(rb->spans[y], sp_start);
321 for (yy = y + 1; yy < rb->h; yy++)
322 {
323 int match = 0;
324
325 for (ll = (Evas_Object_List *)rb->spans[yy]; ll;)
326 {
327 span = (Regionspan *)ll;
328 ll = ll->next;
329 if (span->x1 == sp_start->x1)
330 {
331 if ((span->x1 != sp_start->x1) ||
332 (span->x2 != sp_start->x2))
333 {
334 goto coallate;
335 }
336 match = 1;
337 rb->spans[yy] = evas_object_list_remove(rb->spans[yy], span);
338 free(span);
339 }
340 }
341 if (!match) goto coallate;
342 }
343 coallate:
344 r = calloc(1, sizeof(Tilebuf_Rect));
345 r->x = sp_start->x1;
346 r->y = y;
347 r->w = sp_start->x2 - sp_start->x1 + 1;
348 r->h = yy - y;
349 rects = evas_object_list_append(rects, r);
350 free(sp_start);
351 }
352 }
353 evas_common_regionbuf_clear(rb);
354 return rects;
355}
diff --git a/legacy/evas/src/lib/engines/common/evas_tiler.c b/legacy/evas/src/lib/engines/common/evas_tiler.c
index 660fe078dd..e9d9b51600 100644
--- a/legacy/evas/src/lib/engines/common/evas_tiler.c
+++ b/legacy/evas/src/lib/engines/common/evas_tiler.c
@@ -2,9 +2,12 @@
2 2
3#define TILE(tb, x, y) ((tb)->tiles.tiles[((y) * (tb)->tiles.w) + (x)]) 3#define TILE(tb, x, y) ((tb)->tiles.tiles[((y) * (tb)->tiles.w) + (x)])
4 4
5#ifdef RECTUPDATE
6#else
5static int tilebuf_x_intersect(Tilebuf *tb, int x, int w, int *x1, int *x2, int *x1_fill, int *x2_fill); 7static int tilebuf_x_intersect(Tilebuf *tb, int x, int w, int *x1, int *x2, int *x1_fill, int *x2_fill);
6static int tilebuf_y_intersect(Tilebuf *tb, int y, int h, int *y1, int *y2, int *y1_fill, int *y2_fill); 8static int tilebuf_y_intersect(Tilebuf *tb, int y, int h, int *y1, int *y2, int *y1_fill, int *y2_fill);
7static int tilebuf_intersect(int tsize, int tlen, int tnum, int x, int w, int *x1, int *x2, int *x1_fill, int *x2_fill); 9static int tilebuf_intersect(int tsize, int tlen, int tnum, int x, int w, int *x1, int *x2, int *x1_fill, int *x2_fill);
10#endif
8static void tilebuf_setup(Tilebuf *tb); 11static void tilebuf_setup(Tilebuf *tb);
9 12
10void 13void
@@ -31,7 +34,11 @@ evas_common_tilebuf_new(int w, int h)
31void 34void
32evas_common_tilebuf_free(Tilebuf *tb) 35evas_common_tilebuf_free(Tilebuf *tb)
33{ 36{
37#ifdef RECTUPDATE
38 evas_common_regionbuf_free(tb->rb);
39#else
34 if (tb->tiles.tiles) free(tb->tiles.tiles); 40 if (tb->tiles.tiles) free(tb->tiles.tiles);
41#endif
35 free(tb); 42 free(tb);
36} 43}
37 44
@@ -126,6 +133,13 @@ evas_common_tilebuf_get_tile_size(Tilebuf *tb, int *tw, int *th)
126int 133int
127evas_common_tilebuf_add_redraw(Tilebuf *tb, int x, int y, int w, int h) 134evas_common_tilebuf_add_redraw(Tilebuf *tb, int x, int y, int w, int h)
128{ 135{
136#ifdef RECTUPDATE
137 int i;
138
139 for (i = 0; i < h; i++)
140 evas_common_regionbuf_span_add(tb->rb, x, x + w - 1, y + i);
141 return 1;
142#else
129 int tx1, tx2, ty1, ty2, tfx1, tfx2, tfy1, tfy2, xx, yy; 143 int tx1, tx2, ty1, ty2, tfx1, tfx2, tfy1, tfy2, xx, yy;
130 int num; 144 int num;
131 145
@@ -148,11 +162,18 @@ evas_common_tilebuf_add_redraw(Tilebuf *tb, int x, int y, int w, int h)
148 } 162 }
149 } 163 }
150 return num; 164 return num;
165#endif
151} 166}
152 167
153int 168int
154evas_common_tilebuf_del_redraw(Tilebuf *tb, int x, int y, int w, int h) 169evas_common_tilebuf_del_redraw(Tilebuf *tb, int x, int y, int w, int h)
155{ 170{
171#ifdef RECTUPDATE
172 int i;
173
174 for (i = 0; i < h; i++)
175 evas_common_regionbuf_span_del(tb->rb, x, x + w - 1, y + i);
176#else
156 int tx1, tx2, ty1, ty2, tfx1, tfx2, tfy1, tfy2, xx, yy; 177 int tx1, tx2, ty1, ty2, tfx1, tfx2, tfy1, tfy2, xx, yy;
157 int num; 178 int num;
158 179
@@ -179,6 +200,7 @@ evas_common_tilebuf_del_redraw(Tilebuf *tb, int x, int y, int w, int h)
179 } 200 }
180 } 201 }
181 return num; 202 return num;
203#endif
182} 204}
183 205
184int 206int
@@ -198,13 +220,20 @@ evas_common_tilebuf_add_motion_vector(Tilebuf *tb, int x, int y, int w, int h, i
198void 220void
199evas_common_tilebuf_clear(Tilebuf *tb) 221evas_common_tilebuf_clear(Tilebuf *tb)
200{ 222{
223#ifdef RECTUPDATE
224 evas_common_regionbuf_clear(tb->rb);
225#else
201 if (!tb->tiles.tiles) return; 226 if (!tb->tiles.tiles) return;
202 memset(tb->tiles.tiles, 0, tb->tiles.w * tb->tiles.h * sizeof(Tilebuf_Tile)); 227 memset(tb->tiles.tiles, 0, tb->tiles.w * tb->tiles.h * sizeof(Tilebuf_Tile));
228#endif
203} 229}
204 230
205Tilebuf_Rect * 231Tilebuf_Rect *
206evas_common_tilebuf_get_render_rects(Tilebuf *tb) 232evas_common_tilebuf_get_render_rects(Tilebuf *tb)
207{ 233{
234#ifdef RECTUPDATE
235 return evas_common_regionbuf_rects_get(tb->rb);
236#else
208 Tilebuf_Rect *rects = NULL; 237 Tilebuf_Rect *rects = NULL;
209 int x, y; 238 int x, y;
210 239
@@ -269,6 +298,7 @@ evas_common_tilebuf_get_render_rects(Tilebuf *tb)
269 } 298 }
270 } 299 }
271 return rects; 300 return rects;
301#endif
272} 302}
273 303
274void 304void
@@ -295,6 +325,9 @@ evas_common_tilebuf_free_render_rects(Tilebuf_Rect *rects)
295static void 325static void
296tilebuf_setup(Tilebuf *tb) 326tilebuf_setup(Tilebuf *tb)
297{ 327{
328#ifdef RECTUPDATE
329 tb->rb = evas_common_regionbuf_new(tb->outbuf_w, tb->outbuf_h);
330#else
298 if (tb->tiles.tiles) free(tb->tiles.tiles); 331 if (tb->tiles.tiles) free(tb->tiles.tiles);
299 tb->tiles.tiles = NULL; 332 tb->tiles.tiles = NULL;
300 333
@@ -310,8 +343,11 @@ tilebuf_setup(Tilebuf *tb)
310 return; 343 return;
311 } 344 }
312 memset(tb->tiles.tiles, 0, tb->tiles.w * tb->tiles.h * sizeof(Tilebuf_Tile)); 345 memset(tb->tiles.tiles, 0, tb->tiles.w * tb->tiles.h * sizeof(Tilebuf_Tile));
346#endif
313} 347}
314 348
349#ifdef RECTUPDATE
350#else
315static int 351static int
316tilebuf_x_intersect(Tilebuf *tb, int x, int w, int *x1, int *x2, int *x1_fill, int *x2_fill) 352tilebuf_x_intersect(Tilebuf *tb, int x, int w, int *x1, int *x2, int *x1_fill, int *x2_fill)
317{ 353{
@@ -359,3 +395,4 @@ tilebuf_intersect(int tsize, int tlen, int tnum, int x, int w, int *x1, int *x2,
359 return 1; 395 return 1;
360 tnum = 0; 396 tnum = 0;
361} 397}
398#endif
diff --git a/legacy/evas/src/lib/include/evas_common.h b/legacy/evas/src/lib/include/evas_common.h
index df68e11cca..886d66d388 100644
--- a/legacy/evas/src/lib/include/evas_common.h
+++ b/legacy/evas/src/lib/include/evas_common.h
@@ -23,6 +23,9 @@
23 23
24/*****************************************************************************/ 24/*****************************************************************************/
25 25
26/* use exact rects for updates not tiles */
27/* #define RECTUPDATE */
28
26#undef MIN 29#undef MIN
27#define MIN(_x, _y) \ 30#define MIN(_x, _y) \
28(((_x) < (_y)) ? (_x) : (_y)) 31(((_x) < (_y)) ? (_x) : (_y))
@@ -177,6 +180,9 @@ typedef struct _Tilebuf Tilebuf;
177typedef struct _Tilebuf_Tile Tilebuf_Tile; 180typedef struct _Tilebuf_Tile Tilebuf_Tile;
178typedef struct _Tilebuf_Rect Tilebuf_Rect; 181typedef struct _Tilebuf_Rect Tilebuf_Rect;
179 182
183typedef struct _Regionbuf Regionbuf;
184typedef struct _Regionspan Regionspan;
185
180typedef void (*Gfx_Func_Blend_Src_Dst) (DATA32 *src, DATA32 *dst, int len); 186typedef void (*Gfx_Func_Blend_Src_Dst) (DATA32 *src, DATA32 *dst, int len);
181typedef void (*Gfx_Func_Blend_Color_Dst) (DATA32 src, DATA32 *dst, int len); 187typedef void (*Gfx_Func_Blend_Color_Dst) (DATA32 src, DATA32 *dst, int len);
182typedef void (*Gfx_Func_Blend_Src_Cmod_Dst) (DATA32 *src, DATA32 *dst, int len, DATA8 *rmod, DATA8 *gmod, DATA8 *bmod, DATA8 *amod); 188typedef void (*Gfx_Func_Blend_Src_Cmod_Dst) (DATA32 *src, DATA32 *dst, int len, DATA8 *rmod, DATA8 *gmod, DATA8 *bmod, DATA8 *amod);
@@ -385,11 +391,15 @@ struct _Tilebuf
385 struct { 391 struct {
386 int w, h; 392 int w, h;
387 } tile_size; 393 } tile_size;
388 394
395#ifdef RECTUPDATE
396 Regionbuf *rb;
397#else
389 struct { 398 struct {
390 int w, h; 399 int w, h;
391 Tilebuf_Tile *tiles; 400 Tilebuf_Tile *tiles;
392 } tiles; 401 } tiles;
402#endif
393}; 403};
394 404
395struct _Tilebuf_Tile 405struct _Tilebuf_Tile
@@ -413,6 +423,18 @@ struct _Tilebuf_Rect
413 int x, y, w, h; 423 int x, y, w, h;
414}; 424};
415 425
426struct _Regionbuf
427{
428 int w, h;
429 Regionspan **spans;
430};
431
432struct _Regionspan
433{
434 Evas_Object_List _list_data;
435 int x1, x2;
436};
437
416struct _Cutout_Rect 438struct _Cutout_Rect
417{ 439{
418 Evas_Object_List _list_data; 440 Evas_Object_List _list_data;
@@ -890,7 +912,15 @@ int evas_common_tilebuf_add_motion_vector (Tilebuf *tb, int x, int y,
890void evas_common_tilebuf_clear (Tilebuf *tb); 912void evas_common_tilebuf_clear (Tilebuf *tb);
891Tilebuf_Rect *evas_common_tilebuf_get_render_rects (Tilebuf *tb); 913Tilebuf_Rect *evas_common_tilebuf_get_render_rects (Tilebuf *tb);
892void evas_common_tilebuf_free_render_rects (Tilebuf_Rect *rects); 914void evas_common_tilebuf_free_render_rects (Tilebuf_Rect *rects);
893 915
916
917Regionbuf *evas_common_regionbuf_new (int w, int h);
918void evas_common_regionbuf_free (Regionbuf *rb);
919void evas_common_regionbuf_clear (Regionbuf *rb);
920void evas_common_regionbuf_span_add (Regionbuf *rb, int x1, int x2, int y);
921void evas_common_regionbuf_span_del (Regionbuf *rb, int x1, int x2, int y);
922Tilebuf_Rect *evas_common_regionbuf_rects_get (Regionbuf *rb);
923
894/****/ 924/****/
895void evas_common_draw_init (void); 925void evas_common_draw_init (void);
896 926
@@ -915,7 +945,7 @@ Cutout_Rect *evas_common_draw_context_apply_cutouts (RGBA_Draw_Context
915void evas_common_draw_context_apply_free_cutouts(Cutout_Rect *rects); 945void evas_common_draw_context_apply_free_cutouts(Cutout_Rect *rects);
916Cutout_Rect *evas_common_draw_context_cutouts_split (Cutout_Rect *in, Cutout_Rect *split); 946Cutout_Rect *evas_common_draw_context_cutouts_split (Cutout_Rect *in, Cutout_Rect *split);
917Cutout_Rect *evas_common_draw_context_cutout_split (Cutout_Rect *in, Cutout_Rect *split); 947Cutout_Rect *evas_common_draw_context_cutout_split (Cutout_Rect *in, Cutout_Rect *split);
918 948Cutout_Rect *evas_common_draw_context_cutout_merge (Cutout_Rect *in, Cutout_Rect *merge);
919Gfx_Func_Blend_Src_Dst evas_common_draw_func_blend_get (RGBA_Image *src, RGBA_Image *dst, int pixels); 949Gfx_Func_Blend_Src_Dst evas_common_draw_func_blend_get (RGBA_Image *src, RGBA_Image *dst, int pixels);
920Gfx_Func_Blend_Color_Dst evas_common_draw_func_blend_color_get (DATA32 src, RGBA_Image *dst, int pixels); 950Gfx_Func_Blend_Color_Dst evas_common_draw_func_blend_color_get (DATA32 src, RGBA_Image *dst, int pixels);
921Gfx_Func_Blend_Src_Cmod_Dst evas_common_draw_func_blend_cmod_get (RGBA_Image *src, RGBA_Image *dst, int pixels); 951Gfx_Func_Blend_Src_Cmod_Dst evas_common_draw_func_blend_cmod_get (RGBA_Image *src, RGBA_Image *dst, int pixels);