]> git.proxmox.com Git - mirror_edk2.git/commitdiff
1. Fix an issue about the calculation of GlyphBufferSize
authorqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 28 Feb 2007 07:41:28 +0000 (07:41 +0000)
committerqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 28 Feb 2007 07:41:28 +0000 (07:41 +0000)
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

EdkModulePkg/Universal/Console/ConSplitter/Dxe/ConSplitter.h
EdkModulePkg/Universal/Console/ConSplitter/Dxe/ConSplitterGraphics.c
EdkModulePkg/Universal/UserInterface/HiiDataBase/Dxe/Strings.c
EdkModulePkg/Universal/UserInterface/SetupBrowser/Dxe/Ui.c

index 13c4e743db68ca7ebda2d97e8c240878b2e4bb3e..54a1e575045e3510fa377c1ee77734b57772e8d7 100644 (file)
@@ -1,7 +1,7 @@
 /**@file\r
   Private data structures for the Console Splitter driver\r
 \r
-Copyright (c) 2006 Intel Corporation. <BR>\r
+Copyright (c) 2006 - 2007 Intel Corporation. <BR>\r
 All rights reserved. This program and the accompanying materials                          \r
 are licensed and made available under the terms and conditions of the BSD License         \r
 which accompanies this distribution.  The full text of the license may be found at        \r
@@ -12,8 +12,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 **/\r
 \r
-#ifndef _CON_SPLITER_H_\r
-#define _CON_SPLITER_H_\r
+#ifndef _CON_SPLITTER_H_\r
+#define _CON_SPLITTER_H_\r
 \r
 //\r
 // Private Data Structures\r
