Commit graph

79 commits

Author SHA1 Message Date
Aidan MacDonald
830436a282 skin engine: Remove viewport_colour viewport field
Yet again, no need to store the viewport because we already know
it -- and this time the render code is obviously relying on that
assumption.

Change-Id: Id5eb7cd9999fbe1efccd54bd8f0fd3c8a3011c8e
2022-11-23 10:06:16 -05:00
Aidan MacDonald
9368844ad1 skin engine: Remove progressbar viewport field
Again, we don't need to store the viewport in the progressbar
struct because it's known at render time.

Change-Id: I12514ceaace7c897194b18929364340871ef4635
2022-11-23 09:44:23 -05:00
Aidan MacDonald
38687821b2 skin engine: Remove playlistviewer viewport field
We already know the viewport at render time (I think... at least
this seems to be the case for themes I tested) so there's no need
to store a pointer to the viewport.

Change-Id: I75fa2262e96c6f735e6b5da33cd4ca9ac68cd2ee
2022-11-17 16:12:19 +00:00
Aidan MacDonald
2c1adac3f8 skin engine: Remove unused viewport_change flag in skin rendering
Change-Id: Iad4487854d005a33184febf6cf97924b21010f6b
2022-11-10 06:37:41 -05:00
Aidan MacDonald
37da608f84 skin engine: Remove weird special casing for Onda VX747
I have no idea what bug this could possibly "fix", and nothing
looks different on the sim after removing it. As far as I can tell
the Onda has no unique features that could cause the skin engine
to act flaky, so I'm willing to bet this workaround isn't needed.

Change-Id: I2c183786948f3fe9778e04134d04bdfe3c6db543
2022-11-10 06:37:41 -05:00
Aidan MacDonald
e27a6bad4f skin engine: Remove redundant argument from do_non_text_tags()
The skin viewport is already passed in info->skin_vp.

Change-Id: I5369684ba2a743d7bd804b33845bdb6ac17c46d0
2022-10-18 12:56:28 +01:00
Aidan MacDonald
14fbefdf39 Move skin global state to the WPS
This state is actually specific to the WPS and it makes more
sense to put it there.

Change-Id: I5dfee237fdcbae944806501ff3127a930820d68a
2022-10-18 12:56:28 +01:00
Aidan MacDonald
c6ee9dc883 Limit exposure of skin engine internals
Drop wps_internals.h from skin_engine.h. The WPS and to a lesser
extent the radio screen are too tightly integrated to drop their
dependency on wps_internals.h, unfortunately. Skinned lists, for
obvious reasons, also need access to the internals.

Change-Id: I00a55aa423900f9ad22edccbe2fc1910af380e38
2022-10-17 14:29:12 +01:00
William Wilgus
6c3cc1cbb9 Skin_engine optimize element switches
it takes a lot of code to check validity and dereference a pointer for every numeric tag branch in get_token_value

apparently about 900 bytes actually

Change-Id: If463e755e9bbc73cbd4a02441572d22df9206121
2020-11-13 19:14:56 +00:00
William Wilgus
0c99a3f9fb Skin engine Onda Vx747
Fixing issues that existed before framebuf rewrite

Fix swap issue

Change-Id: I43e03b7aaf4591c1b6f88e3ba0730e279934c0df
2020-11-01 17:43:42 +00:00
William Wilgus
c85d8e2865 Framebuffer_viewport Rewrite -- BUG FIX
stride was not initialized for the skin_viewport

fixed a few other questionable areas

Change-Id: I9cc7830a4406857bf3aba26a328c288e3702cddd
2020-10-28 13:25:12 -04:00
Solomon Peachy
a605cdf700 Fix multiple potential null pointer dereferencess
GCC's optimizer thinks all of these _will_ fail at some point

