- //\r
- // Draw it to screen or existing bitmap depending on whether\r
- // EFI_HII_DIRECT_TO_SCREEN is set.\r
- //\r
- if ((Flags & EFI_HII_DIRECT_TO_SCREEN) == EFI_HII_DIRECT_TO_SCREEN) {\r
- BltBuffer = AllocateZeroPool (RowInfo[RowIndex].LineWidth * RowInfo[RowIndex].LineHeight * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL));\r
- if (BltBuffer == NULL) {\r
- Status = EFI_OUT_OF_RESOURCES;\r
- goto Exit;\r
- }\r
- BufferPtr = BltBuffer;\r
- for (Index1 = RowInfo[RowIndex].StartIndex; Index1 <= RowInfo[RowIndex].EndIndex; Index1++) {\r
+ //\r
+ // Clip the final row if the row's bottom-most on pixel cannot fit when\r
+ // EFI_HII_OUT_FLAG_CLEAN_Y is set.\r
+ //\r
+ if (RowIndex == MaxRowNum - 1 && Image->Height < LineHeight) {\r
+ LineHeight = Image->Height;\r
+ if ((Flags & EFI_HII_OUT_FLAG_CLIP_CLEAN_Y) == EFI_HII_OUT_FLAG_CLIP_CLEAN_Y) {\r
+ //\r
+ // Don't draw at all if the row's bottom-most on pixel cannot fit.\r
+ //\r
+ break;\r
+ }\r
+ }\r
+\r
+ //\r
+ // Draw it to screen or existing bitmap depending on whether\r
+ // EFI_HII_DIRECT_TO_SCREEN is set.\r
+ //\r
+ if ((Flags & EFI_HII_DIRECT_TO_SCREEN) == EFI_HII_DIRECT_TO_SCREEN) {\r
+ BltBuffer = AllocateZeroPool (RowInfo[RowIndex].LineWidth * RowInfo[RowIndex].LineHeight * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL));\r
+ if (BltBuffer == NULL) {\r
+ Status = EFI_OUT_OF_RESOURCES;\r
+ goto Exit;\r
+ }\r
+ BufferPtr = BltBuffer;\r
+ for (Index1 = RowInfo[RowIndex].StartIndex; Index1 <= RowInfo[RowIndex].EndIndex; Index1++) {\r
+ if (GlyphBuf[Index1] != NULL) {\r
+ //\r
+ // Only BLT these character which have corrsponding glyph in font basebase.\r
+ //\r