Contents |
Currently uses a 32-bit off-screen render area (as Cairo requires it), then blits to the 16-bit window bitmap, which seems quite slow. Maybe we can force using graphics.library on 16-bit screenmodes (with friend bitmap as offscreen render area)? No, that doesn't work as the alpha channel is then lost on images. Going back to direct-to-screen (with all the headaches that entails) might end up being the only solution here (see below).
Currently we block the user from selecting an 8-bit screenmode for NetSurf's own screen, but the user can open on another 8-bit public screen. As above, plotting occurs to an off-screen 32-bit bitmap and is blitted to the (8-bit in this case) window.
Option 1 to try: Might be as easy as specifying BLITA_CLUT with the current screen's palette. However, even blitting down to 16-bit is slow so might not be good from a performance POV. This doesn't work - BLITA_CLUT appears to have no effect for a destination 8-bit bitmap attached to a window rastport.
Option 2: Use FindColor() and force graphics.library plotting. May be an issue with bitmaps, should be able to resample using datatypes.library but this is all extra processing. If we're on an 8-bit screenmode we probably aren't going to be running on anything particulary fast! Might be able to cheat by only using the new DataTypes image content handler, which will dither images down for us if not PMODE_V43. We can keep them in native format and just blit to the screen.
Please see http://www.amiga.org/forums/showthread.php?t=56813 and http://amigaworld.net/modules/newbb/viewtopic.php?topic_id=34237&forum=27 for various discussion around this topic.
This is roughly what needs to be modified to get the OS4 frontend to work on OS3.9:
Font code uses the new-style diskfont.library bullet interface. It either needs to be tweaked to be the old one and the BltBitMapTags call avoided (the latter might be more difficult than the former), or changed entirely to use ttfengine.library or freetype2. I have some old code for ttfengine lying around which needs fixing up but did generally work at some point in the past.
utri007 on amiga.org notes that avoiding outline fonts will speed up NetSurf on old hardware. Chris' comments: Doable, but won't look pretty due to ambiguous sizing of text on web pages - you're looking at scaled bitmap fonts for the most part (or a lot of different sized bitmaps converted from a TrueType/CG font). You'll also lose UTF-8 character support (text needs to be converted to local charset and printed with Text())
If you delve way back into SVN there is a font.c set up exactly like this. It's probably best as a user option (fast+ugly, slow+pretty)
P96 needs to be ripped out/avoided if either (a) P96 is not available or (b) a <= 8-bit screenmode is in use. This is further-reaching than the plotters code - the aforementioned font code expects 32-bit and the bitmaps are all in 32-bit too, so dithering and pen allocation needs to be done. (note this is something which needs to be done for OS4 too; currently NetSurf OS4 won't display properly on 8-bit screenmodes) (see also plotters section above)
The already-mentioned tweaks to remove new Reaction features (WINDOW_NewMenu needs replacing with CreateMenus/LayoutMenus etc; the vertical scrollbar is attached using a new feature; the horizontal one uses new scrollergclass).
Functions need #ifdef'ing with ASM headers.
Littered throughout the code are new calls for allocating memory, resources, interfaces, etc - this all needs backporting. application.library stuff should automagically disable (will still need #ifdefing though), no_drag_icons will need to default to 1 for OS3 (I think it does anyway).