Change-Id: I287eeb574162a5d3b3347654d25aa1f53e9f5563
2020-10-28 08:42:49 -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
Solomon Peachy
658026e626 [4/4] Remove HAVE_LCD_BITMAP, as it's now the only choice.
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 21:20:13 +00:00
Solomon Peachy
0c4f89370d [2/4] get rid of HAVE_LCD_CHARCELLS
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
2020-07-24 21:20:13 +00:00
Thomas Martitz
a1842c04f9 lcd-24bit: Introduce a 24-bit mid-level LCD driver
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-06-21 00:15:53 +02:00
Thomas Martitz
d4d3f3c494 skin engine: Fix FS#12884.
The %Vf and %Vb tags change the colors for the rest of the viewport. This
requires the rest of the vp to be redrawn when they change due to a conditional.
The previous code did this redraw in all cases (conditional or not) which
led to visible blinking.

Change-Id: Ie59dfc6fe8ed76485a2a2bd7caf1315f1944c227
2014-01-10 21:54:06 +01:00
Thomas Martitz
10a2e6738d Oops, pasted to the wrong place.
Change-Id: Icb07ddd04171699e997eca171bf8756b5fd9f024
2014-01-07 22:46:45 +01:00
Thomas Martitz
0e6d86e4fe Fix a few reds and yellows.
Change-Id: I9ad2aca494f2ea3ca5453082ec5491ec031f9ae5
2014-01-07 22:41:00 +01:00
Thomas Martitz
e1c7b3b8f7 lcd-16bit: Remove {lss,lse,lst}_pattern fields from struct viewport.
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-07 14:13:48 +01:00
Thomas Martitz
91ef65306b skin_engine: Adapt put_line().
This allows for code unification and removal of a workaround (STYLE_XY_PIXELS).

Change-Id: Ie92d377414cad943cdb06976af10b4f315f32710
2014-01-07 14:13:40 +01:00
Thomas Martitz
ec6258f936 fix some reds.
Change-Id: Iecb1305dbd1519434e0f476d2199e728b96091f9
2013-12-23 12:35:52 +01:00
Thomas Martitz
22e802e800 playback,talk: Share audiobuffer via core_alloc_maximum().
This fixes the radioart crash that was the result of buffering.c working
on a freed buffer at the same time as buflib (radioart uses buffering.c for the
images). With this change the buffer is owned by buflib exclusively so this
cannot happen.

As a result, audio_get_buffer() doesn't exist anymore. Callers should call
core_alloc_maximum() directly. This buffer needs to be protected as usual
against movement if necessary (previously it was not protected at all which
cased the radioart crash), To get most of it they can adjust the willingness of
the talk engine to give its buffer away (at the expense of disabling voice
interface) with the new talk_buffer_set_policy() function.

Change-Id: I52123012208d04967876a304451d634e2bef3a33
2013-12-23 12:17:38 +01:00
Thomas Martitz
50eb528bc1 scroll_engine: Major rework to support pixel-based scrolling and scroll 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
2013-12-14 23:11:31 +01:00
Thomas Martitz
1c5d0b41ee scroll_engine: Rename scroll_stop* functions to be more consistent with the lcd api.
Change-Id: I8ada10b96bfb628cca0331689e8b936ae47c7e1c
2013-12-14 23:11:30 +01:00
Jonathan Gordon
c500f4efe5 radio screen: Disable displaying radio art, FS#12797
With radioart enabled there appears to be buffer corruption when
the image is loaded causing the player to data abort in skin_render_line()

So, disable the code untill someone can fix it.

Change-Id: I6acf3f76ce38aa2784b1b24ed6da29a9c5bee479
2013-01-03 23:09:01 +11:00
Jonathan Gordon
685cf59008 9 segment bitmap drawing:
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-12-09 17:11:19 +11:00
Jonathan Gordon
65f9df3083 skin_engine: Allow the %St() (setting) skin tag be used as a bar
%St(<setting name>) or %St(<bar tags>, setting, <setting name>)

