[cp-patches] FYI: Cairosurface fix

Sven de Marothy sven at physto.se
Thu Jun 1 04:27:59 UTC 2006


2006-06-01  Sven de Marothy  <sven at physto.se>

	* native/jni/gtk-peer/gnu_java_awt_peer_gtk_CairoSurface.c
	(setPixels): Don't swap, correct size.



===================================================================
RCS file: /sources/classpath/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_CairoSurface.c,v
retrieving revision 1.9
retrieving revision 1.11
diff -u -r1.9 -r1.11
--- classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_CairoSurface.c	2006/06/01 00:57:18	1.9
+++ classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_CairoSurface.c	2006/06/01 04:26:40	1.11
@@ -130,7 +130,7 @@
 
   jpixels = (*env)->NewIntArray (env, size);
   jpixdata = (*env)->GetIntArrayElements (env, jpixels, NULL);
-  memcpy (jpixdata, pixeldata, size);
+  memcpy (jpixdata, pixeldata, size * sizeof( jint ));
 
   (*env)->ReleaseIntArrayElements (env, jpixels, jpixdata, 0);
   return jpixels;
@@ -146,10 +146,6 @@
   jint *pixeldata, *jpixdata;
   int size;
 
-#ifndef WORDS_BIGENDIAN
-  int i;
-#endif
-
   pixeldata = (jint *)getNativeObject(env, obj, BUFFER);
   g_assert(pixeldata != NULL);
 
@@ -157,14 +153,6 @@
   size = (*env)->GetArrayLength( env, jpixels );
   memcpy (pixeldata, jpixdata, size * sizeof( jint ));
 
-#ifndef WORDS_BIGENDIAN
-  /* convert pixels from 0xBBGGRRAA to 0xAARRGGBB */
-  for (i = 0; i < size; ++i)
-    {
-      jpixdata[i] = SWAPU32 ((unsigned)jpixdata[i]);
-    }
-#endif
-
   (*env)->ReleaseIntArrayElements (env, jpixels, jpixdata, 0);
 }
-- 
Sven de Marothy <sven at physto.se>




More information about the Classpath-patches mailing list