X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=blobdiff_plain;ds=inline;f=backend%2Fdvi%2Fmdvi-lib%2Fbitmap.c;h=6edec1dfea2036bb0d8f78800d7a5aad40ab3285;hb=ab0edaffd2f1790ec8ac7ac17f90e0a8007b92cd;hp=0c598209ade98950bf1a3cc8a9c6ed4766aac921;hpb=1af6600934d1f723e5b492b8322e52a1144fb0af;p=evince.git diff --git a/backend/dvi/mdvi-lib/bitmap.c b/backend/dvi/mdvi-lib/bitmap.c index 0c598209..6edec1df 100644 --- a/backend/dvi/mdvi-lib/bitmap.c +++ b/backend/dvi/mdvi-lib/bitmap.c @@ -13,7 +13,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* Bitmap manipulation routines */ @@ -125,7 +125,7 @@ static Uchar bit_swap[] = { * hopelessly slow. */ -BITMAP *bitmap_convert_lsb8(Uchar *bits, int w, int h) +BITMAP *bitmap_convert_lsb8(Uchar *bits, int w, int h, int stride) { BITMAP *bm; int i; @@ -147,12 +147,13 @@ BITMAP *bitmap_convert_lsb8(Uchar *bits, int w, int h) for(i = 0; i < h; i++) { #ifdef WORD_LITTLE_ENDIAN memcpy(unit, curr, bytes); - curr += bytes; + curr += stride; #else int j; for(j = 0; j < bytes; curr++, j++) unit[j] = bit_swap[*curr]; + cur += stride - bytes; #endif memzero(unit + bytes, bm->stride - bytes); unit += bm->stride; @@ -162,7 +163,7 @@ BITMAP *bitmap_convert_lsb8(Uchar *bits, int w, int h) return bm; } -BITMAP *bitmap_convert_msb8(Uchar *data, int w, int h) +BITMAP *bitmap_convert_msb8(Uchar *data, int w, int h, int stride) { BITMAP *bm; Uchar *unit; @@ -180,9 +181,10 @@ BITMAP *bitmap_convert_msb8(Uchar *data, int w, int h) for(j = 0; j < bytes; curr++, j++) unit[j] = bit_swap[*curr]; + curr += stride - bytes; #else memcpy(unit, curr, bytes); - curr += bytes; + curr += stride; #endif memzero(unit + bytes, bm->stride - bytes); unit += bm->stride; @@ -1026,6 +1028,8 @@ void mdvi_shrink_glyph_grey(DviContext *dvi, DviFont *font, for(x = 0; x < w; x++) dev->put_pixel(image, x, y, pixels[0]); } + + dev->image_done(image); DEBUG((DBG_BITMAPS, "shrink_glyph_grey: (%dw,%dh,%dx,%dy) -> (%dw,%dh,%dx,%dy)\n", glyph->w, glyph->h, glyph->x, glyph->y, dest->w, dest->h, dest->x, dest->y));