index 946835ed2971ac1d3309d82460ea8fb248f2725e..9726889ec843bd60ac0b514466513751bafcd94d 100644 (file)
@@ -1,6 +1,6 @@
 /*++\r
 \r
-Copyright (c) 2006, Intel Corporation                                                         \r
+Copyright (c) 2006 - 2007, Intel Corporation                                                         \r
 All rights reserved. This program and the accompanying materials                          \r
 are licensed and made available under the terms and conditions of the BSD License         \r
 which accompanies this distribution.  The full text of the license may be found at        \r
@@ -378,6 +378,7 @@ DevNullGraphicsOutputBlt (
   )\r
 {\r
   UINTN                         SrcY;\r
+  BOOLEAN                       Forward; \r
   UINTN                         Index;\r
   EFI_GRAPHICS_OUTPUT_BLT_PIXEL *BltPtr;\r
   EFI_GRAPHICS_OUTPUT_BLT_PIXEL *ScreenPtr;\r
@@ -434,9 +435,23 @@ DevNullGraphicsOutputBlt (
       return EFI_INVALID_PARAMETER;\r
     }\r
 \r
-    ScreenPtr = &Private->GraphicsOutputBlt[DestinationY * HorizontalResolution + DestinationX];\r
-    SrcY      = SourceY;\r
-    while (Height) {\r
+    if ((BltOperation == EfiBltVideoToVideo) && (DestinationY > SourceY)) {\r
+      //\r
+      // Copy backwards, only care the Video to Video Blt\r
+      //\r
+      ScreenPtr = &Private->GraphicsOutputBlt[(DestinationY + Height - 1) * HorizontalResolution + DestinationX];\r
+      SrcY      = SourceY + Height - 1;\r
+      Forward   = FALSE;\r
+    } else {\r
+      //\r
+      // Copy forwards, for other cases\r
+      //\r
+      ScreenPtr = &Private->GraphicsOutputBlt[DestinationY * HorizontalResolution + DestinationX];\r
+      SrcY      = SourceY;\r
+      Forward   = TRUE;\r
+    }\r
+\r
+    while (Height != 0) {\r
       if (BltOperation == EfiBltVideoFill) {\r
         for (Index = 0; Index < Width; Index++) {\r
           ScreenPtr[Index] = *BltBuffer;\r
@@ -451,8 +466,13 @@ DevNullGraphicsOutputBlt (
         CopyMem (ScreenPtr, BltPtr, Width * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL));\r
       }\r
 \r
-      ScreenPtr += HorizontalResolution;\r
-      SrcY++;\r
+      if (Forward) {\r
+        ScreenPtr += HorizontalResolution;\r
+        SrcY ++;\r
+      } else {\r
+        ScreenPtr -= HorizontalResolution;\r
+        SrcY --;\r
+      }\r
       Height--;\r
     }\r
   }\r
@@ -792,6 +812,7 @@ DevNullUgaBlt (
   )\r
 {\r
   UINTN         SrcY;\r
+  BOOLEAN       Forward;\r
   UINTN         Index;\r
   EFI_UGA_PIXEL *BltPtr;\r
   EFI_UGA_PIXEL *ScreenPtr;\r
@@ -848,9 +869,23 @@ DevNullUgaBlt (
       return EFI_INVALID_PARAMETER;\r
     }\r
 \r
-    ScreenPtr = &Private->UgaBlt[DestinationY * HorizontalResolution + DestinationX];\r
-    SrcY      = SourceY;\r
-    while (Height) {\r
+    if ((BltOperation == EfiUgaVideoToVideo) && (DestinationY > SourceY)) {\r
+      //\r
+      // Copy backwards, only care the Video to Video Blt\r
+      //\r
+      ScreenPtr = &Private->UgaBlt[(DestinationY + Height - 1) * HorizontalResolution + DestinationX];\r
+      SrcY      = SourceY + Height - 1;\r
+      Forward   = FALSE;\r
+    } else {\r
+      //\r
+      // Copy forwards, for other cases\r
+      //\r
+      ScreenPtr = &Private->UgaBlt[DestinationY * HorizontalResolution + DestinationX];\r
+      SrcY      = SourceY;\r
+      Forward   = TRUE;\r
+    }\r
+\r
+    while (Height != 0) {\r
       if (BltOperation == EfiUgaVideoFill) {\r
         for (Index = 0; Index < Width; Index++) {\r
           ScreenPtr[Index] = *BltBuffer;\r
@@ -865,8 +900,13 @@ DevNullUgaBlt (
         CopyMem (ScreenPtr, BltPtr, Width * sizeof (EFI_UGA_PIXEL));\r
       }\r
 \r
-      ScreenPtr += HorizontalResolution;\r
-      SrcY++;\r
+      if (Forward) {\r
+        ScreenPtr += HorizontalResolution;\r
+        SrcY ++;\r
+      } else {\r
+        ScreenPtr -= HorizontalResolution;\r
+        SrcY --;\r
+      }\r
       Height--;\r
     }\r
   }\r
index 26f797e63be62b548897d2e7170fb8d45c54edd6..0dbcd3388494e2b8e68f4289fb14fcdbe9fb30ed 100644 (file)
@@ -1,6 +1,6 @@
 /*++\r
 \r
-Copyright (c) 2006, Intel Corporation                                                         \r
+Copyright (c) 2006 - 2007, Intel Corporation                                                         \r
 All rights reserved. This program and the accompanying materials                          \r
 are licensed and made available under the terms and conditions of the BSD License         \r
 which accompanies this distribution.  The full text of the license may be found at        \r
@@ -60,45 +60,44 @@ Returns:
 {\r
   EFI_HII_GLOBAL_DATA *GlobalData;\r
   EFI_HII_DATA        *HiiData;\r
-  UINTN               Count;\r
-  BOOLEAN             Narrow;\r
-  UINTN               Location;\r
-  UINT8               GlyphCol1[19];\r
+  BOOLEAN             WideChar;\r
+  INT32               Location;\r
 \r
   if (This == NULL) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r
   HiiData     = EFI_HII_DATA_FROM_THIS (This);\r
-\r
   GlobalData  = HiiData->GlobalData;\r
-  Count       = 0;\r
-  Narrow      = TRUE;\r
 \r
-  ZeroMem (GlyphCol1, sizeof (GlyphCol1));\r
+  \r
+  //\r
+  // Rewind through the string looking for a glyph width identifier\r
+  // If no width identifier exists, we assume string has narrow width identifier\r
+  //\r
+  for (WideChar = FALSE, Location = (INT32) *FirstMissing; Location >= 0; Location--) {\r
+    if ((StringToTest[Location] == NARROW_CHAR) || (StringToTest[Location] == WIDE_CHAR)) {\r
+      //\r
+      // We found something that identifies what glyph database to look in\r
+      //\r
+      WideChar = (BOOLEAN) (StringToTest[Location] == WIDE_CHAR);\r
+      break;\r
+    }\r
+  }\r
 \r
   //\r
   // Walk through the string until you hit the null terminator\r
   //\r
-  for (; StringToTest[*FirstMissing] != 0x00; (*FirstMissing)++) {\r
-    Location = *FirstMissing;\r
+  for (*GlyphBufferSize = 0; StringToTest[*FirstMissing] != CHAR_NULL; (*FirstMissing)++) {\r
     //\r
-    // Rewind through the string looking for a glyph width identifier\r
+    // We found something that identifies what glyph database to look in\r
     //\r
-    for (; Location != 0; Location--) {\r
-      if (StringToTest[Location] == NARROW_CHAR || StringToTest[Location] == WIDE_CHAR) {\r
-        //\r
-        // We found something that identifies what glyph database to look in\r
-        //\r
-        if (StringToTest[Location] == WIDE_CHAR) {\r
-          Narrow = FALSE;\r
-        } else {\r
-          Narrow = TRUE;\r
-        }\r
-      }\r
+    if ((StringToTest[*FirstMissing] == NARROW_CHAR) || (StringToTest[*FirstMissing] == WIDE_CHAR)) {\r
+      WideChar = (BOOLEAN) (StringToTest[*FirstMissing] == WIDE_CHAR);\r
+      continue;\r
     }\r
 \r
-    if (Narrow) {\r
+    if (!WideChar) {\r
       if (CompareMem (\r
           GlobalData->NarrowGlyphs[StringToTest[*FirstMissing]].GlyphCol1,\r
           &mUnknownGlyph,\r
@@ -127,13 +126,7 @@ Returns:
       }\r
     }\r
 \r
-    Count++;\r
-  }\r
-\r
-  if (Narrow) {\r
-    *GlyphBufferSize = (UINT32) (Count * sizeof (EFI_NARROW_GLYPH));\r
-  } else {\r
-    *GlyphBufferSize = (UINT32) (Count * sizeof (EFI_WIDE_GLYPH));\r
+    *GlyphBufferSize += (WideChar ? sizeof (EFI_WIDE_GLYPH) : sizeof (EFI_NARROW_GLYPH));\r
   }\r
 \r
   return EFI_SUCCESS;\r
index 854d023f8e4a29b2a2e946a6219b2cea88fbd852..5e09c5e2eb324944c8a4fc6cb634300b7bfe87c5 100644 (file)
@@ -1,6 +1,6 @@
 /*++\r
 \r
-Copyright (c) 2006, Intel Corporation                                                         \r
+Copyright (c) 2006 - 2007, Intel Corporation                                                         \r
 All rights reserved. This program and the accompanying materials                          \r
 are licensed and made available under the terms and conditions of the BSD License         \r
 which accompanies this distribution.  The full text of the license may be found at        \r
@@ -1295,7 +1295,6 @@ UpdateOptionSkipLines (
   )\r
 {\r
   UINTN   Index;\r
-  UINTN   Loop;\r
   UINT16  Width;\r
   UINTN   Row;\r
   UINTN   OriginalRow;\r
@@ -1309,19 +1308,6 @@ UpdateOptionSkipLines (
   ProcessOptions (MenuOption, FALSE, FileFormTagsHead, PageData, &OptionString);\r
 \r
   if (OptionString != NULL) {\r
-    //\r
-    // If leading spaces on OptionString - remove the spaces\r
-    //\r
-    for (Index = 0; OptionString[Index] == L' '; Index++)\r
-    ;\r
-\r
-    for (Loop = 0; OptionString[Index] != CHAR_NULL; Index++) {\r
-      OptionString[Loop] = OptionString[Index];\r
-      Loop++;\r
-    }\r
-\r
-    OptionString[Loop]  = CHAR_NULL;\r
-\r
     Width               = (UINT16) gOptionBlockWidth;\r
 \r
     OriginalRow         = Row;\r
@@ -1623,19 +1609,23 @@ Returns:
             ProcessOptions (MenuOption, FALSE, FileFormTagsHead, PageData, &OptionString);\r
 \r
             if (OptionString != NULL) {\r
-              //\r
-              // If leading spaces on OptionString - remove the spaces\r
-              //\r
-              for (Index = 0; OptionString[Index] == L' '; Index++) {\r
-                MenuOption->OptCol++;\r
-              }\r
+              if (MenuOption->ThisTag->Operand == EFI_IFR_DATE_OP ||\r
+                  MenuOption->ThisTag->Operand == EFI_IFR_TIME_OP\r
+                  ) {\r
+                //\r
+                // If leading spaces on OptionString - remove the spaces\r
+                //\r
+                for (Index = 0; OptionString[Index] == L' '; Index++) {\r
+                  MenuOption->OptCol++;\r
+                }\r
 \r
-              for (Count = 0; OptionString[Index] != CHAR_NULL; Index++) {\r
-                OptionString[Count] = OptionString[Index];\r
-                Count++;\r
-              }\r
+                for (Count = 0; OptionString[Index] != CHAR_NULL; Index++) {\r
+                  OptionString[Count] = OptionString[Index];\r
+                  Count++;\r
+                }\r
 \r
-              OptionString[Count] = CHAR_NULL;\r
+                OptionString[Count] = CHAR_NULL;\r
+              }\r
 \r
               //\r
               // If this is a date or time op-code and is used to reflect an RTC, register the op-code\r
@@ -1835,18 +1825,22 @@ Returns:
           ProcessOptions (MenuOption, FALSE, FileFormTagsHead, PageData, &OptionString);\r
           gST->ConOut->SetAttribute (gST->ConOut, FIELD_TEXT | FIELD_BACKGROUND);\r
           if (OptionString != NULL) {\r
-            //\r
-            // If leading spaces on OptionString - remove the spaces\r
-            //\r
-            for (Index = 0; OptionString[Index] == L' '; Index++)\r
-              ;\r
+            if (MenuOption->ThisTag->Operand == EFI_IFR_DATE_OP ||\r
+                MenuOption->ThisTag->Operand == EFI_IFR_TIME_OP\r
+                ) {\r
+              //\r
+              // If leading spaces on OptionString - remove the spaces\r
+              //\r
+              for (Index = 0; OptionString[Index] == L' '; Index++)\r
+                ;\r
 \r
-            for (Count = 0; OptionString[Index] != CHAR_NULL; Index++) {\r
-              OptionString[Count] = OptionString[Index];\r
-              Count++;\r
-            }\r
+              for (Count = 0; OptionString[Index] != CHAR_NULL; Index++) {\r
+                OptionString[Count] = OptionString[Index];\r
+                Count++;\r
+              }\r
 \r
-            OptionString[Count] = CHAR_NULL;\r
+              OptionString[Count] = CHAR_NULL;\r
+            }\r
 \r
             Width               = (UINT16) gOptionBlockWidth;\r
 \r
@@ -1953,19 +1947,22 @@ Returns:
         if (SubMenu) {\r
           ProcessOptions (MenuOption, FALSE, FileFormTagsHead, PageData, &OptionString);\r
           if (OptionString != NULL) {\r
-            //\r
-            // If leading spaces on OptionString - remove the spaces\r
-            //\r
-            for (Index = 0; OptionString[Index] == L' '; Index++)\r
-              ;\r
-\r
-            for (Count = 0; OptionString[Index] != CHAR_NULL; Index++) {\r
-              OptionString[Count] = OptionString[Index];\r
-              Count++;\r
-            }\r
+            if (MenuOption->ThisTag->Operand == EFI_IFR_DATE_OP ||\r
+                MenuOption->ThisTag->Operand == EFI_IFR_TIME_OP\r
+                ) {\r
+              //\r
+              // If leading spaces on OptionString - remove the spaces\r
+              //\r
+              for (Index = 0; OptionString[Index] == L' '; Index++)\r
+                ;\r
 \r
-            OptionString[Count] = CHAR_NULL;\r
+              for (Count = 0; OptionString[Index] != CHAR_NULL; Index++) {\r
+                OptionString[Count] = OptionString[Index];\r
+                Count++;\r
+              }\r
 \r
+              OptionString[Count] = CHAR_NULL;\r
+            }\r
             Width               = (UINT16) gOptionBlockWidth;\r
 \r
             OriginalRow         = MenuOption->Row;\r