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
}\r
}\r
\r
- This->SetAttribute (This, EFI_TEXT_ATTR (This->Mode->Attribute & 0x0F, EFI_BACKGROUND_BLACK));\r
+ This->SetAttribute (This, EFI_TEXT_ATTR (This->Mode->Attribute & 0x0F, EFI_BLACK));\r
\r
Status = DevNullTextOutSetMode (Private, 0);\r
if (EFI_ERROR (Status)) {\r
}\r
}\r
\r
- This->SetAttribute (This, EFI_TEXT_ATTR (This->Mode->Attribute & 0x0F, EFI_BACKGROUND_BLACK));\r
+ This->SetAttribute (This, EFI_TEXT_ATTR (This->Mode->Attribute & 0x0F, EFI_BLACK));\r
\r
Status = This->SetMode (This, 0);\r
\r
if ((Attribute | 0x7f) != 0x7f) {\r
return EFI_UNSUPPORTED;\r
}\r
+\r
+ //\r
+ // Skip outputting the command string for the same attribute\r
+ // It improves the terminal performance siginificantly\r
+ //\r
+ if (This->Mode->Attribute == (INT32) Attribute) {\r
+ return EFI_SUCCESS;\r
+ }\r
+\r
//\r
// convert Attribute value to terminal emulator\r
// understandable foreground color\r