Change-Id: I71396d683634d4d1ad2357018c4029ecb4229677
2012-07-05 23:30:06 +10:00
Jonathan Gordon
7909bf039f (hopefully) Fix FS#12639 and other skin related buflib corruption issues.
Kudos to funman for figuring out the problem - skin_find_item() rather
stupidly uses the global skin_buffer variable in skin_parser.c which is
fine in the parser EXCEPT it gets changed in skin_render when the sbs
is being redrawn while another skin is loading, so fix this by makeing
skin_find_item() use a local data pointer so a skin_render() during
parsing won't break anything.

Change-Id: I80e1c0efe569c18225e5772159c18ebb21e07332
2012-05-16 22:33:40 +10:00
Jonathan Gordon
9445d4625a skin_engine: fix scrolling lines with dynamic content
Change-Id: If85220c8b59123814e0e6b1a3b8e00c981271021
2012-03-26 22:24:43 +11:00
Jonathan Gordon
94139ac0bd Fix FS#12606 - next track can cause the screen to be cleared
This is a bit of a hack. We now trigger an event when the skin engine
is doing a full redraw (which means fullscreen clear) before the
lcd_update() to give the current screen a chance to redraw to avoid the
screen flicker.

This commit fixes the issue for screens which are entirely the list
widget (i.e browser and menus), other screens will need aditional fixes
(i.e quickscreen, time&date screen)

Change-Id: I3725c51518be724ce7aacee9877663c2de6866fa
2012-03-20 22:10:19 +11:00
Jonathan Gordon
182a6c80ba Fix compile errors
Change-Id: Ic985bf57da04847bff716ee41db8f107100ff95b
2012-03-15 23:03:33 +11:00
Jonathan Gordon
014a08cabb skin_engine: New tag to draw a rectangle (optionally with a gradient)
%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
2012-03-15 22:52:53 +11:00
Jonathan Gordon
f31e7a1225 Revert "Fix FS#12606 - next track can cause the screen to be cleared"
This reverts commit cb9bc3bbc8.
2012-03-15 11:31:18 +11:00
Jonathan Gordon
cb9bc3bbc8 Fix FS#12606 - next track can cause the screen to be cleared
This is a bit of a hack. We now trigger an event when the skin engine
is doing a full redraw (which means fullscreen clear) before the
lcd_update() to give the current screen a chance to redraw to avoid the
screen flicker.

This commit fixes the issue for screens which are entirely the list
widget (i.e browser and menus), other screens will need aditional fixes
(i.e quickscreen, time&date screen)

Change-Id: I3ffdcd8ccad2c663732f8d5983049c837de00fe5
2012-03-14 22:52:24 +11:00
Frank Gevaerts
b9bf6cdb2c Call skinlist_set_cfg() unconditionally, i.e. also if do_refresh==false
This call is cheap (except if the list config changes, but then it should
be called anyway), and do_refresh isn't always set appropriately, e.g.
when the screen has just changed, which could cause the list config to be
null at bad times, which caused the standard list to be shown instead of
the desired skinned list.

Change-Id: I47dd2552d6d1062456ede4529c4891e80a8159ea
Reviewed-on: http://gerrit.rockbox.org/113
Reviewed-by: Frank Gevaerts <frank@gevaerts.be>
2012-02-29 14:11:33 +01:00
Jonathan Gordon
34031cba5b skin_engine: Clean up %x() handling - beware theme issues
Internally remove some hacks around how %x() is handled.
%x() inside the default viewport will no longer work if
other viewports are used, so if you are using viewports and
%x() make sure it is in a viewport!

Change-Id: I8ecab805d55fc0f8476ff0516cba38e23400aa20
2012-02-28 23:51:01 +11:00
Jonathan Gordon
0807fe8d36 Fix build errors
Change-Id: Ie46e807799034af2a025c607a76e17c50c5b613e
2012-02-28 23:16:06 +11:00
Jonathan Gordon
2c71aa9feb lcd/skin_engine: Add the ability to draw onto the backdrop layer
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-28 23:03:04 +11:00
Jonathan Gordon
43fc2a51d9 skin engine: Make %vs() dynamic so it updated every screen update
This makes it easier to use %?vl() (variable last changed) in a sensible manner.

