comparison src/X_supp.c @ 1073:d09f603438d8 openvg

Merge the work of improvement for graphic engine of openvg branch
author Thinker K.F. Li <thinker@codemud.net>
date Wed, 01 Dec 2010 20:01:49 +0800
parents 7b4e80ab671a
children a7f16c967a0b
comparison
equal deleted inserted replaced
1072:cf82361fe5b9 1073:d09f603438d8
779 h = xmb_rt->h; 779 h = xmb_rt->h;
780 780
781 #ifdef XSHM 781 #ifdef XSHM
782 xshm_init(xmb_rt); 782 xshm_init(xmb_rt);
783 #endif 783 #endif
784 784
785 mbe_init();
786
785 xmb_rt->surface = 787 xmb_rt->surface =
786 mbe_image_surface_create(MB_IFMT_ARGB32, w, h); 788 mbe_image_surface_create(MB_IFMT_ARGB32, w, h);
787 789
788 xmb_rt->surface_ptn = 790 xmb_rt->surface_ptn =
789 mbe_pattern_create_for_surface(xmb_rt->surface); 791 mbe_pattern_create_for_surface(xmb_rt->surface);
790 792
791 if(xmb_rt->backend_surface == NULL) /* xshm_init() may create one */ 793 if(xmb_rt->backend_surface == NULL) /* xshm_init() may create one */
792 xmb_rt->backend_surface = 794 xmb_rt->backend_surface =
793 mbe_xlib_surface_create(xmb_rt->display, 795 mbe_win_surface_create(xmb_rt->display,
794 xmb_rt->win, 796 xmb_rt->win,
795 xmb_rt->visual, 797 xmb_rt->visual,
796 w, h); 798 w, h);
797 799
798 xmb_rt->cr = mbe_create(xmb_rt->surface); 800 xmb_rt->cr = mbe_create(xmb_rt->surface);
799 xmb_rt->backend_cr = mbe_create(xmb_rt->backend_surface); 801 xmb_rt->backend_cr = mbe_create(xmb_rt->backend_surface);
800 802
803 /* TODO: Remove this line. Since we use mbe_copy_source(), it
804 * will set source for the backend. So, this line is redundants.
805 * It can be removed. sourface_ptn can be removed, too.
806 */
801 mbe_set_source(xmb_rt->backend_cr, xmb_rt->surface_ptn); 807 mbe_set_source(xmb_rt->backend_cr, xmb_rt->surface_ptn);
802 808
803 xmb_rt->rdman = (redraw_man_t *)malloc(sizeof(redraw_man_t)); 809 xmb_rt->rdman = (redraw_man_t *)malloc(sizeof(redraw_man_t));
804 redraw_man_init(xmb_rt->rdman, xmb_rt->cr, xmb_rt->backend_cr); 810 redraw_man_init(xmb_rt->rdman, xmb_rt->cr, xmb_rt->backend_cr);
805 // FIXME: This is a wired loopback reference. This is inly required when we need 811 /* FIXME: This is a wired loopback reference. This is inly
806 // to get the xmb_rt->tman for the animation. We should relocate the tman 812 * required when we need to get the xmb_rt->tman for the
807 // to the redraw_man_t instead. 813 * animation. We should relocate the tman to the
814 * redraw_man_t instead.
815 */
808 xmb_rt->rdman->rt = xmb_rt; 816 xmb_rt->rdman->rt = xmb_rt;
809 817
810 xmb_rt->io_man = mb_io_man_new(_io_factory); 818 xmb_rt->io_man = mb_io_man_new(_io_factory);
811 xmb_rt->timer_man = mb_timer_man_new(_timer_factory); 819 xmb_rt->timer_man = mb_timer_man_new(_timer_factory);
812 820