diff options
author | Benjamin Berg <benjamin@sipsolutions.net> | 2009-04-08 22:34:02 (GMT) |
---|---|---|
committer | Benjamin Berg <bberg@src.gnome.org> | 2009-04-08 22:34:02 (GMT) |
commit | 1fa82889458f44a61704e7c47d1de77276c87bc7 (patch) | |
tree | 57f89bf8f6aeba84e292589fbcb3c5883ba16c21 | |
parent | 0b4b34a6e304532dd2af2824936f09a9b74c5cbf (diff) |
Fix output on big endian machines. Fixes bug #578433.
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=/trunk/; revision=3586
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | backend/dvi/cairo-device.c | 8 |
2 files changed, 8 insertions, 5 deletions
@@ -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 Dan Winship <danw@gnome.org> * cut-n-paste/smclient/eggsmclient-xsmp.c (save_state): diff --git a/backend/dvi/cairo-device.c b/backend/dvi/cairo-device.c index 9a42e7b..bf46cfc 100644 --- a/backend/dvi/cairo-device.c +++ b/backend/dvi/cairo-device.c @@ -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 |