Commit Message
Hi,
the attached patch speeds up OSD display a little bit.
I think it's wrong to tell cStatus that for example 2700 channel entries
will be displayed when actually only 16 entries fit on screen.
The other sections speed up paging beyond the first respectively last
item (similarly to single line scrolling).
Further ideas to reduce CPU load while scrolling:
- Flush OSD after each scroll: will slow down scrolling and therefore
most likely reduce CPU load.
- Snoop ahead remote commands and do N scrolls at once, skipping N-1
paint operations.
- Paint line by line and abort as soon as further remote commands
arrive, to start over again.
Bye.
Comments
----- Original Message -----
From: "Reinhard Nissl" <rnissl@gmx.de>
To: "Klaus Schmidinger's VDR" <vdr@linuxtv.org>
Sent: Sunday, May 22, 2005 9:26 PM
Subject: [vdr] VDR-1.3.24: OSD speedup
> I think it's wrong to tell cStatus that for example 2700 channel entries
> will be displayed when actually only 16 entries fit on screen.
There are plugins that use the cStatus interface to show informations on
external displays. And VDR can't know how many rows fits on these kinds of
display. So I think it's not a good idea to reduce the entries to only that
ones that fits on the VDR OSD!
Jan
Jan Rieger wrote:
>
> ----- Original Message ----- From: "Reinhard Nissl" <rnissl@gmx.de>
> To: "Klaus Schmidinger's VDR" <vdr@linuxtv.org>
> Sent: Sunday, May 22, 2005 9:26 PM
> Subject: [vdr] VDR-1.3.24: OSD speedup
>
>
>> I think it's wrong to tell cStatus that for example 2700 channel entries
>> will be displayed when actually only 16 entries fit on screen.
>
>
> There are plugins that use the cStatus interface to show informations on
> external displays. And VDR can't know how many rows fits on these kinds
> of display. So I think it's not a good idea to reduce the entries to
> only that ones that fits on the VDR OSD!
This patch also conflicts with the osdbase-maxitems.diff (used with the
text2skin plugin).
Best Regards,
C.Y.M.
C.Y.M wrote:
>
> This patch also conflicts with the osdbase-maxitems.diff (used with the
> text2skin plugin).
>
Hmm, what patch is that? Haven't heard of it.
@@ -191,8 +191,11 @@ void cOsdMenu::Display(void)
int count = Count();
if (count > 0) {
int ni = 0;
- for (cOsdItem *item = First(); item; item = Next(item))
+ for (cOsdItem *item = Get(first); item; item = Next(item)) {
cStatus::MsgOsdItem(item->Text(), ni++);
+ if (ni == displayMenuItems)
+ break;
+ }
if (current < 0)
current = 0; // just for safety - there HAS to be a current item!
if (current - first >= displayMenuItems || current < first) {
@@ -306,33 +309,38 @@ void cOsdMenu::CursorDown(void)
void cOsdMenu::PageUp(void)
{
- current -= displayMenuItems;
- first -= displayMenuItems;
- if (first < 0)
- first = current = 0;
- if (!SelectableItem(current)) {
- current -= (current > 0) ? 1 : -1;
- first = min(first, current - 1);
+ if (current > 0) {
+ current -= displayMenuItems;
+ first -= displayMenuItems;
+ if (first < 0)
+ first = current = 0;
+ if (!SelectableItem(current)) {
+ current -= (current > 0) ? 1 : -1;
+ first = min(first, current - 1);
+ }
+ Display();
+ DisplayCurrent(true);
}
- Display();
- DisplayCurrent(true);
}
void cOsdMenu::PageDown(void)
{
- current += displayMenuItems;
- first += displayMenuItems;
- int count = Count();
- if (current > count - 1) {
- current = count - 1;
- first = max(0, count - displayMenuItems);
- }
- if (!SelectableItem(current)) {
- current += (current < count - 1) ? 1 : -1;
- first = max(first, current - displayMenuItems);
+ int last = Count() - 1;
+
+ if (current < last) {
+ current += displayMenuItems;
+ first += displayMenuItems;
+ if (current > last) {
+ current = last;
+ first = max(0, last + 1 - displayMenuItems);
+ }
+ if (!SelectableItem(current)) {
+ current += (current < last) ? 1 : -1;
+ first = max(first, current - displayMenuItems);
+ }
+ Display();
+ DisplayCurrent(true);
}
- Display();
- DisplayCurrent(true);
}
void cOsdMenu::Mark(void)