Mercurial > mplayer.hg
comparison libass/ass_render.c @ 23023:0694bbf7ac84
Because of the outline glyph cache it is now possible for glyph_info_t to have
both non-zero glyph and bitmap at the same time. In that case, bitmap should
not be generated anew.
author | eugeni |
---|---|
date | Fri, 20 Apr 2007 23:11:39 +0000 |
parents | 199a3c6f54e8 |
children | a66b42eda8e8 |
comparison
equal
deleted
inserted
replaced
23022:199a3c6f54e8 | 23023:0694bbf7ac84 |
---|---|
391 bitmap_hash_val_t hash_val; | 391 bitmap_hash_val_t hash_val; |
392 ass_image_t* head; | 392 ass_image_t* head; |
393 ass_image_t** tail = &head; | 393 ass_image_t** tail = &head; |
394 | 394 |
395 for (i = 0; i < text_info->length; ++i) { | 395 for (i = 0; i < text_info->length; ++i) { |
396 if (text_info->glyphs[i].glyph) { | 396 if (text_info->glyphs[i].glyph && text_info->glyphs[i].bm == 0) { |
397 if ((text_info->glyphs[i].symbol == '\n') || (text_info->glyphs[i].symbol == 0)) | 397 if ((text_info->glyphs[i].symbol == '\n') || (text_info->glyphs[i].symbol == 0)) |
398 continue; | 398 continue; |
399 error = glyph_to_bitmap(ass_renderer->synth_priv, | 399 error = glyph_to_bitmap(ass_renderer->synth_priv, |
400 text_info->glyphs[i].glyph, text_info->glyphs[i].outline_glyph, | 400 text_info->glyphs[i].glyph, text_info->glyphs[i].outline_glyph, |
401 &text_info->glyphs[i].bm, &text_info->glyphs[i].bm_o, | 401 &text_info->glyphs[i].bm, &text_info->glyphs[i].bm_o, |
1948 FT_Vector start; | 1948 FT_Vector start; |
1949 FT_Vector start_old; | 1949 FT_Vector start_old; |
1950 FT_Vector shift; | 1950 FT_Vector shift; |
1951 glyph_info_t* info = text_info.glyphs + i; | 1951 glyph_info_t* info = text_info.glyphs + i; |
1952 | 1952 |
1953 if (info->bm == 0) { | |
1953 // calculating shift vector | 1954 // calculating shift vector |
1954 shift.x = int_to_d6(info->pos.x + device_x - center.x); | 1955 shift.x = int_to_d6(info->pos.x + device_x - center.x); |
1955 shift.y = - int_to_d6(info->pos.y + device_y - center.y); | 1956 shift.y = - int_to_d6(info->pos.y + device_y - center.y); |
1956 | 1957 |
1957 transform_3d(shift, &info->glyph, &info->outline_glyph, info->frx, info->fry, info->frz); | 1958 transform_3d(shift, &info->glyph, &info->outline_glyph, info->frx, info->fry, info->frz); |
1959 } | |
1958 } | 1960 } |
1959 } | 1961 } |
1960 | 1962 |
1961 event_images->top = device_y - d6_to_int(text_info.lines[0].asc); | 1963 event_images->top = device_y - d6_to_int(text_info.lines[0].asc); |
1962 event_images->height = d6_to_int(text_info.height); | 1964 event_images->height = d6_to_int(text_info.height); |