1. Fix an issue about the calculation of GlyphBufferSize

2. Fix a bug in handling the overlapped case by reverse-copying the destine region & source region
3. Fix an issue that the leading spaces could not be displayed in highlight mode  


git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2410 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
qhuang8 2007-02-28 07:41:28 +00:00
parent 2c33bcb4f2
commit fad1794ce8
4 changed files with 122 additions and 92 deletions

View File

@ -1,7 +1,7 @@
/**@file /**@file
Private data structures for the Console Splitter driver Private data structures for the Console Splitter driver
Copyright (c) 2006 Intel Corporation. <BR> Copyright (c) 2006 - 2007 Intel Corporation. <BR>
All rights reserved. This program and the accompanying materials All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at which accompanies this distribution. The full text of the license may be found at
@ -12,8 +12,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/ **/
#ifndef _CON_SPLITER_H_ #ifndef _CON_SPLITTER_H_
#define _CON_SPLITER_H_ #define _CON_SPLITTER_H_
// //
// Private Data Structures // Private Data Structures

View File

@ -1,6 +1,6 @@
/*++ /*++
Copyright (c) 2006, Intel Corporation Copyright (c) 2006 - 2007, Intel Corporation
All rights reserved. This program and the accompanying materials All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at which accompanies this distribution. The full text of the license may be found at
@ -378,6 +378,7 @@ DevNullGraphicsOutputBlt (
) )
{ {
UINTN SrcY; UINTN SrcY;
BOOLEAN Forward;
UINTN Index; UINTN Index;
EFI_GRAPHICS_OUTPUT_BLT_PIXEL *BltPtr; EFI_GRAPHICS_OUTPUT_BLT_PIXEL *BltPtr;
EFI_GRAPHICS_OUTPUT_BLT_PIXEL *ScreenPtr; EFI_GRAPHICS_OUTPUT_BLT_PIXEL *ScreenPtr;
@ -434,9 +435,23 @@ DevNullGraphicsOutputBlt (
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
if ((BltOperation == EfiBltVideoToVideo) && (DestinationY > SourceY)) {
//
// Copy backwards, only care the Video to Video Blt
//
ScreenPtr = &Private->GraphicsOutputBlt[(DestinationY + Height - 1) * HorizontalResolution + DestinationX];
SrcY = SourceY + Height - 1;
Forward = FALSE;
} else {
//
// Copy forwards, for other cases
//
ScreenPtr = &Private->GraphicsOutputBlt[DestinationY * HorizontalResolution + DestinationX]; ScreenPtr = &Private->GraphicsOutputBlt[DestinationY * HorizontalResolution + DestinationX];
SrcY = SourceY; SrcY = SourceY;
while (Height) { Forward = TRUE;
}
while (Height != 0) {
if (BltOperation == EfiBltVideoFill) { if (BltOperation == EfiBltVideoFill) {
for (Index = 0; Index < Width; Index++) { for (Index = 0; Index < Width; Index++) {
ScreenPtr[Index] = *BltBuffer; ScreenPtr[Index] = *BltBuffer;
@ -451,8 +466,13 @@ DevNullGraphicsOutputBlt (
CopyMem (ScreenPtr, BltPtr, Width * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL)); CopyMem (ScreenPtr, BltPtr, Width * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL));
} }
if (Forward) {
ScreenPtr += HorizontalResolution; ScreenPtr += HorizontalResolution;
SrcY++; SrcY ++;
} else {
ScreenPtr -= HorizontalResolution;
SrcY --;
}
Height--; Height--;
} }
} }
@ -792,6 +812,7 @@ DevNullUgaBlt (
) )
{ {
UINTN SrcY; UINTN SrcY;
BOOLEAN Forward;
UINTN Index; UINTN Index;
EFI_UGA_PIXEL *BltPtr; EFI_UGA_PIXEL *BltPtr;
EFI_UGA_PIXEL *ScreenPtr; EFI_UGA_PIXEL *ScreenPtr;
@ -848,9 +869,23 @@ DevNullUgaBlt (
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
if ((BltOperation == EfiUgaVideoToVideo) && (DestinationY > SourceY)) {
//
// Copy backwards, only care the Video to Video Blt
//
ScreenPtr = &Private->UgaBlt[(DestinationY + Height - 1) * HorizontalResolution + DestinationX];
SrcY = SourceY + Height - 1;
Forward = FALSE;
} else {
//
// Copy forwards, for other cases
//
ScreenPtr = &Private->UgaBlt[DestinationY * HorizontalResolution + DestinationX]; ScreenPtr = &Private->UgaBlt[DestinationY * HorizontalResolution + DestinationX];
SrcY = SourceY; SrcY = SourceY;
while (Height) { Forward = TRUE;
}
while (Height != 0) {
if (BltOperation == EfiUgaVideoFill) { if (BltOperation == EfiUgaVideoFill) {
for (Index = 0; Index < Width; Index++) { for (Index = 0; Index < Width; Index++) {
ScreenPtr[Index] = *BltBuffer; ScreenPtr[Index] = *BltBuffer;
@ -865,8 +900,13 @@ DevNullUgaBlt (
CopyMem (ScreenPtr, BltPtr, Width * sizeof (EFI_UGA_PIXEL)); CopyMem (ScreenPtr, BltPtr, Width * sizeof (EFI_UGA_PIXEL));
} }
if (Forward) {
ScreenPtr += HorizontalResolution; ScreenPtr += HorizontalResolution;
SrcY++; SrcY ++;
} else {
ScreenPtr -= HorizontalResolution;
SrcY --;
}
Height--; Height--;
} }
} }

View File

@ -1,6 +1,6 @@
/*++ /*++
Copyright (c) 2006, Intel Corporation Copyright (c) 2006 - 2007, Intel Corporation
All rights reserved. This program and the accompanying materials All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at which accompanies this distribution. The full text of the license may be found at
@ -60,45 +60,44 @@ Returns:
{ {
EFI_HII_GLOBAL_DATA *GlobalData; EFI_HII_GLOBAL_DATA *GlobalData;
EFI_HII_DATA *HiiData; EFI_HII_DATA *HiiData;
UINTN Count; BOOLEAN WideChar;
BOOLEAN Narrow; INT32 Location;
UINTN Location;
UINT8 GlyphCol1[19];
if (This == NULL) { if (This == NULL) {
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
HiiData = EFI_HII_DATA_FROM_THIS (This); HiiData = EFI_HII_DATA_FROM_THIS (This);
GlobalData = HiiData->GlobalData; GlobalData = HiiData->GlobalData;
Count = 0;
Narrow = TRUE;
ZeroMem (GlyphCol1, sizeof (GlyphCol1));
//
// Rewind through the string looking for a glyph width identifier
// If no width identifier exists, we assume string has narrow width identifier
//
for (WideChar = FALSE, Location = (INT32) *FirstMissing; Location >= 0; Location--) {
if ((StringToTest[Location] == NARROW_CHAR) || (StringToTest[Location] == WIDE_CHAR)) {
//
// We found something that identifies what glyph database to look in
//
WideChar = (BOOLEAN) (StringToTest[Location] == WIDE_CHAR);
break;
}
}
// //
// Walk through the string until you hit the null terminator // Walk through the string until you hit the null terminator
// //
for (; StringToTest[*FirstMissing] != 0x00; (*FirstMissing)++) { for (*GlyphBufferSize = 0; StringToTest[*FirstMissing] != CHAR_NULL; (*FirstMissing)++) {
Location = *FirstMissing;
//
// Rewind through the string looking for a glyph width identifier
//
for (; Location != 0; Location--) {
if (StringToTest[Location] == NARROW_CHAR || StringToTest[Location] == WIDE_CHAR) {
// //
// We found something that identifies what glyph database to look in // We found something that identifies what glyph database to look in
// //
if (StringToTest[Location] == WIDE_CHAR) { if ((StringToTest[*FirstMissing] == NARROW_CHAR) || (StringToTest[*FirstMissing] == WIDE_CHAR)) {
Narrow = FALSE; WideChar = (BOOLEAN) (StringToTest[*FirstMissing] == WIDE_CHAR);
} else { continue;
Narrow = TRUE;
}
}
} }
if (Narrow) { if (!WideChar) {
if (CompareMem ( if (CompareMem (
GlobalData->NarrowGlyphs[StringToTest[*FirstMissing]].GlyphCol1, GlobalData->NarrowGlyphs[StringToTest[*FirstMissing]].GlyphCol1,
&mUnknownGlyph, &mUnknownGlyph,
@ -127,13 +126,7 @@ Returns:
} }
} }
Count++; *GlyphBufferSize += (WideChar ? sizeof (EFI_WIDE_GLYPH) : sizeof (EFI_NARROW_GLYPH));
}
if (Narrow) {
*GlyphBufferSize = (UINT32) (Count * sizeof (EFI_NARROW_GLYPH));
} else {
*GlyphBufferSize = (UINT32) (Count * sizeof (EFI_WIDE_GLYPH));
} }
return EFI_SUCCESS; return EFI_SUCCESS;

View File

@ -1,6 +1,6 @@
/*++ /*++
Copyright (c) 2006, Intel Corporation Copyright (c) 2006 - 2007, Intel Corporation
All rights reserved. This program and the accompanying materials All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at which accompanies this distribution. The full text of the license may be found at
@ -1295,7 +1295,6 @@ UpdateOptionSkipLines (
) )
{ {
UINTN Index; UINTN Index;
UINTN Loop;
UINT16 Width; UINT16 Width;
UINTN Row; UINTN Row;
UINTN OriginalRow; UINTN OriginalRow;
@ -1309,19 +1308,6 @@ UpdateOptionSkipLines (
ProcessOptions (MenuOption, FALSE, FileFormTagsHead, PageData, &OptionString); ProcessOptions (MenuOption, FALSE, FileFormTagsHead, PageData, &OptionString);
if (OptionString != NULL) { if (OptionString != NULL) {
//
// If leading spaces on OptionString - remove the spaces
//
for (Index = 0; OptionString[Index] == L' '; Index++)
;
for (Loop = 0; OptionString[Index] != CHAR_NULL; Index++) {
OptionString[Loop] = OptionString[Index];
Loop++;
}
OptionString[Loop] = CHAR_NULL;
Width = (UINT16) gOptionBlockWidth; Width = (UINT16) gOptionBlockWidth;
OriginalRow = Row; OriginalRow = Row;
@ -1623,6 +1609,9 @@ Returns:
ProcessOptions (MenuOption, FALSE, FileFormTagsHead, PageData, &OptionString); ProcessOptions (MenuOption, FALSE, FileFormTagsHead, PageData, &OptionString);
if (OptionString != NULL) { if (OptionString != NULL) {
if (MenuOption->ThisTag->Operand == EFI_IFR_DATE_OP ||
MenuOption->ThisTag->Operand == EFI_IFR_TIME_OP
) {
// //
// If leading spaces on OptionString - remove the spaces // If leading spaces on OptionString - remove the spaces
// //
@ -1636,6 +1625,7 @@ Returns:
} }
OptionString[Count] = CHAR_NULL; OptionString[Count] = CHAR_NULL;
}
// //
// If this is a date or time op-code and is used to reflect an RTC, register the op-code // If this is a date or time op-code and is used to reflect an RTC, register the op-code
@ -1835,6 +1825,9 @@ Returns:
ProcessOptions (MenuOption, FALSE, FileFormTagsHead, PageData, &OptionString); ProcessOptions (MenuOption, FALSE, FileFormTagsHead, PageData, &OptionString);
gST->ConOut->SetAttribute (gST->ConOut, FIELD_TEXT | FIELD_BACKGROUND); gST->ConOut->SetAttribute (gST->ConOut, FIELD_TEXT | FIELD_BACKGROUND);
if (OptionString != NULL) { if (OptionString != NULL) {
if (MenuOption->ThisTag->Operand == EFI_IFR_DATE_OP ||
MenuOption->ThisTag->Operand == EFI_IFR_TIME_OP
) {
// //
// If leading spaces on OptionString - remove the spaces // If leading spaces on OptionString - remove the spaces
// //
@ -1847,6 +1840,7 @@ Returns:
} }
OptionString[Count] = CHAR_NULL; OptionString[Count] = CHAR_NULL;
}
Width = (UINT16) gOptionBlockWidth; Width = (UINT16) gOptionBlockWidth;
@ -1953,6 +1947,9 @@ Returns:
if (SubMenu) { if (SubMenu) {
ProcessOptions (MenuOption, FALSE, FileFormTagsHead, PageData, &OptionString); ProcessOptions (MenuOption, FALSE, FileFormTagsHead, PageData, &OptionString);
if (OptionString != NULL) { if (OptionString != NULL) {
if (MenuOption->ThisTag->Operand == EFI_IFR_DATE_OP ||
MenuOption->ThisTag->Operand == EFI_IFR_TIME_OP
) {
// //
// If leading spaces on OptionString - remove the spaces // If leading spaces on OptionString - remove the spaces
// //
@ -1965,7 +1962,7 @@ Returns:
} }
OptionString[Count] = CHAR_NULL; OptionString[Count] = CHAR_NULL;
}
Width = (UINT16) gOptionBlockWidth; Width = (UINT16) gOptionBlockWidth;
OriginalRow = MenuOption->Row; OriginalRow = MenuOption->Row;