• Status Closed
  • Percent Complete
  • Task Type Patches
  • Category LCD
  • Assigned To No-one
  • Operating System
  • Severity Low
  • Priority Very Low
  • Reported Version
  • Due in Version Undecided
  • Due Date Undecided
  • Votes
  • Private
Attached to Project: Rockbox
Opened by linusnielsen - 2006-02-01
Last edited by linusnielsen - 2006-02-20

FS#2972 - Proof of concept backdrop image

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.

Closed by  linusnielsen
2006-02-20 08:54
Reason for closing:  Out of Date

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.

Forgotten attachment to previous comment.

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.

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.

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.

Version 4b - I forgot to include apps/plugin.c in the diff.

Version 5:

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


Available keyboard shortcuts


Task Details

Task Editing