Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 158172
Collapse All | Expand All

(-)backend/dvi/mdvi-lib/bitmap.c (-4 / +6 lines)
Lines 125-131 Link Here
125
 * hopelessly slow.
125
 * hopelessly slow.
126
 */
126
 */
127
127
128
BITMAP	*bitmap_convert_lsb8(Uchar *bits, int w, int h)
128
BITMAP	*bitmap_convert_lsb8(Uchar *bits, int w, int h, int stride)
129
{
129
{
130
	BITMAP	*bm;
130
	BITMAP	*bm;
131
	int	i;
131
	int	i;
Lines 147-158 Link Here
147
	for(i = 0; i < h; i++) {
147
	for(i = 0; i < h; i++) {
148
#ifdef WORD_LITTLE_ENDIAN
148
#ifdef WORD_LITTLE_ENDIAN
149
		memcpy(unit, curr, bytes);
149
		memcpy(unit, curr, bytes);
150
		curr += bytes;
150
		curr += stride;
151
#else
151
#else
152
		int	j;
152
		int	j;
153
		
153
		
154
		for(j = 0; j < bytes; curr++, j++)
154
		for(j = 0; j < bytes; curr++, j++)
155
			unit[j] = bit_swap[*curr];
155
			unit[j] = bit_swap[*curr];
156
		cur += stride - bytes;
156
#endif
157
#endif
157
		memzero(unit + bytes, bm->stride - bytes);
158
		memzero(unit + bytes, bm->stride - bytes);
158
		unit  += bm->stride;
159
		unit  += bm->stride;
Lines 162-168 Link Here
162
	return bm;
163
	return bm;
163
}
164
}
164
165
165
BITMAP	*bitmap_convert_msb8(Uchar *data, int w, int h)
166
BITMAP	*bitmap_convert_msb8(Uchar *data, int w, int h, int stride)
166
{
167
{
167
	BITMAP	*bm;
168
	BITMAP	*bm;
168
	Uchar	*unit;
169
	Uchar	*unit;
Lines 180-188 Link Here
180
		
181
		
181
		for(j = 0; j < bytes; curr++, j++)
182
		for(j = 0; j < bytes; curr++, j++)
182
			unit[j] = bit_swap[*curr];
183
			unit[j] = bit_swap[*curr];
184
		curr += stride - bytes;
183
#else
185
#else
184
		memcpy(unit, curr, bytes);
186
		memcpy(unit, curr, bytes);
185
		curr += bytes;
187
		curr += stride;
186
#endif
188
#endif
187
		memzero(unit + bytes, bm->stride - bytes);
189
		memzero(unit + bytes, bm->stride - bytes);
188
		unit += bm->stride;
190
		unit += bm->stride;
(-)backend/dvi/mdvi-lib/bitmap.h (-2 / +2 lines)
Lines 136-143 Link Here
136
extern void bitmap_rotate_counter_clockwise __PROTO((BITMAP *));
136
extern void bitmap_rotate_counter_clockwise __PROTO((BITMAP *));
137
extern void bitmap_flip_rotate_clockwise __PROTO((BITMAP *));
137
extern void bitmap_flip_rotate_clockwise __PROTO((BITMAP *));
138
extern void bitmap_flip_rotate_counter_clockwise __PROTO((BITMAP *));
138
extern void bitmap_flip_rotate_counter_clockwise __PROTO((BITMAP *));
139
extern BITMAP *bitmap_convert_lsb8 __PROTO((Uchar *, int, int));
139
extern BITMAP *bitmap_convert_lsb8 __PROTO((Uchar *, int, int, int));
140
extern BITMAP *bitmap_convert_msb8 __PROTO((Uchar *, int, int));
140
extern BITMAP *bitmap_convert_msb8 __PROTO((Uchar *, int, int, int));
141
141
142
#include <stdio.h>
142
#include <stdio.h>
143
extern void	bitmap_print __PROTO((FILE *, BITMAP *));
143
extern void	bitmap_print __PROTO((FILE *, BITMAP *));
(-)backend/dvi/mdvi-lib/t1.c (-13 / +4 lines)
Lines 437-461 Link Here
437
437
438
static inline BITMAP *t1_glyph_bitmap(GLYPH *glyph)
438
static inline BITMAP *t1_glyph_bitmap(GLYPH *glyph)
439
{
439
{
440
	BITMAP	*bm;
440
	int	w, h, pad;
441
	int	w, h;
442
	
441
	
443
	w = GLYPH_WIDTH(glyph);
442
	w = GLYPH_WIDTH(glyph);
444
	h = GLYPH_HEIGHT(glyph);
443
	h = GLYPH_HEIGHT(glyph);
445
444
446
	if(!w || !h)
445
	if(!w || !h)
447
		return MDVI_GLYPH_EMPTY;
446
		return MDVI_GLYPH_EMPTY;
448
	switch(glyph->bpp << 3) {
447
449
		case 8: 
448
	pad = T1_GetBitmapPad();
450
			bm = bitmap_convert_lsb8((unsigned char *)glyph->bits, w, h);
449
	return bitmap_convert_lsb8((unsigned char *)glyph->bits, w, h, ROUND(w, pad) * (pad >> 3));
451
			break;
452
		default:
453
			warning(_("(t1) unsupported bitmap pad size %d\n"),
454
				glyph->bpp);
455
			bm = MDVI_GLYPH_EMPTY;
456
			break;
457
	}
458
	return bm;
459
}
450
}
460
451
461
static void t1_font_shrink_glyph(DviContext *dvi, DviFont *font, DviFontChar *ch, DviGlyph *dest)
452
static void t1_font_shrink_glyph(DviContext *dvi, DviFont *font, DviFontChar *ch, DviGlyph *dest)
(-)backend/dvi/mdvi-lib/tt.c (-1 / +1 lines)
Lines 382-388 Link Here
382
	
382
	
383
	TT_Translate_Outline(&outline, -bbox.xMin, -bbox.yMin);
383
	TT_Translate_Outline(&outline, -bbox.xMin, -bbox.yMin);
384
	TT_Get_Outline_Bitmap(tt_handle, &outline, &raster);
384
	TT_Get_Outline_Bitmap(tt_handle, &outline, &raster);
385
	glyph->data = bitmap_convert_msb8(raster.bitmap, w, h);
385
	glyph->data = bitmap_convert_msb8(raster.bitmap, w, h, ROUND(w, 8));
386
	TT_Done_Outline(&outline);
386
	TT_Done_Outline(&outline);
387
	mdvi_free(raster.bitmap);
387
	mdvi_free(raster.bitmap);

Return to bug 158172