[Description]

add a judgement of whether the control command is equal with previous one or not.
[Impaction]
Judge if the control command is equaled with previous one. This handler can improve performance.
[Reference Info]
Currently the terminal driver outputs control commands upon user's request regardless of whether the new attribute is the same as previous one or not.
Actually, it could be implemented as only outputting control command when the new Attribute is different than previous one

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5113 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
eric_tian 2008-04-22 09:11:43 +00:00
parent 152af594cc
commit 0ce1dd70a9
2 changed files with 11 additions and 2 deletions

View File

@ -4384,7 +4384,7 @@ ConSplitterTextOutReset (
}
}
This->SetAttribute (This, EFI_TEXT_ATTR (This->Mode->Attribute & 0x0F, EFI_BACKGROUND_BLACK));
This->SetAttribute (This, EFI_TEXT_ATTR (This->Mode->Attribute & 0x0F, EFI_BLACK));
Status = DevNullTextOutSetMode (Private, 0);
if (EFI_ERROR (Status)) {

View File

@ -150,7 +150,7 @@ TerminalConOutReset (
}
}
This->SetAttribute (This, EFI_TEXT_ATTR (This->Mode->Attribute & 0x0F, EFI_BACKGROUND_BLACK));
This->SetAttribute (This, EFI_TEXT_ATTR (This->Mode->Attribute & 0x0F, EFI_BLACK));
Status = This->SetMode (This, 0);
@ -605,6 +605,15 @@ TerminalConOutSetAttribute (
if ((Attribute | 0x7f) != 0x7f) {
return EFI_UNSUPPORTED;
}
//
// Skip outputting the command string for the same attribute
// It improves the terminal performance siginificantly
//
if (This->Mode->Attribute == (INT32) Attribute) {
return EFI_SUCCESS;
}
//
// convert Attribute value to terminal emulator
// understandable foreground color