changeset 935:960e2395973d

Fix the bug of crash by abort() when running testsvg.js. The cached coords their pcache areas should be recomputed are also add ro zeroing list. They have no dirty areas. But, their pcache area must be added to parent cached coord.
author Thinker K.F. Li <thinker@codemud.net>
date Fri, 12 Nov 2010 16:03:19 +0800
parents 5dedeedf0408
children a9abcdac0ae5
files src/redraw_man.c
diffstat 1 files changed, 16 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/redraw_man.c	Thu Nov 11 00:56:51 2010 +0800
+++ b/src/redraw_man.c	Fri Nov 12 16:03:19 2010 +0800
@@ -1828,8 +1828,22 @@
 
     n_areas = _coord_get_dirty_areas(coord)->num;
     areas = _coord_get_dirty_areas(coord)->ds;
-    if(n_areas == 0)
-	abort();		/* should not happen! */
+    if(n_areas == 0) {
+	/* Go here for cached one that is descendant of another zeroed
+	 * one, but itself is not zeroed.  It is here for recomputing
+	 * pcache areas.
+	 */
+	if(coord_get_flags(coord, COF_JUST_CLEAN | COF_JUST_ZERO))
+	    abort();		/* should not happen! */
+	
+	parent = coord_get_parent(coord);
+	pcached_coord = coord_get_cached(parent);
+	area = coord_get_pcache_area(coord);
+	add_dirty_area(rdman, pcached_coord, area);
+	area = coord_get_pcache_last_area(coord);
+	add_dirty_area(rdman, pcached_coord, area);
+	return;
+    }
 
     area0 = _coord_get_aggr_dirty_areas(coord);
     area1 = area0 + 1;