changeset 825:e83956ba22d7

Make sure drawing on right cached canvas
author Thinker K.F. Li <thinker@codemud.net>
date Tue, 14 Sep 2010 05:44:48 +0800
parents 93c54322d4d8
children 94041f085797
files src/redraw_man.c
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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
@@ -528,13 +528,15 @@
 
     return cr;
 #else
-    return NULL;
+    return (mbe_t *)malloc(16);
 #endif
 }
 
 static void canvas_free(mbe_t *canvas) {
 #ifndef UNITTEST
     mbe_destroy(canvas);
+#else
+    free(canvas);
 #endif
 }
 
@@ -2613,6 +2615,7 @@
     co_aix w, h;
     int trans_cnt;
     int draw_cnt;
+    redraw_man_t *last_draw;
 };
 
 void sh_dummy_free(shape_t *sh) {
@@ -2671,6 +2674,7 @@
 
     dummy = (sh_dummy_t *)shape;
     dummy->draw_cnt++;
+    dummy->last_draw = cr;
 }
 
 static void dummy_paint_prepare(paint_t *paint, mbe_t *cr) {
@@ -2884,6 +2888,7 @@
     rdman_redraw_all(rdman);
 
     CU_ASSERT(sh->draw_cnt == 1);
+    CU_ASSERT(sh->last_draw == _coord_get_canvas(coord2));
 
     rdman_paint_free(rdman, paint);
     redraw_man_destroy(rdman);