/[classpath]/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics2D.c
ViewVC logotype

Diff of /classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics2D.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.11 by mkoch, Wed Sep 22 11:03:10 2004 UTC revision 1.12 by mkoch, Fri Oct 8 18:03:00 2004 UTC
# Line 737  JNIEXPORT jintArray JNICALL Java_gnu_jav Line 737  JNIEXPORT jintArray JNICALL Java_gnu_jav
737    gint bits_per_sample = 8;    gint bits_per_sample = 8;
738    gboolean has_alpha = TRUE;    gboolean has_alpha = TRUE;
739    gint total_channels = 4;    gint total_channels = 4;
740    jint i, px;    jint i;
741    
742    gdk_threads_enter();    gdk_threads_enter();
743    if (peer_is_disposed(env, obj)) { gdk_threads_leave(); return NULL; }    if (peer_is_disposed(env, obj)) { gdk_threads_leave(); return NULL; }
# Line 766  JNIEXPORT jintArray JNICALL Java_gnu_jav Line 766  JNIEXPORT jintArray JNICALL Java_gnu_jav
766                                                                                                                                                                                                                
767    native_pixels= gdk_pixbuf_get_pixels (buf);    native_pixels= gdk_pixbuf_get_pixels (buf);
768        
769        #ifndef WORDS_BIGENDIAN
770    /* NOTE: The pixels we got in the pixbuf are stored    /* convert pixels from 0xBBGGRRAA to 0xAARRGGBB */
771       in reversed order. i.e 0xBBGGRRAA.    for (i=0; i<width * height; i++)
772       We need to convert them to  0xAARRGGBB. */      {
773            native_pixels[i] = SWAPU32 ((unsigned)native_pixels[i]);
   for (i=0; i<width * height; i++)  
     {          
                 
         /* convert pixels from 0xBBGGRRAA to 0xAARRGGBB */  
           
         px = native_pixels[i];  
         px = ((px >> 24) & 0xff) | ((px << 8) & 0xffffff00);  
         px = ((px >>  8) & 0x00ff00ff) | ((px <<  8) & 0xff00ff00);  
         px = ((px >> 16) & 0x0000ffff) | ((px << 16) & 0xffff0000);  
         native_pixels[i] = px;  
         
774      }      }
775    #endif
776     java_pixels = (*env) -> NewIntArray (env, width * height);       java_pixels = (*env) -> NewIntArray (env, width * height);  
777        
778     (*env)->SetIntArrayRegion(env, java_pixels,     (*env)->SetIntArrayRegion(env, java_pixels,

Legend:
Removed from v.1.11  
changed lines
  Added in v.1.12

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26