Mercurial > MadButterfly
comparison src/redraw_man.c @ 586:b42d69ab8857 openvg
Replace mbe_clip() with mbe_scissoring()
author | Thinker K.F. Li <thinker@branda.to> |
---|---|
date | Wed, 30 Jun 2010 13:28:53 +0800 |
parents | f42419c08a65 |
children | 7b4e80ab671a |
comparison
equal
deleted
inserted
replaced
585:6af1aa74e57c | 586:b42d69ab8857 |
---|---|
2139 #ifndef UNITTEST | 2139 #ifndef UNITTEST |
2140 static void clear_canvas(canvas_t *canvas) { | 2140 static void clear_canvas(canvas_t *canvas) { |
2141 mbe_clear(canvas); | 2141 mbe_clear(canvas); |
2142 } | 2142 } |
2143 | 2143 |
2144 static void make_clip(mbe_t *cr, int n_dirty_areas, | 2144 #define make_clip(canvas, n_dirty_areas, dirty_areas) \ |
2145 area_t **dirty_areas) { | 2145 mbe_scissoring(canvas, n_dirty_areas, dirty_areas) |
2146 int i; | |
2147 area_t *area; | |
2148 | |
2149 mbe_new_path(cr); | |
2150 for(i = 0; i < n_dirty_areas; i++) { | |
2151 area = dirty_areas[i]; | |
2152 if(area->w < 0.1 || area->h < 0.1) | |
2153 continue; | |
2154 mbe_rectangle(cr, area->x, area->y, area->w, area->h); | |
2155 } | |
2156 mbe_clip(cr); | |
2157 } | |
2158 | 2146 |
2159 static void reset_clip(canvas_t *cr) { | 2147 static void reset_clip(canvas_t *cr) { |
2160 mbe_reset_clip(cr); | 2148 mbe_reset_scissoring(cr); |
2161 } | 2149 } |
2162 | 2150 |
2163 static void copy_cr_2_backend(redraw_man_t *rdman, int n_dirty_areas, | 2151 static void copy_cr_2_backend(redraw_man_t *rdman, int n_dirty_areas, |
2164 area_t **dirty_areas) { | 2152 area_t **dirty_areas) { |
2165 if(n_dirty_areas) | 2153 if(n_dirty_areas) |
2166 make_clip(rdman->backend, n_dirty_areas, dirty_areas); | 2154 make_clip(rdman->backend, n_dirty_areas, dirty_areas); |
2167 | 2155 |
2168 mbe_copy_source(rdman->cr, rdman->backend); | 2156 mbe_copy_source(rdman->cr, rdman->backend); |
2169 } | 2157 } |
2170 #else /* UNITTEST */ | 2158 #else /* UNITTEST */ |
2171 static void make_clip(mbe_t *cr, int n_dirty_areas, | 2159 #define make_clip(canvas, n_dirty_areas, dirty_areas) |
2172 area_t **dirty_areas) { | |
2173 } | |
2174 | 2160 |
2175 static void clear_canvas(canvas_t *canvas) { | 2161 static void clear_canvas(canvas_t *canvas) { |
2176 } | 2162 } |
2177 | 2163 |
2178 static void reset_clip(canvas_t *cr) { | 2164 static void reset_clip(canvas_t *cr) { |