2024-04-19 02:25 BST

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0002469NetSurfFramebuffer-specificpublic2016-12-31 11:59
ReporterAnthony J. Bentley 
Assigned To 
SeveritymajorReproducibilityalways 
StatusacknowledgedResolutionopen 
PlatformPowerPCOSOpenBSDOS Version
Product Version 
Target VersionFixed in Version 
Summary0002469: Endianness issues in libnsfb and netsurf-fb
DescriptionWhen netsurf-fb is run on OpenBSD/macppc (big-endian), colors don't show up correctly.

There appear to be two problems.

First, there's an issue with all pixels showing up as the wrong color, giving the whole browser a yellowish tinge. This shows up on -b 24 and -b 32.

Second, there's an issue with just images. All graphics in webpages, and all framebuffer bitmaps including mouse pointer and toolbar buttons, have incorrect colors. This shows up on -b 8 and -b 16.
TagsNo tags attached.
Fixed in CI build #
Reported in CI build #
URL of problem page
Attached Files

-Relationships
+Relationships

-Notes
Anthony J. Bentley

~0001453

Anthony J. Bentley (reporter)

Since these are clearly two separate issues, I'm keeping the "yellow screen"/"-b 24/32" discussion in here and moving the "images"/"-b 8/16" discussion to 0002488.
Artu Jarosik

~0001462

Artu Jarosik (reporter)

I have this working on 68k Big Endian Amiga

Add this :

static inline nsfb_colour_t pixel_bgra_to_colour_rgba(UNUSED nsfb_t *nsfb, uint32_t pixel)
{

    return (((pixel & 0xFF000000) >> 16 ) |
                ((pixel & 0xFF0000)) |
                ((pixel & 0xFF00) << 16));
}

static bool readrect(nsfb_t *nsfb, nsfb_bbox_t *rect, nsfb_colour_t *buffer)
{
        PLOT_TYPE *pvideo;
        int xloop, yloop;
        int width;

        if (!nsfb_plot_clip_ctx(nsfb, rect)) {
                return true;
        }

        width = rect->x1 - rect->x0;

        pvideo = get_xy_loc(nsfb, rect->x0, rect->y0);

        for (yloop = rect->y0; yloop < rect->y1; yloop += 1) {
                for (xloop = 0; xloop < width; xloop++) {
#ifdef __BIG_ENDIAN_BGRA__
    if (Bpp == 32)
                        *buffer = pixel_bgra_to_colour_rgba(nsfb, *(pvideo + xloop));
    else if (Bpp == 16)
                        *buffer = pixel_be_to_colour(nsfb, *(pvideo + xloop));
        else
                        *buffer = pixel_to_colour(nsfb, *(pvideo + xloop));
#else
                        *buffer = pixel_to_colour(nsfb, *(pvideo + xloop));
#endif
                        buffer++;
                }
                pvideo += PLOT_LINELEN(nsfb->linelen);
        }
        return true;
}
+Notes

-Issue History
Date Modified Username Field Change
2016-09-12 07:39 Anthony J. Bentley New Issue
2016-09-12 07:39 Anthony J. Bentley File Added: fb-8-16.png
2016-09-12 07:39 Anthony J. Bentley File Added: fb-24-32.png
2016-12-04 03:59 Anthony J. Bentley Note Added: 0001453
2016-12-26 10:04 Artu Jarosik Note Added: 0001462
2016-12-31 11:59 Vincent Sanders Status new => acknowledged
+Issue History