[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[cp-patches] Re: [patch] fix BE image issues
From: |
Andreas Tobler |
Subject: |
[cp-patches] Re: [patch] fix BE image issues |
Date: |
Tue, 26 Jul 2005 07:59:39 +0200 |
User-agent: |
Mozilla Thunderbird 1.0.5 (Macintosh/20050711) |
Andreas Tobler wrote:
2005-07-24 Andreas Tobler <address@hidden>
* native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkImage.c
(Java_gnu_java_awt_peer_gtk_GtkImage_setPixels): Adjust BE image
handling.
here an update which removes one count var.
Andreas
Index: native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkImage.c
===================================================================
RCS file:
/cvs/gcc/gcc/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkImage.c,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 gnu_java_awt_peer_gtk_GtkImage.c
--- native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkImage.c 16 Jul
2005 00:30:51 -0000 1.1.1.1
+++ native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkImage.c 26 Jul
2005 05:57:53 -0000
@@ -184,9 +184,16 @@
height = gdk_pixbuf_get_height (pixbuf);
rowstride = gdk_pixbuf_get_rowstride (pixbuf);
- src = src_array_iter =
+ src = src_array_iter =
(*env)->GetIntArrayElements (env, pixels, NULL);
+ /* Convert the native BigEndian pixels to the 32-bit AABBGGRR format
+ the Java uses. */
+#ifdef WORDS_BIGENDIAN
+ for(i = 0 ; i < width * height; i++)
+ src[i] = SWAPU32((unsigned)src[i]);
+#endif
+
pixeldata = gdk_pixbuf_get_pixels (pixbuf);
for(i = 0 ; i < height; i++)
{