12
|
1 #include <stdio.h>
|
|
2 #include <stdlib.h>
|
|
3 #include <string.h>
|
|
4 #include "mb_types.h"
|
|
5 #include "shapes.h"
|
|
6 #include "tools.h"
|
|
7 #include "redraw_man.h"
|
|
8
|
|
9 #define OK 0
|
|
10 #define ERR -1
|
|
11
|
13
|
12 #define OFFSET(type, field) ((void *)&((type *)NULL)->field - (void *)NULL)
|
|
13 #define SWAP(a, b, t) do { t c; c = a; a = b; b = c; } while(0)
|
|
14
|
12
|
15 int redraw_man_init(redraw_man_t *rdman) {
|
|
16 extern void redraw_man_destroy(redraw_man_t *rdman);
|
|
17
|
|
18 memset(rdman, 0, sizeof(redraw_man_t));
|
|
19
|
|
20 rdman->geo_pool = elmpool_new(sizeof(geo_t), 128);
|
|
21 if(rdman->geo_pool == NULL)
|
|
22 return ERR;
|
|
23
|
|
24 rdman->coord_pool = elmpool_new(sizeof(coord_t), 16);
|
|
25 if(rdman->coord_pool == NULL) {
|
|
26 elmpool_free(rdman->geo_pool);
|
|
27 return ERR;
|
|
28 }
|
|
29
|
|
30 rdman->root_coord = elmpool_elm_alloc(rdman->coord_pool);
|
|
31 if(rdman->root_coord == NULL)
|
|
32 redraw_man_destroy(rdman);
|
13
|
33 rdman->n_coords = 1;
|
12
|
34 coord_init(rdman->root_coord, NULL);
|
|
35
|
|
36 return OK;
|
|
37 }
|
|
38
|
|
39 void redraw_man_destroy(redraw_man_t *rdman) {
|
|
40 elmpool_free(rdman->coord_pool);
|
|
41 elmpool_free(rdman->geo_pool);
|
13
|
42 if(rdman->dirty_coords)
|
|
43 free(rdman->dirty_coords);
|
|
44 if(rdman->redrawing_geos)
|
|
45 free(rdman->redrawing_geos);
|
12
|
46 }
|
|
47
|
|
48
|
|
49 #define ASSERT(x)
|
|
50 /*
|
|
51 * Change transformation matrix
|
|
52 * - update aggregated transformation matrix
|
|
53 * - of coord_t object been changed.
|
|
54 * - of children coord_t objects.
|
|
55 * - redraw members of coord_t objects.
|
|
56 * - redraw shape objects they are overlaid with members.
|
|
57 * - find out overlaid shape objects.
|
|
58 * - geo_t of a coord_t object
|
|
59 * - can make finding more efficiency.
|
|
60 * - fill overlay geo_t objects of members.
|
|
61 *
|
|
62 * Change a shape object
|
|
63 * - redraw changed object.
|
|
64 * - redraw shape objects they are overlaid with changed object.
|
|
65 * - find out overlaid shape objects.
|
|
66 *
|
|
67 * That coord and geo of shape objects are setted by user code
|
|
68 * give user code a chance to collect coord and geo objects together
|
|
69 * and gain interest of higher cache hit rate.
|
|
70 */
|
|
71
|
|
72 /*! \brief Find out all affected shape objects.
|
|
73 *
|
|
74 * Find out all shape objects that are overalid with geo_t of
|
|
75 * a geometry changed object.
|
|
76 *
|
|
77 * Linear scan geo_t objects of all shape objects in all_shapes
|
|
78 * list of a redraw_man_t object.
|
|
79 */
|
|
80 int rdman_find_overlaid_shapes(redraw_man_t *rdman, geo_t *geo,
|
|
81 geo_t ***overlays) {
|
|
82 int n_geos;
|
|
83 geo_t **geos;
|
|
84 geo_t *geo_cur;
|
|
85 int n_overlays;
|
|
86 geo_t **_overlays;
|
|
87 int i;
|
|
88
|
|
89 n_geos = rdman->n_geos;
|
|
90
|
|
91 geos = (geo_t **)malloc(sizeof(geo_t *) * n_geos);
|
|
92 if(geos == NULL)
|
|
93 return -1;
|
|
94
|
|
95 _overlays = (geo_t **)malloc(sizeof(geo_t *) * n_geos);
|
|
96 if(geos == NULL) {
|
|
97 free(geos);
|
|
98 return -1;
|
|
99 }
|
|
100
|
|
101 geo_cur = STAILQ_HEAD(rdman->all_geos);
|
|
102 for(i = 0; i < n_geos; i++) {
|
|
103 geos[i] = geo_cur;
|
|
104 geo_cur = STAILQ_NEXT(geo_t, next, geo_cur);
|
|
105 }
|
|
106 geo_mark_overlay(geo, n_geos, geos, &n_overlays, _overlays);
|
|
107
|
|
108 free(geos);
|
|
109 *overlays = _overlays;
|
|
110
|
|
111 return n_overlays;
|
|
112 }
|
|
113
|
|
114 int rdman_add_shape(redraw_man_t *rdman, shape_t *shape, coord_t *coord) {
|
|
115 geo_t *geo;
|
13
|
116 geo_t *visit;
|
|
117 unsigned int next_order;
|
12
|
118
|
|
119 geo = elmpool_elm_alloc(rdman->geo_pool);
|
|
120 if(geo == NULL)
|
|
121 return ERR;
|
|
122 sh_attach_geo(shape, geo);
|
|
123 STAILQ_INS_TAIL(rdman->all_geos, geo_t, next, geo);
|
|
124 rdman->n_geos++;
|
13
|
125
|
|
126 geo->order = ++rdman->next_geo_order;
|
|
127 if(geo->order == 0) {
|
|
128 next_order = 0;
|
|
129 for(visit = STAILQ_HEAD(rdman->all_geos);
|
|
130 visit != NULL;
|
|
131 visit = STAILQ_NEXT(geo_t, next, visit))
|
|
132 visit->order = ++next_order;
|
|
133 rdman->next_geo_order = next_order;
|
|
134 }
|
|
135
|
12
|
136 sh_attach_coord(shape, coord);
|
|
137
|
|
138 return OK;
|
|
139 }
|
|
140
|
|
141 int rdman_remove_shape(redraw_man_t *rdman, shape_t *shape) {
|
|
142 STAILQ_REMOVE(rdman->all_geos, geo_t, next, shape->geo);
|
|
143 elmpool_elm_free(rdman->geo_pool, shape->geo);
|
|
144 sh_detach_geo(shape);
|
|
145 rdman->n_geos--;
|
|
146 sh_detach_coord(shape);
|
|
147 return OK;
|
|
148 }
|
|
149
|
|
150 coord_t *rdman_coord_new(redraw_man_t *rdman, coord_t *parent) {
|
13
|
151 coord_t *coord, *root_coord;
|
|
152 coord_t *visit;
|
12
|
153
|
|
154 coord = elmpool_elm_alloc(rdman->coord_pool);
|
|
155 if(coord == NULL)
|
|
156 return NULL;
|
|
157
|
|
158 coord_init(coord, parent);
|
13
|
159 rdman->n_coords++;
|
|
160
|
|
161 coord->order = ++rdman->next_coord_order;
|
|
162 if(coord->order == 0) {
|
|
163 rdman->next_coord_order = 0;
|
|
164 root_coord = visit = rdman->root_coord;
|
|
165 /* skip root coord. */
|
|
166 visit = preorder_coord_subtree(root_coord, visit);
|
|
167 while(visit) {
|
|
168 visit->order = ++rdman->next_coord_order;
|
|
169 visit = preorder_coord_subtree(root_coord, visit);
|
|
170 }
|
|
171 }
|
12
|
172
|
|
173 return coord;
|
|
174 }
|
|
175
|
|
176 /*! \brief Free a coord of a redraw_man_t object.
|
|
177 *
|
|
178 * \param coord is a coord_t without children and members.
|
|
179 * \return 0 for successful, -1 for error.
|
|
180 */
|
|
181 int rdman_coord_free(redraw_man_t *rdman, coord_t *coord) {
|
|
182 coord_t *parent;
|
|
183
|
|
184 parent = coord->parent;
|
|
185 if(parent == NULL)
|
|
186 return ERR;
|
|
187
|
|
188 if(STAILQ_HEAD(coord->members) != NULL)
|
|
189 return ERR;
|
|
190
|
|
191 if(STAILQ_HEAD(coord->children) != NULL)
|
|
192 return ERR;
|
|
193
|
|
194 STAILQ_REMOVE(parent->children, coord_t, sibling, coord);
|
|
195 elmpool_elm_free(rdman->coord_pool, coord);
|
13
|
196 rdman->n_coords--;
|
|
197
|
|
198 return OK;
|
|
199 }
|
|
200
|
|
201 static int extend_memblk(void **buf, int o_size, int n_size) {
|
|
202 void *new_buf;
|
|
203
|
|
204 new_buf = realloc(*buf, n_size);
|
|
205 if(new_buf == NULL)
|
|
206 return ERR;
|
|
207
|
|
208 if(new_buf != *buf) {
|
|
209 memcpy(new_buf, *buf, o_size);
|
|
210 free(*buf);
|
|
211 *buf = new_buf;
|
|
212 }
|
|
213
|
|
214 return OK;
|
|
215 }
|
|
216
|
|
217 static int add_dirty_geo(redraw_man_t *rdman, geo_t *geo) {
|
|
218 int max_redrawing_geos;
|
|
219 int r;
|
|
220
|
|
221 if(rdman->n_redrawing_geos >= rdman->max_redrawing_geos) {
|
|
222 max_redrawing_geos = rdman->n_geos + rdman->n_coords;
|
|
223 r = extend_memblk((void **)&rdman->redrawing_geos,
|
|
224 sizeof(geo_t *) * rdman->n_redrawing_geos,
|
|
225 sizeof(geo_t *) * max_redrawing_geos);
|
|
226 if(r != OK)
|
|
227 return ERR;
|
|
228 rdman->max_redrawing_geos = max_redrawing_geos;
|
|
229 }
|
|
230
|
|
231 rdman->redrawing_geos[rdman->n_redrawing_geos++] = geo;
|
|
232 return OK;
|
|
233 }
|
|
234
|
|
235 static int add_dirty_area(redraw_man_t *rdman, area_t *area) {
|
|
236 int max_dirty_areas;
|
|
237 int r;
|
|
238
|
|
239 if(rdman->n_dirty_areas >= rdman->max_dirty_areas) {
|
|
240 max_dirty_areas = (rdman->n_geos + rdman->n_coords) * 2;
|
|
241 r = extend_memblk((void **)&rdman->dirty_areas,
|
|
242 sizeof(area_t *) * rdman->n_dirty_areas,
|
|
243 sizeof(area_t *) * max_dirty_areas);
|
|
244 if(r != OK)
|
|
245 return ERR;
|
|
246 rdman->max_dirty_areas = max_dirty_areas;
|
|
247 }
|
|
248
|
|
249 rdman->dirty_areas[++rdman->n_dirty_areas] = area;
|
|
250 return OK;
|
|
251 }
|
|
252
|
|
253 /*! \brief Mark a coord is changed.
|
|
254 *
|
|
255 * A changed coord_t object is marked as dirty and put
|
|
256 * into dirty_coords list.
|
|
257 */
|
|
258 int rdman_coord_changed(redraw_man_t *rdman, coord_t *coord) {
|
|
259 int max_dirty_coords;
|
|
260 int r;
|
|
261
|
|
262 if(coord->flags & COF_DIRTY)
|
|
263 return OK;
|
|
264
|
|
265 if(rdman->n_dirty_coords >= rdman->max_dirty_coords) {
|
|
266 /* Max of dirty_coords is not big enough. */
|
|
267 max_dirty_coords = rdman->max_dirty_coords + 16;
|
|
268
|
|
269 r = extend_memblk((void **)&rdman->dirty_coords,
|
|
270 sizeof(coord_t *) * rdman->n_dirty_coords,
|
|
271 sizeof(coord_t *) * max_dirty_coords);
|
|
272 rdman->max_dirty_coords = max_dirty_coords;
|
|
273 }
|
|
274
|
|
275 rdman->dirty_coords[rdman->n_dirty_coords++] = coord;
|
|
276 coord->flags |= COF_DIRTY;
|
|
277
|
|
278 return OK;
|
|
279 }
|
|
280
|
|
281 /*! \brief Mark a shape is changed.
|
|
282 *
|
|
283 * The geo_t object of a changed shape is mark as dirty and
|
|
284 * put into redrawing_geos list.
|
|
285 */
|
|
286 int rdman_shape_changed(redraw_man_t *rdman, shape_t *shape) {
|
|
287 geo_t *geo;
|
|
288 int r;
|
|
289
|
|
290 geo = shape->geo;
|
|
291
|
|
292 if(geo->flags & GEF_DIRTY)
|
|
293 return OK;
|
|
294
|
|
295 r = add_dirty_geo(rdman, geo);
|
|
296 if(r == ERR)
|
|
297 return ERR;
|
|
298 geo->flags |= GEF_DIRTY;
|
12
|
299
|
|
300 return OK;
|
|
301 }
|
|
302
|
13
|
303 /*! \brief Sort a list of element by a unsigned integer.
|
|
304 *
|
|
305 * The result is in ascend order. The unsigned integers is
|
|
306 * at offset specified by 'off' from start address of elemnts.
|
|
307 */
|
|
308 static void _insert_sort(void **elms, int num, int off) {
|
|
309 int i, j;
|
|
310 unsigned int val;
|
|
311
|
|
312 for(i = 1; i < num; i++) {
|
|
313 val = *(unsigned int *)(elms[i] + off);
|
|
314 for(j = i; j > 0; j--) {
|
|
315 if(*(unsigned int *)(elms[j - 1] + off) <= val)
|
|
316 break;
|
|
317 elms[j] = elms[j - 1];
|
|
318 }
|
|
319 elms[j] = elms[i];
|
|
320 }
|
|
321 }
|
|
322
|
|
323 static void make_redrawing_members(redraw_man_t *rdman, coord_t *coord) {
|
|
324 shape_t *shape;
|
|
325
|
|
326 for(shape = STAILQ_HEAD(coord->members);
|
|
327 shape != NULL;
|
|
328 shape = STAILQ_NEXT(shape_t, coord_mem_next, shape)) {
|
|
329 shape->geo->flags &= ~GEF_DIRTY;
|
|
330 add_dirty_geo(rdman, shape->geo);
|
|
331 }
|
|
332 }
|
|
333
|
|
334 static void compute_coord_geo(coord_t *coord) {
|
|
335 }
|
|
336
|
|
337 static void transform_shape(shape_t *shape) {
|
|
338 }
|
|
339
|
|
340 static void draw_shape(shape_t *shape) {
|
|
341 }
|
|
342
|
|
343 /*! \brief Re-draw all changed shapes or shapes affected by changed coords.
|
|
344 *
|
|
345 * A coord object has a geo to keep track the range that it's members will
|
|
346 * draw on. Geo of a coord should be recomputed when the coord is changed.
|
|
347 * Geo of a coord used to accelerate finding overlay shape objects of
|
|
348 * a specified geo. A coord object also must be recomputed when one of
|
|
349 * it's members is changed.
|
|
350 *
|
|
351 * New and old geo values of a coord object that is recomputed for
|
|
352 * changing of it-self must be used to find overlay shape objects.
|
|
353 * New and old geo values of a shape should also be used to find
|
|
354 * overlay shape objects, too. If a shape's coord is changed, shape's
|
|
355 * geo object is not used to find overlay shape objects any more.
|
|
356 *
|
|
357 * steps:
|
|
358 * - update chagned coord objects
|
|
359 * - recompute geo for changed coord objects
|
|
360 * - recompute geo for members shape objects
|
|
361 * - recompute geo for changed shape objects
|
|
362 * - finding overlaid shape objects for recomputed geo objects.
|
|
363 * - overlaid shape objects is invoked by traveling tree of coord.
|
|
364 * - members of changed coord object are marked computed and dirty.
|
|
365 *
|
|
366 * assert(n_redrawing_geos <= (num_of(shape) + num_of(coord)))
|
|
367 * Because
|
|
368 * - num_of(geo from coord) < num_of(coord)
|
|
369 * - num_of(geo from shape) < num_of(shape)
|
|
370 */
|
|
371 int rdman_redraw_changed(redraw_man_t *rdman) {
|
|
372 int i, j;
|
|
373 int n_dirty_coords;
|
|
374 coord_t **dirty_coords;
|
|
375 coord_t *visit_coord;
|
|
376 geo_t *visit_geo, **redrawing_geos;
|
|
377 int n_redrawing_geos;
|
|
378 int n_dirty_areas;
|
|
379
|
|
380 if(rdman->n_dirty_coords > 0) {
|
|
381 _insert_sort((void **)rdman->dirty_coords,
|
|
382 rdman->n_dirty_coords,
|
|
383 OFFSET(coord_t, order));
|
|
384 n_dirty_coords = rdman->n_dirty_coords;
|
|
385 dirty_coords = rdman->dirty_coords;
|
|
386 for(i = 0; i < n_dirty_coords; i++) {
|
|
387 if(!(dirty_coords[i]->flags & COF_DIRTY))
|
|
388 continue;
|
|
389
|
|
390 update_aggr_matrix(dirty_coords[i]);
|
|
391 for(visit_coord = dirty_coords[i];
|
|
392 visit_coord != NULL;
|
|
393 visit_coord = preorder_coord_subtree(dirty_coords[i],
|
|
394 visit_coord)) {
|
|
395 /* Dirty member, here, and members of this coord
|
|
396 * will not be visited anymore. */
|
|
397 visit_coord->flags &= ~COF_DIRTY;
|
|
398 visit_coord->flags |= COF_RECOMP;
|
|
399
|
|
400 SWAP(visit_coord->cur_area, visit_coord->last_area, area_t *);
|
|
401 compute_coord_geo(visit_coord);
|
|
402 add_dirty_area(rdman, visit_coord->cur_area);
|
|
403 add_dirty_area(rdman, visit_coord->last_area);
|
|
404 make_redrawing_members(rdman, visit_coord);
|
|
405 }
|
|
406 }
|
|
407 rdman->n_dirty_coords = 0;
|
|
408 }
|
|
409
|
|
410 n_redrawing_geos = rdman->n_redrawing_geos;
|
|
411 if(n_redrawing_geos > 0) {
|
|
412 redrawing_geos = rdman->redrawing_geos;
|
|
413 for(i = 0; i < n_redrawing_geos; i++) {
|
|
414 visit_geo = redrawing_geos[i];
|
|
415 if(!(visit_geo->flags & GEF_DIRTY))
|
|
416 continue;
|
|
417
|
|
418 SWAP(visit_geo->cur_area, visit_geo->last_area, area_t *);
|
|
419 transform_shape(visit_geo->shape);
|
|
420 visit_geo->flags &= ~GEF_DIRTY;
|
|
421 add_dirty_area(rdman, visit_geo->cur_area);
|
|
422 add_dirty_area(rdman, visit_geo->last_area);
|
|
423 }
|
|
424
|
|
425 n_dirty_areas = rdman->n_dirty_areas;
|
|
426 for(visit_geo = STAILQ_HEAD(rdman->all_geos);
|
|
427 visit_geo != NULL;
|
|
428 visit_geo = STAILQ_NEXT(geo_t, next, visit_geo)) {
|
|
429 if(visit_geo->flags & GEF_DIRTY)
|
|
430 continue;
|
|
431
|
|
432 }
|
|
433 }
|
|
434
|
|
435 return OK;
|
12
|
436 }
|
|
437
|
|
438 /*
|
|
439 * When redraw an area, the affected elements may also extend to
|
|
440 * outside of the area. Since the order of drawing will change
|
|
441 * the result, it will infect more and more elements to keep
|
|
442 * drawing order althrough they are overlaid directly with
|
|
443 * specified area.
|
|
444 *
|
|
445 * To fix the problem, we don't extend the set of redrawing to
|
|
446 * elements they are not overliad directly. The redrawing is
|
|
447 * performed on a temporary surface, clipped to fit the area, and
|
|
448 * update only specified area on the destinate surface.
|
|
449 */
|
|
450
|
|
451 /*
|
|
452 * To accelerate speed of transformation, when a matrix changed,
|
|
453 * transformation should be aggregated and computed in a loop.
|
|
454 * It can get intereset of higher hit rate of cache.
|
|
455 * - shapes prvoide list of positions needed to be transformed.
|
|
456 * - redraw_man transforms positions from shapes.
|
|
457 * - shapes drawing with result of transforms.
|
|
458 * - shapes should be called to give them a chance to update geometries.
|
|
459 */
|
|
460
|
13
|
461 /*
|
|
462 * functions:
|
|
463 * - redraw all
|
|
464 * - redraw changed
|
|
465 */
|
|
466
|
12
|
467 #ifdef UNITTEST
|
|
468
|
|
469 #include <CUnit/Basic.h>
|
|
470
|
|
471 struct _sh_dummy {
|
|
472 shape_t shape;
|
|
473 co_aix x, y;
|
|
474 co_aix w, h;
|
|
475 };
|
|
476 typedef struct _sh_dummy sh_dummy_t;
|
|
477
|
|
478 shape_t *sh_dummy_new(co_aix x, co_aix y, co_aix w, co_aix h) {
|
|
479 sh_dummy_t *dummy;
|
|
480
|
|
481 dummy = (sh_dummy_t *)malloc(sizeof(sh_dummy_t));
|
|
482 if(dummy == NULL)
|
|
483 return NULL;
|
|
484
|
|
485 dummy->x = x;
|
|
486 dummy->y = y;
|
|
487 dummy->w = w;
|
|
488 dummy->h = h;
|
|
489
|
|
490 return (shape_t *)dummy;
|
|
491 }
|
|
492
|
|
493 void sh_dummy_free(shape_t *sh) {
|
|
494 free(sh);
|
|
495 }
|
|
496
|
|
497 void sh_dummy_transform(shape_t *shape) {
|
|
498 sh_dummy_t *dummy = (sh_dummy_t *)shape;
|
|
499 co_aix poses[2][2];
|
|
500 co_aix x1, y1, x2, y2;
|
|
501
|
|
502 if(shape->geo && shape->coord) {
|
|
503 x1 = dummy->x;
|
|
504 y1 = dummy->y;
|
|
505 x2 = x1 + dummy->w;
|
|
506 y2 = y1 + dummy->h;
|
|
507
|
|
508 coord_trans_pos(shape->coord, &x1, &y1);
|
|
509 coord_trans_pos(shape->coord, &x2, &y2);
|
|
510 poses[0][0] = x1;
|
|
511 poses[0][1] = y1;
|
|
512 poses[1][0] = x2;
|
|
513 poses[1][1] = y2;
|
|
514
|
|
515 geo_init(shape->geo, 2, poses);
|
|
516 }
|
|
517 }
|
|
518
|
|
519 void test_rdman_find_overlaid_shapes(void) {
|
|
520 redraw_man_t rdman;
|
|
521 geo_t geo;
|
|
522 coord_t *coords[3];
|
|
523 shape_t *shapes[5];
|
|
524 geo_t **overlays;
|
13
|
525 co_aix pos[2][2];
|
12
|
526 int n;
|
|
527 int i;
|
|
528
|
|
529 redraw_man_init(&rdman);
|
|
530 coords[0] = rdman.root_coord;
|
|
531 for(i = 1; i < 3; i++) {
|
|
532 coords[i] = rdman_coord_new(&rdman, rdman.root_coord);
|
|
533 }
|
|
534 for(i = 0; i < 5; i++) {
|
|
535 shapes[i] = sh_dummy_new(10 + i * 30, 10 + i * 20, 25, 15);
|
|
536 CU_ASSERT(shapes[i] != NULL);
|
|
537 }
|
|
538 for(i = 0; i < 3; i++)
|
|
539 rdman_add_shape(&rdman, shapes[i], coords[1]);
|
|
540 for(i = 3; i < 5; i++)
|
|
541 rdman_add_shape(&rdman, shapes[i], coords[2]);
|
|
542
|
|
543 coords[1]->matrix[0] = 2;
|
|
544 coords[0]->matrix[4] = 2;
|
|
545
|
|
546 update_aggr_matrix(coords[0]);
|
|
547 for(i = 0; i < 5; i++)
|
|
548 sh_dummy_transform(shapes[i]);
|
|
549
|
13
|
550 pos[0][0] = 100;
|
|
551 pos[0][1] = 120;
|
|
552 pos[1][0] = 100 + 140;
|
|
553 pos[1][1] = 120 + 40;
|
|
554 geo_init(&geo, 2, pos);
|
12
|
555
|
|
556 n = rdman_find_overlaid_shapes(&rdman, &geo, &overlays);
|
|
557 CU_ASSERT(n == 2);
|
|
558 CU_ASSERT(overlays != NULL);
|
|
559 CU_ASSERT(overlays[0] == shapes[2]->geo);
|
|
560 CU_ASSERT(overlays[1] == shapes[3]->geo);
|
|
561
|
|
562 free(overlays);
|
|
563 for(i = 0; i < 5; i++)
|
|
564 sh_dummy_free(shapes[i]);
|
|
565
|
|
566 redraw_man_destroy(&rdman);
|
|
567 }
|
|
568
|
|
569 CU_pSuite get_redraw_man_suite(void) {
|
|
570 CU_pSuite suite;
|
|
571
|
|
572 suite = CU_add_suite("Suite_redraw_man", NULL, NULL);
|
|
573 CU_ADD_TEST(suite, test_rdman_find_overlaid_shapes);
|
|
574
|
|
575 return suite;
|
|
576 }
|
|
577
|
|
578 #endif /* UNITTEST */
|