Mercurial > MadButterfly
comparison src/redraw_man.c @ 817:387d1c597632
Change order of statements to fix bug of wild pointers.
For some reason, the code is broken for merging from Android_Skia
branch. The variable 'coord' in add_rdman_aggr_dirty_areas() is used
before initialized; it is a wild pointer.
author | Thinker K.F. Li <thinker@codemud.net> |
---|---|
date | Mon, 13 Sep 2010 15:33:19 +0800 |
parents | 0e56a1ca19b2 |
children | 86f2c59cef09 |
comparison
equal
deleted
inserted
replaced
816:0e56a1ca19b2 | 817:387d1c597632 |
---|---|
1850 * list | 1850 * list |
1851 */ | 1851 */ |
1852 n_zeroing = rdman->zeroing_coords.num; | 1852 n_zeroing = rdman->zeroing_coords.num; |
1853 zeroings = rdman->zeroing_coords.ds; | 1853 zeroings = rdman->zeroing_coords.ds; |
1854 for(i = 0; i < n_zeroing; i++) { | 1854 for(i = 0; i < n_zeroing; i++) { |
1855 coord = zeroings[i]; | |
1856 | |
1855 if(coord_get_flags(coord, COF_TEMP_MARK)) | 1857 if(coord_get_flags(coord, COF_TEMP_MARK)) |
1856 continue; | 1858 continue; |
1857 coord_set_flags(coord, COF_TEMP_MARK); | 1859 coord_set_flags(coord, COF_TEMP_MARK); |
1858 | 1860 |
1859 coord = zeroings[i]; | |
1860 pcached_coord = coord_get_cached(coord_get_parent(coord)); | 1861 pcached_coord = coord_get_cached(coord_get_parent(coord)); |
1861 | 1862 |
1862 if(coord_is_root(coord) || IS_CACHE_REDRAW_ALL(pcached_coord)) | 1863 if(coord_is_root(coord) || IS_CACHE_REDRAW_ALL(pcached_coord)) |
1863 continue; | 1864 continue; |
1864 | 1865 |
2802 | 2803 |
2803 sh = (shape_t *)sh_dummy_new(rdman, 100, 100, 20, 20); | 2804 sh = (shape_t *)sh_dummy_new(rdman, 100, 100, 20, 20); |
2804 rdman_add_shape(rdman, (shape_t *)sh, coord2); | 2805 rdman_add_shape(rdman, (shape_t *)sh, coord2); |
2805 rdman_shape_changed(rdman, (shape_t *)sh); | 2806 rdman_shape_changed(rdman, (shape_t *)sh); |
2806 | 2807 |
2807 clean_rdman_coords(rdman); | 2808 rdman_clean_dirties(rdman); |
2808 | 2809 |
2809 /* Parent cached coord must be updated */ | 2810 /* Parent cached coord must be updated */ |
2810 CU_ASSERT(_coord_get_dirty_areas(rdman->root_coord)->num >= 1); | 2811 CU_ASSERT(_coord_get_dirty_areas(rdman->root_coord)->num >= 1); |
2811 } | 2812 } |
2812 | 2813 |