summaryrefslogtreecommitdiffstats
path: root/firmware/export/lcd.h
AgeCommit message (Collapse)AuthorFilesLines
2022-04-17viewports, set flags to VP_DEFAULT_FLAGSWilliam Wilgus1-0/+2
flags were getting un-initialized memory it really didn't matter with the flags getting initialized anyway But once I added a new flag that didn't explicitly set or clear the flag at init well here we are set flags to VP_DEFAULT_FLAGS in viewport_set_defaults() add the flags variable to the default vp's set to 0 (it was already initialized to 0 by bss, make it explicit) Change-Id: I3a9a062455b4cf66d2b8c70fdf05402a5c0c091c
2022-04-15viewports add flag to disable updatesWilliam Wilgus1-2/+3
when drwing multiple areas of the screen with other gui elements you might want to combine updates into a single screen redraw Change-Id: Ie4130366fa13e25d3d14e937257d11547dd61134
2022-03-21Lcd save function pointer to frame buffer get_address_fn before loopsWilliam Wilgus1-1/+3
Calling multiple levels of indirection in a loop slows things down Really these need to be rewritten to take a start and end address like most of the rest of the codebase But this is safer without having test hardware in hand Change-Id: Idae7b92ee779d020ed7fcc9334e2d5a9c710e64d
2021-03-25Revert "lcd framebuffer - Bugfix #2 ensure proper alignment"William Wilgus1-2/+1
This reverts commit 3a5c5edbf6cb3ac5e4b65fe036ca50b41fabaa89. Reason for revert:pulling in system.h breaks SDL :( Change-Id: Ied5e08de4770aa0da87c14b304480448db349423
2021-03-25lcd framebuffer - Bugfix #2 ensure proper alignmentWilliam Wilgus1-1/+2
-- apparenty 0x4 aligned doesn't work properly requires 0x8 alignment at least for the h10 20gb but enabled for all processors that define MEM_ALIGN_ATTR Change-Id: I11edaab183b91a6d158f1f439f173b9b699dc914
2020-10-31lcd_framebuffer bugfixes, sanity checksWilliam Wilgus1-7/+7
several issues I saw that could pontentially cause problems scroll engine doesn't take text height into account when checking bounds NBELEMS was one whole row too large hopefully I got them right this time Change-Id: If303da8320429c3964fc675351cb088d46303745
2020-10-26Whitespace cleanup on fb_viewport RewriteWilliam Wilgus1-3/+3
Change-Id: I24aac41c8abecf7b78a44d7f59e842b791be4563
2020-10-26LCD core move buf ptr and address look up function viewport structWilliam Wilgus1-101/+170
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
2020-10-26make the plugin API frambuffer agnosticMoshe Piekarski1-2/+1
Change-Id: I5abdc231093054c517ff53b9a456997e440e3f6e
2020-07-24[4/4] Remove HAVE_LCD_BITMAP, as it's now the only choice.Solomon Peachy1-11/+0
Note: I left behind lcd_bitmap in features.txt, because removing it would require considerable work in the manual and the translations. Change-Id: Ia8ca7761f610d9332a0d22a7d189775fb15ec88a
2020-07-24[2/4] get rid of HAVE_LCD_CHARCELLSSolomon Peachy1-40/+0
HAVE_LCD_BITMAP is now redundant. lcd_bitmap is always-on in features.txt so manual and lang strings don't have to change Change-Id: I08eeb20de48099ffc2dc23782711af368c2ec794
2018-06-12Add XRGB8888 native formatMarcin Bukat1-1/+8
This got lost somehow during Agptek port merge Change-Id: Ie84463ba523d2307466b49354867117e7393a440
2014-06-21lcd-24bit: Introduce a 24-bit mid-level LCD driverThomas Martitz1-1/+84
With LCD driver all calculation will be performed on RGB888 and the hardware/OS can display from our 24bit framebuffer. It is not yet as performance optimized as the existing drivers but should be good enough.The vast number of small changes is due to the fact that fb_data can be a struct type now, while most of the code expected a scalar type. lcd-as-memframe ASM code does not work with 24bit currently so the with 24bit it enforces the generic C code. All plugins are ported over. Except for rockpaint. It uses so much memory that it wouldnt fit into the 512k plugin buffer anymore (patches welcome). Change-Id: Ibb1964545028ce0d8ff9833ccc3ab66be3ee0754
2014-03-03Touchscreen: Show a line separator in lists.Thomas Martitz1-1/+0
This patch adds a configurable line separator between list items, very similar to lists in Android. Additionally, below the list item there is a thicker line. It can be disabled in the settings. Its color can be configured as well. Remote and monochrome displays are explicitly unsupported. If there is desire this can be changed but it doesn't seem useful to me. Change-Id: I005313b0d8f5ecd15864bf20e66ea4e3390d8b7d
2014-03-03Implement lcd_get_dpi() for all bitmap targets.Thomas Martitz1-8/+3
DPI values are autogenerated from the resolution and collected display size values. These values are inserted as comments as well. Change-Id: Id03aedf9af18348f773dfce002805e480f6751e8
2014-01-12put_line/scrolling: Make the scroll engine inform custom scrollers about ↵Thomas Martitz1-2/+2
start/stop of scrolling. With the new lcd_putsxy_scroll_func() code can register custom scroll functions (put_line() makes use of that). In order for the custom scroller to be able to properly manage its userdata pointer (set via struct scrollinfo::userdata) the scroll engine must inform the scroller about start and stop of scrolling. To inform about start the lcd_scroll_* functions now return true when the line will scroll. To inform about stop the scroll engine calls into the scroller one last time, with the text set to NULL. put_line() can use this to release the userdata registered per scrolling line so that it can be recycled. This fixes that some scrolling lines became glitchy after some time because the userdata was recycled too early. Change-Id: Iff0a6ce2a4f9ae2bada1b8e62f4f5950224942a9
2014-01-07Fix Player red and icons on mono displays.Thomas Martitz1-8/+9
Change-Id: Ib8adcb4c70f2dd3ddd25da8f0606f48926dfd89e
2014-01-07lcd/grey: Enable viewport fg_pattern and bg_pattern for all bitmap targets.Thomas Martitz1-2/+1
Greylib performed a horrible hack and stored fg and bg patterns in other struct viewport fields. One of them was just removed. So instead of this hack simply enable the *_pattern fields for mono targets as well, so that greylib can use them normally. Change-Id: Ib0842ebcc97f5bf9d9382b4471903afa2f96f39f
2014-01-07lcd-16bit: Remove {lss,lse,lst}_pattern fields from struct viewport.Thomas Martitz1-5/+0
These where used for line styling during scrolling, which is now done in apps/, The viewport struct doesn't need to record these anymore. Change-Id: I810d9dcb2644b00a798c6e75acab69c74a78e77f
2014-01-07lcd-common: Remove direct style (line decorations) from lcd-puts* functions.Thomas Martitz1-21/+0
This logic is moved into apps (put_line()) which can better handle line decorations with respect to scrolling, mulitline and other complications. Firmware doesn't need this. The remaining drawing function know only one style, that is foreground on background/backdrop (changing drawmode is still supported). Change-Id: I707060edc388a7d723a7d09b0cf5cbda6ec56708
2014-01-07lcd-common: Remove support for custom line heights from viewport.Thomas Martitz1-1/+0
Since scrolling is now pixel-based this is not necessary anymore. custom line height is handled by put_line() but can also possible to implement with lcd_puts_scroll_func(). Change-Id: Iee9b12bf99afac93d95d2a1a6f5d5b4db237b21c
2014-01-07lcd-common/scroll_engine: Remove unused functions lcd_puts_style_xyoffset() ↵Thomas Martitz1-5/+0
and lcd_puts_scroll_style_xyoffset(). With this functions removed there is no exported function in firmware left that draws line decorations. Also no function supports specifying an y-offset anymore (was used for pixel accurate positioning of otherwise strictly line-based API calls). Both should be handled in apps/ now. Change-Id: Iba4b28ccc6e686c7db63e34b51ad4badae983fce
2014-01-07lcd-common/scroll_engine: Remove unused functions lcd_puts_scroll_style().Thomas Martitz1-2/+0
Change-Id: Ia4f943b3738ab6e66b0e3f1507c629b36d7eba94
2014-01-07lcd-common: Remove unused function lcd_puts_style_offset().Thomas Martitz1-2/+0
Change-Id: I24da23d132f933fe647416dc58e8f50879715423
2014-01-07lcd-common: Remove unused function lcd_puts_style().Thomas Martitz1-1/+0
Change-Id: Id2c64c116f79b8e61a7af49b9072b3e884ffb455
2014-01-07lcd-common: Remove unused function lcd_puts_offset().Thomas Martitz1-1/+0
Change-Id: I39749bf3db915e5a8ddb6e6f25eb201ea0aaf981
2014-01-07lcd-common/scroll_engine: Remove unused functions lcd_puts_scroll_offset() ↵Thomas Martitz1-4/+0
and lcd_puts_scroll_style_offset(). Change-Id: Ia84ae88020d06a1cb634942ab5e635fd5d10ac66
2014-01-07lcd-16bit: Introduce lcd_gradient_fillrect_part().Thomas Martitz1-0/+2
It is similar to lcd_gradient_fillrect(), except that it only draws a part of the complete gradient. This can be used to draw only the bottom half of a full gradient. Change-Id: Ib47cc5237f6966e35ba07988bddbb00fd97adf96
2014-01-07lcd-common/scroll_engine: Introduce lcd_putsxy_scroll_func().Thomas Martitz1-0/+5
This function supports installing a custom scroll callback. This will be called when the scrollengine redraws the line. It allows to draw extended styles (or anything your can possible imagine) along with the text. It is also strictly pixel-based, the first pixel-based function that supports scrolling. Change-Id: I57f81ac7b3d08b877aea4cb8afa882f175ebcdfc
2014-01-05lcd: Fix certain drawmode combinations.Thomas Martitz1-1/+2
Some seldomly used drawmode combinations did not work in conjunction with alpha bitmaps and backdrops. Now all should work (see comment added) by using more bits. Change-Id: I2bc96ecf471fa8c1a608a321a235b9c8527b3dc5
2013-12-15Fix reds. Also apply the new scrolling to lcd charcell (this even uncovered anThomas Martitz1-1/+1
error). Change-Id: I29243bb36b6cec1471bd6c0afc64e00547a68c50
2013-12-14scroll_engine: Add STYLE_NONE to allow for drawing lines without styling.Thomas Martitz1-6/+7
This allows to draw lines without destroying styles that were drawn manually (e.g. from apps/) beforehand. Change-Id: I0de290c9343061efb115e1b76da5b76395c2b2af
2013-12-14scroll_engine: Rename scroll_stop* functions to be more consistent with the ↵Thomas Martitz1-4/+0
lcd api. Change-Id: I8ada10b96bfb628cca0331689e8b936ae47c7e1c
2013-02-12bitmap drawing: Use extra bit in mask to avoid nested if() in switch-cases.Thomas Martitz1-0/+2
Speeds up alpha bitmap drawing by up to 10%. mono bitmap drawing is also a tiny bit faster. Change-Id: I5a9379740c1a0091de9c621aabbe57d767ce2905
2012-12-099 segment bitmap drawing:Jonathan Gordon1-0/+2
Use %x9(id) to draw an image in the whole current viewport using the 9 segment drawer (which draws the corners as normal and *tiles* the middle segments to the needed width/height). Future work is to make it scale instead of tile Change-Id: Ic3ed1cad93f96091694801eb442e0da5a2401203
2012-03-01lcd drivers: split lcd_gradient_rect so it is actually usefulJonathan Gordon1-0/+2
lcd_gradient_rect() was only usable to draw list lines, so split it up and make a generic gradient draw function available to apps/ Change-Id: I665911a90fef239b5e06592ea2763cbeeb74c83f
2012-02-28lcd/skin_engine: Add the ability to draw onto the backdrop layerJonathan Gordon1-0/+1
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
2012-02-28lcd drivers: Convert lcd_[remote_]framebuffer to a pointerJonathan Gordon1-1/+8
Change all lcd drivers to using a pointer to the static framebuffer instead of directly accessing the static array. This will let us later do fun things like dynamic framebuffer sizes (RaaA) or ability to use different buffers for different layers (dynamic skin backdrops!) Change-Id: I0a4d58a9d7b55e6c932131b929e5d4c9f9414b06
2011-12-16Oops. Left some bits I didn't want to keep.Michael Sevakis1-9/+0
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31336 a1c6a512-1295-4272-9138-f99709370657
2011-12-16Convert remaining memframe LCDs that can be convert to common code.Michael Sevakis1-0/+9
Massage the way it interfaces a bit to make things more flexible. The chroma_buf scheme on Sansa Connect and Creative ZVx calling the lcd_write_yuv420_lines implementation in lcd-as-memframe.S with five params with a chroma buffer that the function can't use wouldn't work anyway so just have them use the stock implementation (really, how was that working?). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31335 a1c6a512-1295-4272-9138-f99709370657
2011-12-14Fix FS#12237 (caused by r30302) where centered skin text isnt eqactly centeredJonathan Gordon1-0/+5
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31246 a1c6a512-1295-4272-9138-f99709370657
2011-11-08Fix build errors and warnings in the lcd drivers.Thomas Martitz1-4/+3
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30940 a1c6a512-1295-4272-9138-f99709370657
2011-11-08Support for transparency in 32bit bitmaps on color targets.Thomas Martitz1-0/+3
This uses the alpha blending capabilities introduced with anti-aliased fonts to draw bitmaps with transparency information. The bmp loader is extended to read this information (pass FORMAT_TRANSPARENT in format). The alpha information will be used when drawing the bitmap. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30937 a1c6a512-1295-4272-9138-f99709370657
2011-11-08Add new lcd_bmp and lcd_bmp_part APIs.Thomas Martitz1-0/+3
This new APIs wrap around lcd_[mono|transparent]_bitmap/_part calls and handle all kinds bitmaps. The intended use is to draw bitmaps that come from read_bmp_fd/_file. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30936 a1c6a512-1295-4272-9138-f99709370657
2011-10-29Better fix for FS#12337. Use 0 to make the line height calculated from the ↵Thomas Martitz1-1/+1
font height, as before r30773. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30850 a1c6a512-1295-4272-9138-f99709370657
2011-10-17- Fix some reds by implementing lcd_get_dpi().Thomas Martitz1-1/+5
- Use the list item centering capabilities in the plugin lib - Bump plugin ABI for the changed viewport struct (sort the API too). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30775 a1c6a512-1295-4272-9138-f99709370657
2011-10-17Commit FS#12321 - Touchscreen: List line padding, to more easily select linesThomas Martitz1-0/+1
This adds line padding to lists on touchscreens, in order to make lists reasonably useful without huge fonts. It's configurable: * Automatic (default, line height calculated using a lcd dpi aware function) * Off (status quo, line height = font height) * X pixels (from 2 to 50 in even steps) The automatic setting should/aims to Just Work Out Of The Box on all targets git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30773 a1c6a512-1295-4272-9138-f99709370657
2010-11-10Touchscreen: Improved scroll thresholdThomas Martitz1-0/+10
Remove the hardcoded (and way too small) scroll threshold (the distance moved in pixels before we think the users wants to scroll) and replace it with something based on the actual DPI of the screen. On Android we call the API for that, on other touchscreens we reimplemented Android's formula (as of 2.2) and calculate it. Flyspray: 11727 git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28548 a1c6a512-1295-4272-9138-f99709370657
2010-10-11Rename {draw,fill}_viewport once more (to draw_border_viewport and ↵Thomas Martitz1-2/+2
fill_viewport) and remove the viewport parameter as suggested by Dave Chapman. The parameter wasn't used yet and it's not clear whether it should be a absolute or relative viewport. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28242 a1c6a512-1295-4272-9138-f99709370657
2010-10-10Add _rect to {draw,fill}_viewport as suggested by Jonathan Gordon to reduce ↵Thomas Martitz1-2/+2
the chance to confuse it with update_viewport(). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28240 a1c6a512-1295-4272-9138-f99709370657