# HG changeset patch # User Thinker K.F. Li # Date 1284414288 -28800 # Node ID 93c54322d4d87df0ed5a3bb53b2bc1d1a725022c # Parent ea544a68f55d2b8ae1e65a3b6b50dede296ff671 Do not copy canvas for unittest diff -r ea544a68f55d -r 93c54322d4d8 src/redraw_man.c --- a/src/redraw_man.c Tue Sep 14 05:44:48 2010 +0800 +++ b/src/redraw_man.c Tue Sep 14 05:44:48 2010 +0800 @@ -2189,6 +2189,7 @@ static void update_cached_canvas_2_parent(redraw_man_t *rdman, coord_t *coord) { +#ifndef UNITTEST mbe_t *pcanvas, *canvas; mbe_surface_t *surface; mbe_pattern_t *pattern; @@ -2208,6 +2209,7 @@ mbe_pattern_set_matrix(pattern, reverse); mbe_set_source(pcanvas, pattern); mbe_paint_with_alpha(pcanvas, coord->opacity); +#endif } static int draw_coord_shapes_in_dirty_areas(redraw_man_t *rdman, @@ -2858,6 +2860,7 @@ redraw_man_t _rdman; coord_t *coord1, *coord2; sh_dummy_t *sh; + paint_t *paint; redraw_man_init(&_rdman, NULL, NULL); rdman = &_rdman; @@ -2875,10 +2878,14 @@ rdman_add_shape(rdman, (shape_t *)sh, coord2); rdman_shape_changed(rdman, (shape_t *)sh); - rdman_redraw_changed(rdman); + paint = dummy_paint_new(rdman); + rdman_paint_fill(rdman, paint, (shape_t *)sh); + + rdman_redraw_all(rdman); CU_ASSERT(sh->draw_cnt == 1); + rdman_paint_free(rdman, paint); redraw_man_destroy(rdman); }