comparison src/redraw_man.c @ 408:7f7855df2af0

Make unittest built by automake and autoconf. ./configure --enable-testcase to build testcase.
author Thinker K.F. Li <thinker@branda.to>
date Tue, 07 Jul 2009 22:46:19 +0800
parents 44b8223f307c
children 585baa462778
comparison
equal deleted inserted replaced
407:92a459a1c5aa 408:7f7855df2af0
7 #include "mb_shapes.h" 7 #include "mb_shapes.h"
8 #include "mb_tools.h" 8 #include "mb_tools.h"
9 #include "mb_redraw_man.h" 9 #include "mb_redraw_man.h"
10 #include "mb_observer.h" 10 #include "mb_observer.h"
11 #include "mb_prop.h" 11 #include "mb_prop.h"
12
13 /* required by rdman_img_ldr_load_paint() */
14 #include "mb_paint.h"
12 15
13 /*! \page dirty Dirty geo, coord, and area. 16 /*! \page dirty Dirty geo, coord, and area.
14 * 17 *
15 * \section dirty_of_ego Dirty of geo 18 * \section dirty_of_ego Dirty of geo
16 * A geo is dirty when any of the shape, size or positions is changed. 19 * A geo is dirty when any of the shape, size or positions is changed.
1883 cairo_set_operator(rdman->backend, CAIRO_OPERATOR_SOURCE); 1886 cairo_set_operator(rdman->backend, CAIRO_OPERATOR_SOURCE);
1884 cairo_paint(rdman->backend); 1887 cairo_paint(rdman->backend);
1885 cairo_set_operator(rdman->backend, saved_op); 1888 cairo_set_operator(rdman->backend, saved_op);
1886 } 1889 }
1887 #else /* UNITTEST */ 1890 #else /* UNITTEST */
1891 static void make_clip(cairo_t *cr, int n_dirty_areas,
1892 area_t **dirty_areas) {
1893 }
1894
1888 static void clear_canvas(canvas_t *canvas) { 1895 static void clear_canvas(canvas_t *canvas) {
1889 } 1896 }
1890 1897
1891 static void reset_clip(canvas_t *cr) { 1898 static void reset_clip(canvas_t *cr) {
1892 } 1899 }
2291 2298
2292 #ifdef UNITTEST 2299 #ifdef UNITTEST
2293 /* Test cases */ 2300 /* Test cases */
2294 2301
2295 #include <CUnit/Basic.h> 2302 #include <CUnit/Basic.h>
2296 #include "mb_paint.h"
2297 2303
2298 struct _sh_dummy { 2304 struct _sh_dummy {
2299 shape_t shape; 2305 shape_t shape;
2300 co_aix x, y; 2306 co_aix x, y;
2301 co_aix w, h; 2307 co_aix w, h;
2374 2380
2375 paint = (paint_t *)malloc(sizeof(paint_t)); 2381 paint = (paint_t *)malloc(sizeof(paint_t));
2376 if(paint == NULL) 2382 if(paint == NULL)
2377 return NULL; 2383 return NULL;
2378 2384
2379 paint_init(paint, dummy_paint_prepare, dummy_paint_free); 2385 paint_init(paint, MBP_DUMMY, dummy_paint_prepare, dummy_paint_free);
2380 2386
2381 return paint; 2387 return paint;
2382 } 2388 }
2383 2389
2384 static void test_rdman_redraw_changed(void) { 2390 static void test_rdman_redraw_changed(void) {