]> www.fi.muni.cz Git - evince.git/commitdiff
Fix output on big endian machines. Fixes bug #578433.
authorBenjamin Berg <benjamin@sipsolutions.net>
Wed, 8 Apr 2009 22:38:09 +0000 (22:38 +0000)
committerBenjamin Berg <bberg@src.gnome.org>
Wed, 8 Apr 2009 22:38:09 +0000 (22:38 +0000)
2009-04-09  Benjamin Berg  <benjamin@sipsolutions.net>

* backend/dvi/cairo-device.c: (dvi_cairo_put_pixel):
Fix output on big endian machines. Fixes bug #578433.

svn path=/branches/gnome-2-26/; revision=3587

ChangeLog
backend/dvi/cairo-device.c

index ebe8c3732d63105de027aad85accd50cb3aea571..7195980c93f4dfcdfc3f670f1329bed1647d6074 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2009-04-09  Benjamin Berg  <benjamin@sipsolutions.net>
+
+       * backend/dvi/cairo-device.c: (dvi_cairo_put_pixel):
+       Fix output on big endian machines. Fixes bug #578433.
+
 2009-04-08  Nickolay V. Shmyrev  <nshmyrev@yandex.ru>
 
        * backend/tiff/tiff2ps.c (tiff2ps_context_new):
index 9a42e7b5a9326874fe76db6d6848d545cc6e599a..bf46cfc3a22b92189bc7e08c11e179d788d95941 100644 (file)
@@ -247,16 +247,14 @@ dvi_cairo_put_pixel (void *image, int x, int y, Ulong color)
 {
        cairo_surface_t *surface;
        gint             rowstride;
-       guchar          *p;
+       guint32         *p;
 
        surface = (cairo_surface_t *) image;
 
        rowstride = cairo_image_surface_get_stride (surface);
-       p = cairo_image_surface_get_data (surface) + y * rowstride + x * 4;
+       p = (guint32*) (cairo_image_surface_get_data (surface) + y * rowstride + x * 4);
 
-       p[2] = (color >> 16) & 0xff;
-       p[1] = (color >> 8) & 0xff;
-       p[0] = (color >> 0) & 0xff;
+       *p = color;
 }
 
 static void