Mercurial > MadButterfly
comparison src/redraw_man.c @ 25:29937c26bb01
Fix bug of a dark line appear when animating.
- Don't setup clips on buffer surface.
- But, apply clips on XLib surface.
author | Thinker K.F. Li <thinker@branda.to> |
---|---|
date | Sun, 03 Aug 2008 02:19:32 +0800 |
parents | e598bc809c0f |
children | d50f33040de6 |
comparison
equal
deleted
inserted
replaced
24:e598bc809c0f | 25:29937c26bb01 |
---|---|
493 } | 493 } |
494 } | 494 } |
495 } | 495 } |
496 | 496 |
497 #ifndef UNITTEST | 497 #ifndef UNITTEST |
498 static void clean_clip(cairo_t *cr) { | 498 static void clean_canvas(cairo_t *cr) { |
499 cairo_pattern_t *pt; | 499 cairo_pattern_t *pt; |
500 | 500 |
501 pt = cairo_get_source(cr); | 501 pt = cairo_get_source(cr); |
502 cairo_pattern_reference(pt); | 502 cairo_pattern_reference(pt); |
503 /* TODO: clean to background color. */ | 503 /* TODO: clean to background color. */ |
530 make_clip(rdman->backend, n_dirty_areas, dirty_areas); | 530 make_clip(rdman->backend, n_dirty_areas, dirty_areas); |
531 | 531 |
532 cairo_paint(rdman->backend); | 532 cairo_paint(rdman->backend); |
533 } | 533 } |
534 #else /* UNITTEST */ | 534 #else /* UNITTEST */ |
535 static void clean_clip(cairo_t *cr) { | 535 static void clean_canvas(cairo_t *cr) { |
536 } | 536 } |
537 | 537 |
538 static void make_clip(cairo_t *cr, int n_dirty_areas, | 538 static void make_clip(cairo_t *cr, int n_dirty_areas, |
539 area_t **dirty_areas) { | 539 area_t **dirty_areas) { |
540 } | 540 } |
628 } | 628 } |
629 | 629 |
630 n_dirty_areas = rdman->n_dirty_areas; | 630 n_dirty_areas = rdman->n_dirty_areas; |
631 dirty_areas = rdman->dirty_areas; | 631 dirty_areas = rdman->dirty_areas; |
632 if(n_dirty_areas > 0) { | 632 if(n_dirty_areas > 0) { |
633 make_clip(rdman->cr, n_dirty_areas, dirty_areas); | 633 clean_canvas(rdman->cr); |
634 clean_clip(rdman->cr); | |
635 draw_shapes_in_areas(rdman, n_dirty_areas, dirty_areas); | 634 draw_shapes_in_areas(rdman, n_dirty_areas, dirty_areas); |
636 copy_cr_2_backend(rdman, rdman->n_dirty_areas, rdman->dirty_areas); | 635 copy_cr_2_backend(rdman, rdman->n_dirty_areas, rdman->dirty_areas); |
637 rdman->n_dirty_areas = 0; | 636 rdman->n_dirty_areas = 0; |
638 reset_clip(rdman); | 637 reset_clip(rdman); |
639 } | 638 } |