summaryrefslogtreecommitdiff
path: root/firmware/drivers/lcd-bitmap-common.c (follow)
Commit message (Collapse)AuthorAge
* put_line/scrolling: Make the scroll engine inform custom scrollers about ↵Thomas Martitz2014-01-12
| | | | | | | | | | | | | | | | | | | | | 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
* scroll engine: Factor out renderer function so it can be called by lcd code.Thomas Martitz2014-01-11
| | | | | | | | | | | This is used by lcd_puts_scroll_worker() to render the line immediately instead of waiting for the next scroll tick when only the text was updated. Previously lcd_puts_scroll_worker() did not render anything in this case which could lead to visible blinking. This fixes blinking scrolling lines with dynamic text in the skin engine. Change-Id: I475bde8c8eb7c92f505e3c5ecf4d32bb90690536
* lcd_nine_segment_bmp: Fixes for non-ideal image dimensions.Thomas Martitz2014-01-09
| | | | | | | | | | | 1) The 9-segment images need not be multiple of 3 pixels anymore. If it isn't the inner segments will be smaller than the corners. 2) If the desired actual images is not a multiple of the segment sizes the function drawed more than the desired rectangle. This is fixed by drawing the last segment only partially. Change-Id: Ic918facd8734fa4a4aa72536f0b67de82d81651e
* lcd-16bit: Move lcd_gradient_fillrect/_part() to lcd-16bit-common.c.Thomas Martitz2014-01-07
| | | | Change-Id: I6b2d2ba73464610556cfd9ecec52fc62adb007c7
* lcd-common: Remove direct style (line decorations) from lcd-puts* functions.Thomas Martitz2014-01-07
| | | | | | | | | | 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
* lcd-common: Remove support for specifying y_offset from lcd_puts* functions.Thomas Martitz2014-01-07
| | | | | | | | This main (and only) purpose for it was to adjust the pixel position of the text in otherwise linebased (scrolling) functions. With pixel-based scrolling this isnt necessary anymore. Change-Id: I2a45b8ca6a3f8f50aa2f6630201b30ce9ddfe043
* lcd-common: Remove support for custom line heights from viewport.Thomas Martitz2014-01-07
| | | | | | | | 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
* lcd-common/scroll_engine: Remove unused functions lcd_puts_style_xyoffset() ↵Thomas Martitz2014-01-07
| | | | | | | | | | | | | 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
* lcd-common/scroll_engine: Remove unused functions lcd_puts_scroll_style().Thomas Martitz2014-01-07
| | | | Change-Id: Ia4f943b3738ab6e66b0e3f1507c629b36d7eba94
* lcd-common: Remove unused function lcd_puts_style_offset().Thomas Martitz2014-01-07
| | | | Change-Id: I24da23d132f933fe647416dc58e8f50879715423
* lcd-common: Remove unused function lcd_puts_style().Thomas Martitz2014-01-07
| | | | Change-Id: Id2c64c116f79b8e61a7af49b9072b3e884ffb455
* lcd-common: Remove unused function lcd_puts_offset().Thomas Martitz2014-01-07
| | | | Change-Id: I39749bf3db915e5a8ddb6e6f25eb201ea0aaf981
* lcd-common/scroll_engine: Remove unused functions lcd_puts_scroll_offset() ↵Thomas Martitz2014-01-07
| | | | | | and lcd_puts_scroll_style_offset(). Change-Id: Ia84ae88020d06a1cb634942ab5e635fd5d10ac66
* lcd-16bit: Introduce lcd_gradient_fillrect_part().Thomas Martitz2014-01-07
| | | | | | | | 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
* lcd-common/scroll_engine: Introduce lcd_putsxy_scroll_func().Thomas Martitz2014-01-07
| | | | | | | | | | | 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
* lcd: Fix scrolling.Thomas Martitz2013-12-23
| | | | Change-Id: I1f8d3d67b224c1c531438b94e3aab640b76770be
* scroll_engine: Major rework to support pixel-based scrolling and scroll ↵Thomas Martitz2013-12-14
| | | | | | | | | | | | | | | | | | | callbacks. Much of the scrolling work is moved from lcd-bitmap-common to lcd-scroll.c, a small scroll callback routine remains. This callback can potentially be overridden by more extensive scrollers. The callback also gets fed with pixel-based scrolling information, which finally removes the strict line-based nature of the scroll engine. Along with this is the change from scroll_stop_viewport_line() to scroll_stop_viewport_rect() which works on a pixel-based rectangle instead of lines. The ultimate goal is to move most of the scroll work to apps, which can much better decide which line decorations to apply etc. This work is laying the ground work. Change-Id: I3b2885cf7d8696ddd9253d5a9a73318d3d42831a
* scroll_engine: Add STYLE_NONE to allow for drawing lines without styling.Thomas Martitz2013-12-14
| | | | | | | This allows to draw lines without destroying styles that were drawn manually (e.g. from apps/) beforehand. Change-Id: I0de290c9343061efb115e1b76da5b76395c2b2af
* scroll_engine: Rename scroll_stop* functions to be more consistent with the ↵Thomas Martitz2013-12-14
| | | | | | lcd api. Change-Id: I8ada10b96bfb628cca0331689e8b936ae47c7e1c
* lcd-*: Merge common viewport operations into lcd-bitmap-common.cThomas Martitz2013-12-14
| | | | Change-Id: Ibec2d039ac0ba1214c9bd1b667bc8a9538a0d3d7
* 9 segment bitmap drawing:Jonathan Gordon2012-12-09
| | | | | | | | | | 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
* skin_engine: New tag to draw a rectangle (optionally with a gradient)Jonathan Gordon2012-03-15
| | | | | | | | | | | %dr(x, y, width, height, [colour1[, colour2]]): x,y - viewport relative pixel coordinates to start the rectangle. width, height - obvious. can be '-' to fill the viewport if both colours are left out the viewports foreground colour will be used if one colour is specified it will fill the rectangle that colour. if both colours are specified it will gradient fill the rectangle. Change-Id: Iad451e99ded663bc7c5d182443659db7d909b388
* lcd drivers: split lcd_gradient_rect so it is actually usefulJonathan Gordon2012-03-01
| | | | | | | 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
* lcd/skin_engine: Add the ability to draw onto the backdrop layerJonathan Gordon2012-02-28
| | | | | | | | | | | | | | 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
* OOPS, style got lost in scrolling lines with r31247, so put it backJonathan Gordon2011-12-15
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31314 a1c6a512-1295-4272-9138-f99709370657
* Allow scrolling lines to have their content changed without restarting the ↵Jonathan Gordon2011-12-14
| | | | | | scroll line. This means skin lines with dynamic tags can be updated in realtime instead of delayed git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31247 a1c6a512-1295-4272-9138-f99709370657
* Fix FS#12237 (caused by r30302) where centered skin text isnt eqactly centeredJonathan Gordon2011-12-14
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31246 a1c6a512-1295-4272-9138-f99709370657
* Fix build errors and warnings in the lcd drivers.Thomas Martitz2011-11-08
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30940 a1c6a512-1295-4272-9138-f99709370657
* Add new lcd_bmp and lcd_bmp_part APIs.Thomas Martitz2011-11-08
| | | | | | | | 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
* Better fix for FS#12337. Use 0 to make the line height calculated from the ↵Thomas Martitz2011-10-29
| | | | | | font height, as before r30773. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30850 a1c6a512-1295-4272-9138-f99709370657
* Provide font_lock(). Font_get_bits() or ..width() may have to read glyph ↵Fred Bauer2011-10-21
| | | | | | cache misses from disk so provide a means to lock the buflib memory during the wait. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30814 a1c6a512-1295-4272-9138-f99709370657
* Commit FS#12321 - Touchscreen: List line padding, to more easily select linesThomas Martitz2011-10-17
| | | | | | | | | | | | | | 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
* Anti-Aliased Fonts support.Thomas Martitz2011-03-05
| | | | | | | | | | | | | This enables Rockbox to render anti-aliased fonts using an alpha blending method. The input font bitmaps are 4bit, i.e. 4x larger, but the metadata size stays the same. A tool, convttf, for converting ttf fonts directly to the Rockbox fnt format is provided. It has a useful help output, but the parameter that works best is -c1 or -c2 (2 for larger font sizes). Flyspray: FS#8961 Author: Initial work by Jonas Hurrelmann, further work by Fred Bauer, Andrew Mahone, Teruaki Kawashima and myself. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29523 a1c6a512-1295-4272-9138-f99709370657
* Fix r29123: the variable should be initialized every time in the loopAlexander Levin2011-01-23
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29124 a1c6a512-1295-4272-9138-f99709370657
* Respect the 'scroll delay' setting more accurately between scrolling roundsAlexander Levin2011-01-23
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29123 a1c6a512-1295-4272-9138-f99709370657
* Add a delay between text scroll rounds when scrolling forward similarly to ↵Alexander Levin2011-01-21
| | | | | | how it's done when scrolling bidirectionally (FS#11892) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29104 a1c6a512-1295-4272-9138-f99709370657
* Rename {draw,fill}_viewport once more (to draw_border_viewport and ↵Thomas Martitz2010-10-11
| | | | | | | | 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
* Add _rect to {draw,fill}_viewport as suggested by Jonathan Gordon to reduce ↵Thomas Martitz2010-10-10
| | | | | | the chance to confuse it with update_viewport(). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28240 a1c6a512-1295-4272-9138-f99709370657
* Two new lcd/multi screen api convinience functions: draw_viewport(), ↵Thomas Martitz2010-10-10
| | | | | | | | | fill_viewport(). They work as the drawrect/fillrect pendants but work on a viewport basis; pass NULL to draw the current viewport (the one set with set_viewport()). In conjunction with action_get_touchscreen_press_in_vp() it should be less of a pain to draw buttons and get presses on them. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28239 a1c6a512-1295-4272-9138-f99709370657
* Pixel-accurate (vertical) list scrolling for touchscreen targets.Thomas Martitz2010-10-06
| | | | | | | | Looks much smoother now as you don't scroll by whole lines anymore. Add some functions lcd driver to enable the line based scrolling engine to draw the lines with a pixel-based y-offset. This should also allow for a sensible kinetic scrolling mechanism (still a todo). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28214 a1c6a512-1295-4272-9138-f99709370657
* Implement lcd(_remote)_putsxyf() and export to pluginsRafaël Carré2010-08-28
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27921 a1c6a512-1295-4272-9138-f99709370657
* avoid overflow in puts_scroll().Teruaki Kawashima2010-05-21
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26231 a1c6a512-1295-4272-9138-f99709370657
* Move c/h files implementing/defining standard library stuff into a new libc ↵Thomas Martitz2010-05-06
| | | | | | | | 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
* * surround member only used by charcells with #ifdef HAVE_LCD_CHARCELLS in ↵Teruaki Kawashima2010-02-16
| | | | | | | | struct scrollinfo in scroll_engine.h. * remove function prototypes which are not actualy defined. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24693 a1c6a512-1295-4272-9138-f99709370657
* revert r24478 and make the backdrop behaviour the same as it used to be (so ↵Jonathan Gordon2010-02-08
| | | | | | when in the wps the sbs' backdrop will be fully disabled). Also changes the API back to having to manually set the current backdrop. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24565 a1c6a512-1295-4272-9138-f99709370657
* fix a bug where the backdrop from the sbs is displayed on scrolling lines in ↵Jonathan Gordon2010-02-03
| | | | | | | | | | the wps when the %wd tag is not used. I'm not crazy about this commit and maybe a better solution would be to outright disable the sbs backdrop when in any skinned screen. This then means backdrops go back to needing special handling (i.e they arnt "free") git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24478 a1c6a512-1295-4272-9138-f99709370657
* draw selection bar even if str is empty string (e.g. in text_editor plugin).Teruaki Kawashima2010-01-09
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24204 a1c6a512-1295-4272-9138-f99709370657
* Fix FS#10893.Teruaki Kawashima2010-01-09
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24203 a1c6a512-1295-4272-9138-f99709370657
* Diacritic display enhancementsTomer Shalev2009-11-28
| | | | | | | | | | | | | | | - Use the fact that unicode code currently does not support chars above 0xffff (see utf8decode()), and change diacritic database's char code type to unsigned short from int. Also comment out database entries above unsupported range. - Use const when possible. - Iterate over buffer using the buffer's pointer, thus avoiding usage of some variables, and avoiding multiple access to the same array item. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23776 a1c6a512-1295-4272-9138-f99709370657
* Fix diacritic and save some bin sizeTomer Shalev2009-11-26
| | | | | | | | | - Fix bug which cause wrong placement of characters in some specific conditions - Fix multiple similar entries in cache - Protect against negative x values passed to drawing function git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23765 a1c6a512-1295-4272-9138-f99709370657