[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [cp-patches] [patch] fix BE image issues
From: |
Tom Tromey |
Subject: |
Re: [cp-patches] [patch] fix BE image issues |
Date: |
14 Aug 2005 14:46:31 -0600 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50 |
>>>>> "Andreas" == Andreas Tobler <address@hidden> writes:
Andreas> 2005-07-24 Andreas Tobler <address@hidden>
Andreas> * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkImage.c
Andreas> (Java_gnu_java_awt_peer_gtk_GtkImage_setPixels): Adjust BE image
Andreas> handling.
Andreas> +#ifdef WORDS_BIGENDIAN
Andreas> + for(j = 0 ; j < width * height; j++)
Andreas> + src[j] = SWAPU32((unsigned)src[j]);
Andreas> +#endif
I'm not so sure that this patch is correct. It modifies 'src' in
place. It seems to me that instead we would want to only byte swap
the data that we send to gtk. (Not that I know much about this
area. I just didn't want this message to go unreplied-to...)
Also, I think it would be more efficient to do the swapping at the
same time we are doing the copying, instead of swapping first and then
copying. That is, put this code into the loop (and only use memcpy as
an optimization for LE machines).
BTW I think a similar performance tweak should be applied in
gnu_java_awt_peer_gtk_GdkPixbufDecoder.c:area_updated_cb()
Tom
- Re: [cp-patches] [patch] fix BE image issues,
Tom Tromey <=