forked from len0rd/rockbox
scroll engine calculate stringsize only when scroll line updated
we calculate the size of the scrolling line every scroll update the line data doesn't ever change without a call to update instead calculate the string size when the line is updated re-use this value while scrolling the line in theory the current font could change but in practice I can't find a case when the string size needs to be updated that the scroll engine isn't already updating the line if this is later an issue we can recalculate the stringsize each time the line is finished scrolling which still saves quite a few calculations Other: I don't think we have any targets with pixel counts exceeding 65535 pixels where unsigned short stringsize will be an issue Change-Id: I83d6374377ed648d9a320d4fd69f9d6a17095b0c
This commit is contained in:
parent
f179fc1079
commit
660fa3ffdc
3 changed files with 33 additions and 27 deletions
|
@ -124,6 +124,8 @@ struct scrollinfo
|
|||
int width, height;
|
||||
/* pixel to skip from the beginning of the string, increments as the text scrolls */
|
||||
int offset;
|
||||
/* getstringsize width of linebuffer */
|
||||
unsigned short line_stringsize;
|
||||
/* scroll presently forward or backward? */
|
||||
bool backward;
|
||||
bool bidir;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue