MantisBT - NetSurf
View Issue Details
0002488NetSurfFramebuffer-specificpublic2016-12-04 03:532019-05-06 13:16
ReporterAnthony J. Bentley 
Assigned To 
PrioritynormalSeveritymajorReproducibilityalways
StatusconfirmedResolutionopen 
PlatformPowerPCOSOpenBSDOS Version
Product Version 
Target VersionFixed in Version 
Fixed in CI build #
Reported in CI build #
URL of problem page
Summary0002488: Framebuffer bad endianness when loading images
DescriptionWhen "netsurf-fb -b 8" or "netsurf-fb -b 16" is run on OpenBSD/macppc (big-endian), images are not displayed properly.

All graphics in webpages, and all framebuffer bitmaps including mouse pointer and toolbar buttons, have incorrect colors. (fb-8-16.png)

The problem is partly due to some casts of pixdata from uint8_t[] to uint32_t*:

frontends/framebuffer/fbtk/fbtk.c:fbtk_set_ptr()
frontends/framebuffer/fbtk/bitmap.c:fb_redraw_bitmap()
frontends/framebuffer/framebuffer.c:framebuffer_set_cursor()

Naively putting a byteswap in libnsfb's plotting (naive-byteswap.diff) "fixes" the issue, except it doesn't fix the throbber and it leaves some ghosting after the cursor (fb-8-16-with-naive-byteswap.png).

A better fix is probably to generate uint32_t from the start. This is platform-independent and not very intrusive (better-fix.diff), but only fixes generated/fbtk images, and doesn't help with fetched images (fb-8-16-with-better-fix.png). It's a start, though.
TagsNo tags attached.
Attached Filespng fb-8-16.png (130,366) 2016-12-04 03:53
https://bugs.netsurf-browser.org/mantis/file_download.php?file_id=462&type=bug
png

diff naive-byteswap.diff (1,497) 2016-12-04 03:54
https://bugs.netsurf-browser.org/mantis/file_download.php?file_id=463&type=bug
png fb-8-16-with-naive-byteswap.png (65,222) 2016-12-04 03:55
https://bugs.netsurf-browser.org/mantis/file_download.php?file_id=464&type=bug
png

diff better-fix.diff (1,261) 2016-12-04 03:56
https://bugs.netsurf-browser.org/mantis/file_download.php?file_id=465&type=bug
png fb-8-16-with-better-patch.png (208,814) 2016-12-04 03:58
https://bugs.netsurf-browser.org/mantis/file_download.php?file_id=466&type=bug
png

Notes
(0001467)
Vincent Sanders   
2016-12-31 12:29   
will look at sorting this. currently rummaging around for a big endian system to play with.

Issue History
2016-12-04 03:53Anthony J. BentleyNew Issue
2016-12-04 03:53Anthony J. BentleyFile Added: fb-8-16.png
2016-12-04 03:54Anthony J. BentleyFile Added: naive-byteswap.diff
2016-12-04 03:55Anthony J. BentleyFile Added: fb-8-16-with-naive-byteswap.png
2016-12-04 03:56Anthony J. BentleyFile Added: better-fix.diff
2016-12-04 03:58Anthony J. BentleyFile Added: fb-8-16-with-better-patch.png
2016-12-31 12:29Vincent SandersNote Added: 0001467
2016-12-31 12:29Vincent SandersAssigned To => Vincent Sanders
2016-12-31 12:29Vincent SandersStatusnew => confirmed
2019-05-06 13:16Vincent SandersAssigned ToVincent Sanders =>