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

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

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

revision 1.7 by mark, Mon Aug 9 22:54:49 2004 UTC revision 1.8 by mkoch, Fri Oct 8 18:03:00 2004 UTC
# Line 99  area_updated (GdkPixbufLoader *loader, Line 99  area_updated (GdkPixbufLoader *loader,
99    JNIEnv *env;    JNIEnv *env;
100    union env_union e;    union env_union e;
101    jint stride_bytes, stride_pixels, n_channels, n_pixels;    jint stride_bytes, stride_pixels, n_channels, n_pixels;
102    int i, px;    int i;
103    jintArray jpixels;      jintArray jpixels;  
104    jint *java_pixels;    jint *java_pixels;
105    guchar *gdk_pixels;    guchar *gdk_pixels;
# Line 129  area_updated (GdkPixbufLoader *loader, Line 129  area_updated (GdkPixbufLoader *loader,
129            gdk_pixels + (y * stride_bytes),            gdk_pixels + (y * stride_bytes),
130            (height * stride_bytes));            (height * stride_bytes));
131    
132    #ifndef WORDS_BIGENDIAN
133      /* convert pixels from 0xBBGGRRAA to 0xAARRGGBB */
134    for (i = 0; i < n_pixels; ++i)    for (i = 0; i < n_pixels; ++i)
135      {      {
136        px = java_pixels[i];        java_pixels[i] = SWAPU32 ((unsigned)java_pixels[i]);
   
       /* move alpha around (GdkPixbufLoader results are AGBR not GBRA, in  
          the lsb sense) */  
       /* px = ((px >> 24) & 0xff) | ((px << 8) & 0xffffff00); */  
   
       /* it appears to require a full byte swap, now, not just a shift to  
          the A channel. why did this change? don't know. */  
       px = ((px >>  8) & 0x00ff00ff) | ((px <<  8) & 0xff00ff00);  
       px = ((px >> 16) & 0x0000ffff) | ((px << 16) & 0xffff0000);  
   
       java_pixels[i] = px;  
137      }      }
138    #endif
139    
140    g_object_unref (pixbuf);    g_object_unref (pixbuf);
141    

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.8

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