comparison src/redraw_man.c @ 867:4f8d53be9488

Allocate linear, radial, image paints from elmpools
author Thinker K.F. Li <thinker@codemud.net>
date Thu, 23 Sep 2010 10:43:56 +0800
parents 9a7ac4487849
children 881efcd8a18f
comparison
equal deleted inserted replaced
866:9a7ac4487849 867:4f8d53be9488
640 int redraw_man_init(redraw_man_t *rdman, mbe_t *cr, mbe_t *backend) { 640 int redraw_man_init(redraw_man_t *rdman, mbe_t *cr, mbe_t *backend) {
641 extern void redraw_man_destroy(redraw_man_t *rdman); 641 extern void redraw_man_destroy(redraw_man_t *rdman);
642 extern int _sh_path_size; 642 extern int _sh_path_size;
643 extern int _sh_rect_size; 643 extern int _sh_rect_size;
644 extern int _paint_color_size; 644 extern int _paint_color_size;
645 extern int _paint_linear_size;
646 extern int _paint_radial_size;
647 extern int _paint_image_size;
645 observer_t *addrm_ob; 648 observer_t *addrm_ob;
646 extern void addrm_monitor_hdlr(event_t *evt, void *arg); 649 extern void addrm_monitor_hdlr(event_t *evt, void *arg);
647 650
648 memset(rdman, 0, sizeof(redraw_man_t)); 651 memset(rdman, 0, sizeof(redraw_man_t));
649 652
658 rdman->sh_path_pool = elmpool_new(_sh_path_size, 16); 661 rdman->sh_path_pool = elmpool_new(_sh_path_size, 16);
659 rdman->sh_rect_pool = elmpool_new(_sh_rect_size, 16); 662 rdman->sh_rect_pool = elmpool_new(_sh_rect_size, 16);
660 rdman->observer_pool = elmpool_new(sizeof(observer_t), 32); 663 rdman->observer_pool = elmpool_new(sizeof(observer_t), 32);
661 rdman->subject_pool = elmpool_new(sizeof(subject_t), 32); 664 rdman->subject_pool = elmpool_new(sizeof(subject_t), 32);
662 rdman->paint_color_pool = elmpool_new(_paint_color_size, 64); 665 rdman->paint_color_pool = elmpool_new(_paint_color_size, 64);
666 rdman->paint_linear_pool = elmpool_new(_paint_linear_size, 64);
667 rdman->paint_radial_pool = elmpool_new(_paint_radial_size, 64);
668 rdman->paint_image_pool = elmpool_new(_paint_image_size, 64);
663 rdman->pent_pool = elmpool_new(sizeof(mb_prop_entry_t), 128); 669 rdman->pent_pool = elmpool_new(sizeof(mb_prop_entry_t), 128);
664 rdman->coord_canvas_pool = elmpool_new(sizeof(coord_canvas_info_t), 16); 670 rdman->coord_canvas_pool = elmpool_new(sizeof(coord_canvas_info_t), 16);
665 if(!(rdman->geo_pool && rdman->coord_pool && rdman->shnode_pool && 671 if(!(rdman->geo_pool && rdman->coord_pool && rdman->shnode_pool &&
666 rdman->observer_pool && rdman->subject_pool && 672 rdman->observer_pool && rdman->subject_pool &&
667 rdman->paint_color_pool && rdman->coord_canvas_pool)) 673 rdman->paint_color_pool && rdman->coord_canvas_pool))
732 elmpool_free(rdman->observer_pool); 738 elmpool_free(rdman->observer_pool);
733 if(rdman->subject_pool) 739 if(rdman->subject_pool)
734 elmpool_free(rdman->subject_pool); 740 elmpool_free(rdman->subject_pool);
735 if(rdman->paint_color_pool) 741 if(rdman->paint_color_pool)
736 elmpool_free(rdman->paint_color_pool); 742 elmpool_free(rdman->paint_color_pool);
743 if(rdman->paint_linear_pool)
744 elmpool_free(rdman->paint_linear_pool);
745 if(rdman->paint_radial_pool)
746 elmpool_free(rdman->paint_radial_pool);
747 if(rdman->paint_image_pool)
748 elmpool_free(rdman->paint_image_pool);
737 if(rdman->pent_pool) 749 if(rdman->pent_pool)
738 elmpool_free(rdman->pent_pool); 750 elmpool_free(rdman->pent_pool);
739 if(rdman->coord_canvas_pool) 751 if(rdman->coord_canvas_pool)
740 elmpool_free(rdman->coord_canvas_pool); 752 elmpool_free(rdman->coord_canvas_pool);
741 DARRAY_DESTROY(&rdman->dirty_coords); 753 DARRAY_DESTROY(&rdman->dirty_coords);
790 elmpool_free(rdman->sh_path_pool); 802 elmpool_free(rdman->sh_path_pool);
791 elmpool_free(rdman->sh_rect_pool); 803 elmpool_free(rdman->sh_rect_pool);
792 elmpool_free(rdman->observer_pool); 804 elmpool_free(rdman->observer_pool);
793 elmpool_free(rdman->subject_pool); 805 elmpool_free(rdman->subject_pool);
794 elmpool_free(rdman->paint_color_pool); 806 elmpool_free(rdman->paint_color_pool);
807 elmpool_free(rdman->paint_linear_pool);
808 elmpool_free(rdman->paint_radial_pool);
809 elmpool_free(rdman->paint_image_pool);
795 elmpool_free(rdman->pent_pool); 810 elmpool_free(rdman->pent_pool);
796 elmpool_free(rdman->coord_canvas_pool); 811 elmpool_free(rdman->coord_canvas_pool);
797 812
798 DARRAY_DESTROY(&rdman->dirty_coords); 813 DARRAY_DESTROY(&rdman->dirty_coords);
799 DARRAY_DESTROY(&rdman->dirty_geos); 814 DARRAY_DESTROY(&rdman->dirty_geos);