Change-Id: I0bf9ae24bc4516d2fd5691af236cc4439a0863c8
2012-02-21 00:17:49 +11:00
Jonathan Gordon
13f1b08388 Allow scrolling lines to have their content changed without restarting the 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
2011-12-14 12:53:19 +00:00
Jonathan Gordon
9e07ef2b0a Use buflib for all skin engine allocations.
Massive thanks to Michael Chicoine and other testers for finding the early bugs.

This removes all skin memory limitations

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30991 a1c6a512-1295-4272-9138-f99709370657
2011-11-15 14:11:08 +00:00
Jonathan Gordon
f19f3efb07 Redo r30826 (and hopefully not reintroduce font issues) which cleans up the font API. FONT_UI is deprecated, use screens[screen].getuifont() instead (and .setuifont() to set it after a font has been loaded)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30932 a1c6a512-1295-4272-9138-f99709370657
2011-11-08 10:09:33 +00:00
Andree Buschmann
99257101f2 Fix a 'set but not used' warning.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30615 a1c6a512-1295-4272-9138-f99709370657
2011-09-28 17:03:45 +00:00
Jonathan Gordon
aa0f4a4bbe FS#12273 - use buflib for font storage. thanks to the testers :)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30589 a1c6a512-1295-4272-9138-f99709370657
2011-09-24 13:19:34 +00:00
Jonathan Gordon
d43b85c7ed fix the last of the error
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30464 a1c6a512-1295-4272-9138-f99709370657
2011-09-06 14:07:27 +00:00
Jonathan Gordon
9b6ac01c7b Lists can now be completly draw using the skin engine!
due to lack of user feedback the actual tags may change, hopefully not though.

The way it works is the skin specifies a rectangle and a viewport label. For each item in the list that is being displayed all viewports with the specified label are drawn. However, instead of the viewport x/y position being offset from the top left corner like normal they are offset from the rectangle position in the list (so think of them as child-viewports of the rectangle which moves).
Normally the rectangle will move down the screen to show a normal list, this can be changed to move across the screen in a grid pattern.
The UI viewport is used to bound the items (i.e %Vi() )
Scrolling is completly disabled in all items except the currently selected item.

This works well in combination with the %cs tag to show differently styled lists based on the current screen :)

New tags:
%LT - Get the current items text
%LI - Get the current items icon number
%Lc - Use as a conditional to determine if the current item is the selected item
%LB - BAR TAG to show the scroll bar, params/options like other bar types. It still needs a bit of work though. Use as a conditional to find out if the bar is actually needed
%Lb(viewport, width, height [,tile]) - specify the viewport label to draw for each item and the size of each item. if the last param is 'tile' it will form a grid instead of a list

example.sbs:
%?cs<%Lb(a,100,20)|>
%V(0,0,10,-,1)%Vf(aabbcc)
%?LB<%LB(0,0,10,185, invert)>
%Vi(-,10,0,-,-35,1)
%Vl(a,5,5,160,12,1)
%s%?Lc<%Vg(00ffaa, ff0000, 000000)%Vs(gradient)%>%>%>%ac>zzzzzzz            %LT         zzzzz%s%?Lc<%ar%<%<%<>
%V(0,185,-,-,1)
%s%LT

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30461 a1c6a512-1295-4272-9138-f99709370657
2011-09-06 13:49:41 +00:00
Jonathan Gordon
281f1a1ed6 New skin tags: %Vs() to set the text style and %Vg() to get the viewports gradient colours
%Vs(mode[, param]) : mode can be "invert", "color" (where param is the colour to use", "clear" to disable the current style, "gradient" where param is the number of lines the gradient should draw over.
%Vg(start colour, end colour, [text colour]), if this tag isnt used the list selection colours from the settings will set the gradient colours

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30302 a1c6a512-1295-4272-9138-f99709370657
2011-08-14 13:50:07 +00:00
Nils Wallménius
3b04a85245 Remove a couple of dead inits and assignments found by the clang-static-analyzer.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29996 a1c6a512-1295-4272-9138-f99709370657
2011-06-12 22:17:45 +00:00