comparison src/X_supp.c @ 1079:c5255cc77143 openvg

Remove X_supp_runtime_t::surface_ptn
author Thinker K.F. Li <thinker@codemud.net>
date Wed, 01 Dec 2010 23:08:13 +0800
parents b8c83fd0c323
children 851a062368bd
comparison
equal deleted inserted replaced
1078:b8c83fd0c323 1079:c5255cc77143
46 struct _X_supp_runtime { 46 struct _X_supp_runtime {
47 Display *display; 47 Display *display;
48 Window win; 48 Window win;
49 Visual *visual; 49 Visual *visual;
50 mbe_surface_t *surface, *backend_surface; 50 mbe_surface_t *surface, *backend_surface;
51 mbe_pattern_t *surface_ptn;
52 mbe_t *cr, *backend_cr; 51 mbe_t *cr, *backend_cr;
53 redraw_man_t *rdman; 52 redraw_man_t *rdman;
54 mb_img_ldr_t *img_ldr; 53 mb_img_ldr_t *img_ldr;
55 int w, h; 54 int w, h;
56 55
784 mbe_init(); 783 mbe_init();
785 784
786 xmb_rt->surface = 785 xmb_rt->surface =
787 mbe_image_surface_create(MB_IFMT_ARGB32, w, h); 786 mbe_image_surface_create(MB_IFMT_ARGB32, w, h);
788 787
789 xmb_rt->surface_ptn =
790 mbe_pattern_create_for_surface(xmb_rt->surface);
791
792 if(xmb_rt->backend_surface == NULL) /* xshm_init() may create one */ 788 if(xmb_rt->backend_surface == NULL) /* xshm_init() may create one */
793 xmb_rt->backend_surface = 789 xmb_rt->backend_surface =
794 mbe_win_surface_create(xmb_rt->display, 790 mbe_win_surface_create(xmb_rt->display,
795 xmb_rt->win, 791 xmb_rt->win,
796 xmb_rt->visual, 792 xmb_rt->visual,
797 w, h); 793 w, h);
798 794
799 xmb_rt->cr = mbe_create(xmb_rt->surface); 795 xmb_rt->cr = mbe_create(xmb_rt->surface);
800 xmb_rt->backend_cr = mbe_create(xmb_rt->backend_surface); 796 xmb_rt->backend_cr = mbe_create(xmb_rt->backend_surface);
801 797
802 /* TODO: Remove this line. Since we use mbe_copy_source(), it
803 * will set source for the backend. So, this line is redundants.
804 * It can be removed. surface_ptn can be removed, too.
805 */
806 mbe_set_source(xmb_rt->backend_cr, xmb_rt->surface_ptn);
807
808 xmb_rt->rdman = (redraw_man_t *)malloc(sizeof(redraw_man_t)); 798 xmb_rt->rdman = (redraw_man_t *)malloc(sizeof(redraw_man_t));
809 redraw_man_init(xmb_rt->rdman, xmb_rt->cr, xmb_rt->backend_cr); 799 redraw_man_init(xmb_rt->rdman, xmb_rt->cr, xmb_rt->backend_cr);
810 /* FIXME: This is a wired loopback reference. This is inly 800 /* FIXME: This is a wired loopback reference. This is inly
811 * required when we need to get the xmb_rt->tman for the 801 * required when we need to get the xmb_rt->tman for the
812 * animation. We should relocate the tman to the 802 * animation. We should relocate the tman to the
910 if(xmb_rt->backend_cr) 900 if(xmb_rt->backend_cr)
911 mbe_destroy(xmb_rt->backend_cr); 901 mbe_destroy(xmb_rt->backend_cr);
912 902
913 if(xmb_rt->surface) 903 if(xmb_rt->surface)
914 mbe_surface_destroy(xmb_rt->surface); 904 mbe_surface_destroy(xmb_rt->surface);
915 if(xmb_rt->surface_ptn)
916 mbe_pattern_destroy(xmb_rt->surface_ptn);
917 if(xmb_rt->backend_surface) 905 if(xmb_rt->backend_surface)
918 mbe_surface_destroy(xmb_rt->backend_surface); 906 mbe_surface_destroy(xmb_rt->backend_surface);
919 907
920 if(xmb_rt->display) 908 if(xmb_rt->display)
921 XCloseDisplay(xmb_rt->display); 909 XCloseDisplay(xmb_rt->display);