Rockbox

Tasklist

FS#2972 - Proof of concept backdrop image

Attached to Project: Rockbox
Opened by Linus Nielsen Feltzing (linusnielsen) - Wednesday, 01 February 2006, 13:09 GMT
Last edited by Linus Nielsen Feltzing (linusnielsen) - Monday, 20 February 2006, 08:54 GMT
Task Type Patches
Category LCD
Status Closed
Assigned To No-one
Operating System
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 0%
Votes 0
Private No

Details

Proof of concept patch for a backdrop image in the
color LCD driver. It's dog slow, but there is plenty of
room for optimization.
This task depends upon

Closed by  Linus Nielsen Feltzing (linusnielsen)
Monday, 20 February 2006, 08:54 GMT
Reason for closing:  Out of Date
Comment by Dave Chapman (linuxstb) - Wednesday, 01 February 2006, 23:09 GMT

Here is a second attempt, which carries on the work in the
first patch.

The idea is to move the lcd_backdrop[] array out of the lcd
driver itself, and to introduce a new function
lcd_set_backdrop() which passes a pointer to the backdrop
image. The LCD driver doesn't copy the data, it just keeps
track of this pointer.

If the backdrop pointer is NULL, then the lcd driver will
revert to using the bg_pattern value for a solid background.
This is implemented by having two arrays of pixelfuncs -
one for backdrop image drawing, and one for bg color drawing.

The WPS code has been extended to add a %X|backdrop.bmp| tag
to allow a WPS to set the backdrop.

In addition, core Rockbox (in apps/main.c) sets a global
backdrop that is used as the background in the menu and file
browser. As a proof-of-concept, this image is initialised
with a gradient-fill.

The (unimplemented) intention is that this image can be
configured by the user - by selecting a full-screen bmp file
in the file browser. We will also need a menu option to
clear the background image.

I'm not familiar with the wps code, so please forgive that
part of the patch.
Comment by Dave Chapman (linuxstb) - Wednesday, 01 February 2006, 23:12 GMT

Forgotten attachment to previous comment.
Comment by Dave Chapman (linuxstb) - Wednesday, 01 February 2006, 23:42 GMT

Attached patch (backdrop-try3.diff) contains an optimisation
to lcd-16bit.c to pre-calculate the difference between the
addresses of the framebuffer and the backdrop buffer. This
speeds up the clearimgpixel() function.
Comment by Christi Scarborough (christi-s) - Wednesday, 01 February 2006, 23:46 GMT

WPS backgrounds should be sourced by default from
.rockbox/backgrounds to prevent unnecessary duplication. I
think it may be preferable to have WPS background as a
configuation option rather than a WPS file directive, since
this allows it to be specified in themes and gives more
flexibility to the end user since they can substitute their
own background without having to rewrite a WPS.
Comment by Dave Chapman (linuxstb) - Thursday, 02 February 2006, 01:56 GMT

Version 4 - this adds the ability for the user to select a
.bmp file to be used as the main Rockbox backdrop. This is
added as a "Set as backdrop" option on onplay menu in the
file browser.

This bitmap (like the other backdrop images) must be exactly
the same size as the LCD.

The backdrop filename is not yet saved in the settings, so
it's lost on reboot.
Comment by Dave Chapman (linuxstb) - Thursday, 02 February 2006, 02:46 GMT

Version 4b - I forgot to include apps/plugin.c in the diff.
Comment by Dave Chapman (linuxstb) - Thursday, 02 February 2006, 19:14 GMT

Version 5:

* move the backdrop functions (and static arrays) into
recorder/backdrop.[ch]
* create a new .rockbox/backdrops/ directory, which is used
as the path to save a backdrop image filename in the config
sector.
* add a "Clear backdrop" option to the LCD settings menu to
clear the current backdrop and revert back to the bg color.

Loading...