comparison libvo/vo_corevideo.m @ 34876:c5f89bf5b952

corevideo: Reduce code duplication in OSD rendering code.
author reimar
date Wed, 23 May 2012 19:28:03 +0000
parents 444a6a469743
children 3e6cfa2053bf
comparison
equal deleted inserted replaced
34875:444a6a469743 34876:c5f89bf5b952
97 97
98 LIBVO_EXTERN(corevideo) 98 LIBVO_EXTERN(corevideo)
99 99
100 static void draw_alpha(int x0, int y0, int w, int h, unsigned char *src, unsigned char *srca, int stride) 100 static void draw_alpha(int x0, int y0, int w, int h, unsigned char *src, unsigned char *srca, int stride)
101 { 101 {
102 unsigned char *dst = image_data + image_bytes * (y0 * image_width + x0);
103 int dststride = image_bytes * image_width;
102 switch (image_format) 104 switch (image_format)
103 { 105 {
104 case IMGFMT_RGB24: 106 case IMGFMT_RGB24:
105 vo_draw_alpha_rgb24(w,h,src,srca,stride,image_data+3*(y0*image_width+x0),3*image_width); 107 vo_draw_alpha_rgb24(w,h,src,srca,stride,dst,dststride);
106 break; 108 break;
107 case IMGFMT_ARGB: 109 case IMGFMT_ARGB:
108 case IMGFMT_BGRA: 110 case IMGFMT_BGRA:
109 vo_draw_alpha_rgb32(w,h,src,srca,stride,image_data+4*(y0*image_width+x0),4*image_width); 111 vo_draw_alpha_rgb32(w,h,src,srca,stride,dst,dststride);
110 break; 112 break;
111 case IMGFMT_YUY2: 113 case IMGFMT_YUY2:
112 vo_draw_alpha_yuy2(w,h,src,srca,stride,image_data + (x0 + y0 * image_width) * 2,image_width*2); 114 vo_draw_alpha_yuy2(w,h,src,srca,stride,dst,dststride);
113 break; 115 break;
114 } 116 }
115 } 117 }
116 118
117 static void update_screen_info(void) 119 static void update_screen_info(void)