color problem for big endian fixes ??

Bernd Roesch nospamname at
Sun Jun 14 14:50:43 BST 2009


I dont understand what goes wrong, i test in func 
fb_colour_to_pixel that the gfx Card need data in rgba mode.

this testcode give a full red display

static inline uint32_t fb_colour_to_pixel(colour c)
c = 0xff000000; 
        return c;

so all should work ok with the netsurf code.But c contain abgr values
instead what i expect argb values

below code work and colors are correct for text, fb_32bpp_fill.So it seem
sure data come in abgr Format.
But colors
are wrong for i need red and blue change because the netsurf
image on welcome page is yellow.but the right rectangle is blue.

please help, what is wrong.

normaly i must add in fb_32bpp_bitmap old code, but this seem not clean.

i find only this place with __BIG_ENDIAN check 

//colour abgr 
// pixel format rgba
static inline colour fb_32bpp_to_colour(uint32_t pixel)
    //return (pixel >> 8) & ~0xFF000000U;
    return (((pixel & 0xFF000000) >> 24  ) |
                ((pixel & 0xFF0000) >> 8) |
                ((pixel & 0xFF00) << 8));

/* convert a colour value to a 32bpp pixel value ready for screen output */

static inline uint32_t fb_colour_to_pixel(colour c)
        //c = 0xff000000; 
        //return c;
        return (((c & 0xFF) << 24 ) |
                ((c & 0xFF00) << 8) |
                ((c & 0xFF0000) >> 8) | ((c & 0xFF000000) >> 24));


More information about the netsurf-dev mailing list