Commit graph

23 commits

Author SHA1 Message Date
Aidan MacDonald
f737e5025d lcd: Refactor viewport clipping functions
There's no need to generate separate copies of these functions
for main and remote LCDs; we can just pass the viewport directly.

Change-Id: I20aa04a58d327b479a942708e161068bd6a3357b
2022-10-12 07:34:15 -04:00
Aidan MacDonald
6acc8a81a7 lcd: Cosmetic variable renaming
Assign lcd_current_viewport to a local variable for easier typing.

Change-Id: Ib5d4283fd1c5a21c94d3bd3c2c28ce206383fb96
2022-10-12 07:34:15 -04:00
Aidan MacDonald
4b8fe8acd1 lcd: Consolidate in-viewport clipping routines
In-viewport clipping code is duplicated across 8 files, making
it a chore to change anything related to clipping; refactor the
clipping logic into dedicated functions.

Change-Id: I4ab20bb3c59b0406098d0c7d23833025f17a320a
2022-10-09 22:07:44 +01:00
Aidan MacDonald
09cb3c7843 lcd: Remove HAVE_VIEWPORT_CLIP
This was only enabled for the mrobe500 and sansaconnect targets.
Most targets are therefore running without this "safety" measure,
and presumably we'd have noticed long ago if there was a problem.
So in all likelihood this is just a bunch of dead code that we
don't need to carry around.

Change-Id: I7d27701a38b1c2a985ee73fa6f277ad215d8d385
2022-09-27 14:13:15 +01:00
William Wilgus
60f642ba4f lcd_framebuffer bugfixes, sanity checks
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-31 01:11:30 -04:00
William Wilgus
40e98a2e49 Whitespace cleanup on fb_viewport Rewrite
Change-Id: I24aac41c8abecf7b78a44d7f59e842b791be4563
2020-10-26 12:38:22 -04:00
William Wilgus
3237ae4a4f LCD core move buf ptr and address look up function viewport struct
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-26 12:28:48 -04:00
Thomas Martitz
8f6c779ff6 Fix some build errors and warnings.
Change-Id: I149c00fc6ba47d5134ad4f74c364bffd24079824
2014-06-21 00:49:05 +02:00
Thomas Martitz
1f83d2c6d2 lcd_fillrect(): Unify 16bit implementations (move to 16bit-common.c)
Change-Id: I457ea9fcb67869fdac7f1201a059a362b087e908
2012-03-20 23:04:43 +01:00
Thomas Martitz
bae2470758 Refactor lcd_clear_viewport().
* Unify 16bit implementaitons (move to 16bit-common.c).
* Add viewport clipping (within #ifdef HAVE_VIEWPORT_CLIP) like other lcd_* functions have.

Change-Id: I4e96b2efdb94d2f7bc5bcdb710554117989579ec
2012-03-20 22:42:31 +01:00
Jonathan Gordon
b37e6bc8c1 lcd drivers: Convert lcd_[remote_]framebuffer to a pointer
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
2012-02-28 11:44:59 +11:00
Rafaël Carré
6b5dff4c7b lcd-16bit: move lcd_bitmap and lcd_bitmap_transparent to common code
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31131 a1c6a512-1295-4272-9138-f99709370657
2011-12-03 22:39:08 +00:00
Rafaël Carré
26851eaaa9 lcd-16bit: move common code to lcd-16bit-common.c
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31130 a1c6a512-1295-4272-9138-f99709370657
2011-12-03 22:19:17 +00:00
Thomas Martitz
cbf889d3e2 Merge lcd_{alpha,mono}_bitmap_part() for both lcd-16bit. Add small loop optimizations too.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29541 a1c6a512-1295-4272-9138-f99709370657
2011-03-08 17:11:56 +00:00
Thomas Martitz
edea12b21e Add viewport clipping to lcd_alpha_bitmap_part as lcd_mono_bitmap_part also has.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29526 a1c6a512-1295-4272-9138-f99709370657
2011-03-05 20:09:41 +00:00
Thomas Martitz
222e1ad845 Add lcd_alpha_bitmap_part suitable for vertical stride 16bit lcd.
Possibly not the fastest solution but it will do.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29525 a1c6a512-1295-4272-9138-f99709370657
2011-03-05 19:57:56 +00:00
Thomas Martitz
87409a2619 Move memset6() declaration to string-extra.h, kills a warning compiling for android since it ships a memory.h.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27789 a1c6a512-1295-4272-9138-f99709370657
2010-08-12 13:55:01 +00:00
Tomer Shalev
bc8cefd1a4 Comment out lcd_drawline() DEBUGF messages which show in various simulators
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24784 a1c6a512-1295-4272-9138-f99709370657
2010-02-20 06:42:45 +00:00
Karl Kurbjun
765ff0130a Add optional viewport clipping, can be enabled with HAVE_VIEWPORT_CLIP. A simulator check is also added to set_viewport that will show an error/note when DEBUGF is enabled.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23551 a1c6a512-1295-4272-9138-f99709370657
2009-11-07 18:38:46 +00:00
Thomas Martitz
d85c3ec410 Convert lcd_activation callbacks to use the event system to allow for multiple parallel callbacks (for custom statusbar).
Increase maximum event count as we need more (I actually had a report about it during custom statusbar testing).
Removed corresponding functions from the core and plugin api. Bump min version and sort.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23302 a1c6a512-1295-4272-9138-f99709370657
2009-10-20 21:54:59 +00:00
Karl Kurbjun
25123570c7 Fix STRIDE macro for multiscreen and add stride support for picture lib.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22615 a1c6a512-1295-4272-9138-f99709370657
2009-09-04 00:46:24 +00:00
Karl Kurbjun
5ac447a9de Update Vertical stride so that it's oriented left to right in the destination.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22598 a1c6a512-1295-4272-9138-f99709370657
2009-09-02 01:01:24 +00:00
Karl Kurbjun
8cb5df6a46 Initial vertical stride LCD driver. Backdrop is inverted with it currently.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22579 a1c6a512-1295-4272-9138-f99709370657
2009-09-01 00:50:43 +00:00