summaryrefslogtreecommitdiffstats
path: root/apps/gui/skin_engine/skin_backdrops.c
AgeCommit message (Collapse)AuthorFilesLines
2023-01-13Remove buflib allocation names, part twoAidan MacDonald1-3/+2
Remove allocation names from the buflib API and fix up all callers. Change-Id: I3df922e258d5f0d711d70e72b56b4ed634fb0f5a
2022-11-14replace strlcpy with strmemccpyWilliam Wilgus1-1/+1
replace applicable calls to strlcpy with calls to strmemccpy which null terminates on truncation in theory the strmemccpy calls should be slightly faster since they don't traverse the rest of the source string on truncation but I seriously doubt there is too much of that going on in the code base Change-Id: Ia0251514e36a6242bbf3f03c5e0df123aba60ed2
2022-10-16Convert a number of allocations to use buflib pinningAidan MacDonald1-8/+6
Several places in the codebase implemented an ad-hoc form of pinning; they can be converted to use buflib pinning instead. Change-Id: I4450be007e80f6c9cc9f56c2929fa4b9b85ebff3
2022-10-15move buflib_free invalid handle check to the functionWilliam Wilgus1-2/+1
allow buflib_free to check for invalid or already freed handles within the function -- remove all the invalid handle guards thru core_free Change-Id: Ibdcbc82760fc93b674c42283fca420d94907df8e
2022-03-15skin_engine.c settings_apply_skins cleanupWilliam Wilgus1-2/+16
just some cleanup and removal of ifdefs in favor of dummy functions Change-Id: I03a1d351344afcc428dedb67aab915184f99bd23
2020-10-28Fix display regression from c85d8e2William Wilgus1-2/+9
Basically setting a null buffer is valid but it must be selected into a screen to initialize to the default buffer I wrongly assumed screen type wouldn't matter but since I decided to reference backdrops directly to the default buffer (since they are saved as an offset from what it later assumes to be the default framebuffer) SCREEN_MAIN/SCREEN_REMOTE are not longer optional Change-Id: I8a8afbbe1e3ed0bfe6abd40ce287638e9fc6da60
2020-10-28Framebuffer_viewport Rewrite -- BUG FIXWilliam Wilgus1-1/+3
stride was not initialized for the skin_viewport fixed a few other questionable areas Change-Id: I9cc7830a4406857bf3aba26a328c288e3702cddd
2020-10-26LCD core move buf ptr and address look up function viewport structWilliam Wilgus1-4/+21
I'm currently running up against the limitations of the lcd_draw functions I want these functions to be able to be used on any size buffer not just buffers with a stride matching the underlying device [DONE] allow the framebuffer to be decoupled from the device framebuffer [DONE need examples] allow for some simple blit like transformations [DONE] remove the device framebuffer from the plugin api [DONE}ditto remote framebuffer [DONE] remove _viewport_get_framebuffer you can call struct *vp = lcd_set_viewport(NULL) and vp->buffer->fb_ptr while remote lcds may compile (and work in the sim) its not been tested on targets [FIXED] backdrops need work to be screen agnostic [FIXED] screen statusbar is not being combined into the main viewport correctly yet [FIXED] screen elements are displayed incorrectly after switch to void* [FIXED] core didn't restore proper viewport on splash etc. [NEEDS TESTING] remote lcd garbled data [FIXED] osd lib garbled screen on bmp_part [FIXED] grey_set_vp needs to return old viewport like lcd_set_viewport [FIXED] Viewport update now handles viewports with differing buffers/strides by copying to the main buffer [FIXED] splash on top of WPS leaves old framebuffer data (doesn't redraw) [UPDATE] refined this a bit more to have clear_viewport set the clean bit and have skin_render do its own screen clear scrolling viewports no longer trigger wps refresh also fixed a bug where guisyncyesno was displaying and then disappearing [ADDED!] New LCD macros that allow you to create properly size frame buffers in you desired size without wasting bytes (LCD_ and LCD_REMOTE_) LCD_STRIDE(w, h) same as STRIDE_MAIN LCD_FBSTRIDE(w, h) returns target specific stride for a buffer W x H LCD_NBELEMS(w, h) returns the number of fb_data sized elemenst needed for a buffer W x H LCD_NATIVE_STRIDE(s) conversion between rockbox native vertical and lcd native stride (2bitH) test_viewports.c has an example of usage [FIXED!!] 2bit targets don't respect non-native strides [FIXED] Few define snags Change-Id: I0d04c3834e464eca84a5a715743a297a0cefd0af
2014-12-20Fix broken buflib_handle check in backdrop settings loaderThomas Jarosch1-1/+1
The logic was messed up and always evaluated to true if buflib_handle is non-zero. Thanks to JdGordon for verifying the change. cppcheck reported: [rockbox/apps/gui/skin_engine/skin_backdrops.c:262]: (warning) Comparison of a boolean expression with an integer other than 0 or 1. Change-Id: Ib52a73e0a6a2017a631e2dec19b638a2974dab83
2014-01-22skin_engine/backdrops: Have to reload default backdrops from setting when it ↵Thomas Martitz1-2/+2
changed. When skins use the default backdrop (via %X(-) or no %X at all) and the setting changes it needs to be reloaded, otherwise when changing themes the new theme could show the backdrop from the previous theme. The same needs to be done when re-selecting the same theme after USB because the backdrop file was potentially overwritten. Fixes FS#12892 and FS#12942. Change-Id: Ic2d20740cc385fa99667ce8a71507dbda2efceaf
2013-02-12skin_engine: Add a debug screen to display skin ram usageJonathan Gordon1-0/+19
Change-Id: Ida9c33211d9360ac88e30a2cf8df9f191bee8b45
2012-06-10Fix checks on buflib allocated handles (0 is not a valid handle value)Bertrik Sikken1-1/+1
Change-Id: I8fdc5a59a5062f40a431cd49971390e21631b8ec
2012-05-02Use buflib for the allocation of voice PCM resources.Michael Sevakis1-1/+1
Buffers are not allocated and thread is not created until the first call where voice is required. Adds a different callback (sync_callback) to buflib so that other sorts of synchonization are possible, such as briefly locking-out the PCM callback for a buffer move. It's sort of a messy addition but it is needed so voice decoding won't have to be stopped when its buffer is moved. Change-Id: I4d4d8c35eed5dd15fb7ee7df9323af3d036e92b3
2012-02-28lcd/skin_engine: Add the ability to draw onto the backdrop layerJonathan Gordon1-7/+27
The framebuffer the lcd driver uses can now be changed on the fly which means that regular lcd_* drawing functions can draw onto the "backdrop" buffer. The skin engine can use this to create layered effects. Add the tag %VB to a viewport to draw that viewport onto the backdrop layer. If you want to draw an image onto the backdrop framebuffer use %x(backdrop filename) instead of %X() inside a viewport with %VB. Change-Id: I741498e2af6d4f2d78932cabe8942317893e7cfc
2011-11-27slightly reaarange code to make fml happy :)Jonathan Gordon1-1/+1
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31071 a1c6a512-1295-4272-9138-f99709370657
2011-11-27Free a handle when we try to load a backdrop file which doesnt exist or cant ↵Jonathan Gordon1-0/+4
be loaded git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31070 a1c6a512-1295-4272-9138-f99709370657
2011-11-21skinengine: Rework skin loading so skins can be un/loaded individually. This ↵Jonathan Gordon1-22/+34
also means that loading a .cfg which doesnt change themes shouldnt have them reloaded git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31037 a1c6a512-1295-4272-9138-f99709370657
2011-11-19Get rid of a really annoying #ifdef line to check if backdrop support should ↵Jonathan Gordon1-2/+1
be enabled git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31027 a1c6a512-1295-4272-9138-f99709370657
2011-10-28Fix FS#12357 - New backdrop not displayed after set backdrop from context menuThomas Martitz1-9/+10
The loaded flag wasn't set and skin_backdrop_show() call was missing. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30846 a1c6a512-1295-4272-9138-f99709370657
2011-10-15Changed the FOR_NB_SCREENS macro to always be a for loop that declares its ↵Björn Stenberg1-5/+2
own loop variable. This removes the need to declare this variable in the outer scope. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30756 a1c6a512-1295-4272-9138-f99709370657
2011-09-13Make sure to set the current lcd backdrop id so the buflib move callback can ↵Jonathan Gordon1-0/+4
reset the correct backdrop git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30515 a1c6a512-1295-4272-9138-f99709370657
2011-09-08make some stuff staticJonathan Gordon1-3/+3
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30477 a1c6a512-1295-4272-9138-f99709370657
2011-09-08fix checkwpsJonathan Gordon1-2/+16
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30476 a1c6a512-1295-4272-9138-f99709370657
2011-09-08Use buflib for the skin backdrop images potentially allowing multiple images ↵Jonathan Gordon1-12/+63
per skin in the future git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30475 a1c6a512-1295-4272-9138-f99709370657
2011-04-10Support loading backdrops from anywhere in the filesystem. Fixes FS#12041Frank Gevaerts1-9/+5
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29700 a1c6a512-1295-4272-9138-f99709370657
2010-12-06Get rid of get_user_file_path and do the path handling in wrappers for ↵Thomas Martitz1-10/+4
open() and friends. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28752 a1c6a512-1295-4272-9138-f99709370657
2010-10-18Don't try to show a backdrop if the bmp wasnt loaded successfullyJonathan Gordon1-6/+10
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28303 a1c6a512-1295-4272-9138-f99709370657
2010-09-19Hopefully fix FS#11630 where the wps backdrop would be shown instead of the ↵Jonathan Gordon1-8/+9
menu one git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28116 a1c6a512-1295-4272-9138-f99709370657
2010-09-14Another major skin backend update/hopefully bugfix:Jonathan Gordon1-44/+120
Skins are now more self contained in the skin manager which in the future might allow on demand skin loading (i.e smaller skin buffers) Skin backdrops are also managed more intelegently (fixes a bug where you can get a crazy backdrop loaded if a .sbs fails to load) the rockbox_default rescue theme is now called rockbox_failsafe to better express what it actually is. This commit hopefully/maybe fixes the heavily reported data aborts, so please check if you are getting them git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28073 a1c6a512-1295-4272-9138-f99709370657
2010-08-13Fix backdrops from sbs not being loaded correctly (caused by r27791).Thomas Martitz1-3/+4
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27802 a1c6a512-1295-4272-9138-f99709370657
2010-08-12Backdrop dir needs to go through get_user_file_path()Thomas Martitz1-2/+4
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27791 a1c6a512-1295-4272-9138-f99709370657
2010-07-29FS#11470 - new skin code, finally svn uses the new parser from the theme ↵Jonathan Gordon1-2/+2
editor. This means that a skin that passes the editor WILL pass svn and checkwps (unless the target runs out of skin buffer or something. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27613 a1c6a512-1295-4272-9138-f99709370657
2010-06-03Correct reusing buffers if the backdrop file is already loaded.Teruaki Kawashima1-3/+3
FS#11305 by myself. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26510 a1c6a512-1295-4272-9138-f99709370657
2010-05-06Move c/h files implementing/defining standard library stuff into a new libc ↵Thomas Martitz1-2/+1
directory, also standard'ify some parts of the code base (almost entirely #include fixes). This is to a) to cleanup firmware/common and firmware/include a bit, but also b) for Rockbox as an application which should use the host system's c library and headers, separating makes it easy to exclude our files from the build. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25850 a1c6a512-1295-4272-9138-f99709370657
2010-03-06skin: don't calculate id3->elapsed+state->ff_rewind_count each time. remove ↵Teruaki Kawashima1-3/+1
trailing spaces. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25045 a1c6a512-1295-4272-9138-f99709370657
2010-02-27Set missing svn propertiesNils Wallménius1-1/+1
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24947 a1c6a512-1295-4272-9138-f99709370657
2010-02-21Fix the mechanism to fail to parse skins if images fail to load and fix ↵Thomas Martitz1-2/+3
having no backdrop at all (neither %X nor backdrop setting, DancePuffDuo was broken). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24814 a1c6a512-1295-4272-9138-f99709370657
2010-02-16Reuse the backdrop buffers if 2 skins use the same backdrop (on the same ↵Jonathan Gordon1-0/+119
screen of course) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24690 a1c6a512-1295-4272-9138-f99709370657