1. Setting cursor position to (0, 0) and flushing cursor directly instead of calling GraphicConSoleConOutSetPosition().

2. Rename the internal function name EraseCursor() to FlushCursor() to remove the confusion on this function name. And add detailed function description for it.

Signed-off-by: vanjeff
Reviewed-by: rsun3


git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11710 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
vanjeff 2011-05-27 05:30:30 +00:00
parent 701e17e520
commit f44e8c16f8
2 changed files with 33 additions and 20 deletions

View File

@ -815,7 +815,7 @@ GraphicsConsoleConOutOutputString (
// //
GetTextColors (This, &Foreground, &Background); GetTextColors (This, &Foreground, &Background);
EraseCursor (This); FlushCursor (This);
Warning = FALSE; Warning = FALSE;
@ -835,7 +835,7 @@ GraphicsConsoleConOutOutputString (
This->Mode->CursorRow--; This->Mode->CursorRow--;
This->Mode->CursorColumn = (INT32) (MaxColumn - 1); This->Mode->CursorColumn = (INT32) (MaxColumn - 1);
This->OutputString (This, SpaceStr); This->OutputString (This, SpaceStr);
EraseCursor (This); FlushCursor (This);
This->Mode->CursorRow--; This->Mode->CursorRow--;
This->Mode->CursorColumn = (INT32) (MaxColumn - 1); This->Mode->CursorColumn = (INT32) (MaxColumn - 1);
} else if (This->Mode->CursorColumn > 0) { } else if (This->Mode->CursorColumn > 0) {
@ -845,7 +845,7 @@ GraphicsConsoleConOutOutputString (
// //
This->Mode->CursorColumn--; This->Mode->CursorColumn--;
This->OutputString (This, SpaceStr); This->OutputString (This, SpaceStr);
EraseCursor (This); FlushCursor (This);
This->Mode->CursorColumn--; This->Mode->CursorColumn--;
} }
@ -1004,16 +1004,16 @@ GraphicsConsoleConOutOutputString (
} }
if (This->Mode->CursorColumn >= (INT32) MaxColumn) { if (This->Mode->CursorColumn >= (INT32) MaxColumn) {
EraseCursor (This); FlushCursor (This);
This->OutputString (This, mCrLfString); This->OutputString (This, mCrLfString);
EraseCursor (This); FlushCursor (This);
} }
} }
} }
This->Mode->Attribute = OriginAttribute; This->Mode->Attribute = OriginAttribute;
EraseCursor (This); FlushCursor (This);
if (Warning) { if (Warning) {
Status = EFI_WARN_UNKNOWN_GLYPH; Status = EFI_WARN_UNKNOWN_GLYPH;
@ -1222,7 +1222,7 @@ GraphicsConsoleConOutSetMode (
// Otherwise, the size of the text console and/or the GOP/UGA mode will be changed, // Otherwise, the size of the text console and/or the GOP/UGA mode will be changed,
// so erase the cursor, and free the LineBuffer for the current mode // so erase the cursor, and free the LineBuffer for the current mode
// //
EraseCursor (This); FlushCursor (This);
FreePool (Private->LineBuffer); FreePool (Private->LineBuffer);
} }
@ -1313,9 +1313,12 @@ GraphicsConsoleConOutSetMode (
This->Mode->Mode = (INT32) ModeNumber; This->Mode->Mode = (INT32) ModeNumber;
// //
// Move the text cursor to the upper left hand corner of the display and enable it // Move the text cursor to the upper left hand corner of the display and flush it
// //
This->SetCursorPosition (This, 0, 0); This->Mode->CursorColumn = 0;
This->Mode->CursorRow = 0;
FlushCursor (This);
Status = EFI_SUCCESS; Status = EFI_SUCCESS;
@ -1360,11 +1363,11 @@ GraphicsConsoleConOutSetAttribute (
OldTpl = gBS->RaiseTPL (TPL_NOTIFY); OldTpl = gBS->RaiseTPL (TPL_NOTIFY);
EraseCursor (This); FlushCursor (This);
This->Mode->Attribute = (INT32) Attribute; This->Mode->Attribute = (INT32) Attribute;
EraseCursor (This); FlushCursor (This);
gBS->RestoreTPL (OldTpl); gBS->RestoreTPL (OldTpl);
@ -1441,7 +1444,7 @@ GraphicsConsoleConOutClearScreen (
This->Mode->CursorColumn = 0; This->Mode->CursorColumn = 0;
This->Mode->CursorRow = 0; This->Mode->CursorRow = 0;
EraseCursor (This); FlushCursor (This);
gBS->RestoreTPL (OldTpl); gBS->RestoreTPL (OldTpl);
@ -1498,12 +1501,12 @@ GraphicsConsoleConOutSetCursorPosition (
goto Done; goto Done;
} }
EraseCursor (This); FlushCursor (This);
This->Mode->CursorColumn = (INT32) Column; This->Mode->CursorColumn = (INT32) Column;
This->Mode->CursorRow = (INT32) Row; This->Mode->CursorRow = (INT32) Row;
EraseCursor (This); FlushCursor (This);
Done: Done:
gBS->RestoreTPL (OldTpl); gBS->RestoreTPL (OldTpl);
@ -1535,11 +1538,11 @@ GraphicsConsoleConOutEnableCursor (
OldTpl = gBS->RaiseTPL (TPL_NOTIFY); OldTpl = gBS->RaiseTPL (TPL_NOTIFY);
EraseCursor (This); FlushCursor (This);
This->Mode->CursorVisible = Visible; This->Mode->CursorVisible = Visible;
EraseCursor (This); FlushCursor (This);
gBS->RestoreTPL (OldTpl); gBS->RestoreTPL (OldTpl);
return EFI_SUCCESS; return EFI_SUCCESS;
@ -1724,7 +1727,12 @@ DrawUnicodeWeightAtCursorN (
} }
/** /**
Erase the cursor on the screen. Flush the cursor on the screen.
If CursorVisible is FALSE, nothing to do and return directly.
If CursorVisible is TRUE,
i) If the cursor shows on screen, it will be erased.
ii) If the cursor does not show on screen, it will be shown.
@param This Protocol instance pointer. @param This Protocol instance pointer.
@ -1732,7 +1740,7 @@ DrawUnicodeWeightAtCursorN (
**/ **/
EFI_STATUS EFI_STATUS
EraseCursor ( FlushCursor (
IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This
) )
{ {

View File

@ -561,7 +561,12 @@ DrawUnicodeWeightAtCursorN (
); );
/** /**
Erase the cursor on the screen. Flush the cursor on the screen.
If CursorVisible is FALSE, nothing to do and return directly.
If CursorVisible is TRUE,
i) If the cursor shows on screen, it will be erased.
ii) If the cursor does not show on screen, it will be shown.
@param This Protocol instance pointer. @param This Protocol instance pointer.
@ -569,7 +574,7 @@ DrawUnicodeWeightAtCursorN (
**/ **/
EFI_STATUS EFI_STATUS
EraseCursor ( FlushCursor (
IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This
); );