summaryrefslogtreecommitdiffstats
path: root/src/sp-cursor.cpp
diff options
context:
space:
mode:
authormpasteven <>2016-11-06 22:26:28 +0000
committerMarc Jeanmougin <marcjeanmougin@free.fr>2016-11-06 22:26:28 +0000
commit7a6644c0da9f5614f46e98876bedd918c7e99110 (patch)
treec6d01e3e3fcee2aaeccce5304355533a002c5f15 /src/sp-cursor.cpp
parentmerge recursive unlink clones branch (diff)
downloadinkscape-7a6644c0da9f5614f46e98876bedd918c7e99110.tar.gz
inkscape-7a6644c0da9f5614f46e98876bedd918c7e99110.zip
fix cursor on big endian systems
Fixed bugs: - https://launchpad.net/bugs/1639611 (bzr r15221)
Diffstat (limited to 'src/sp-cursor.cpp')
-rw-r--r--src/sp-cursor.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/sp-cursor.cpp b/src/sp-cursor.cpp
index 16659d1cf..4b9f1cc2d 100644
--- a/src/sp-cursor.cpp
+++ b/src/sp-cursor.cpp
@@ -108,6 +108,13 @@ GdkPixbuf *sp_cursor_pixbuf_from_xpm(char const *const *xpm, GdkColor const& bla
}
}
+#if G_BYTE_ORDER == G_BIG_ENDIAN
+ for (int i = 0, n = width * height; i < n; i++) {
+ guint32 v = pixmap_buffer[i];
+ pixmap_buffer[i] = ((v & 0xFF) << 24) | (((v >> 8) & 0xFF) << 16) | (((v >> 16) & 0xFF) << 8) | ((v >> 24) & 0xFF);
+ }
+#endif
+
return gdk_pixbuf_new_from_data(reinterpret_cast<guchar*>(pixmap_buffer), GDK_COLORSPACE_RGB, TRUE, 8, width, height, width * sizeof(guint32), free_cursor_data, NULL);
}