https://git.reactos.org/?p=reactos.git;a=commitdiff;h=3526ffc094277e03d1a01…
commit 3526ffc094277e03d1a01435036bfb089806b88d
Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com>
AuthorDate: Tue Mar 28 08:12:38 2023 +0900
Commit: GitHub <noreply(a)github.com>
CommitDate: Tue Mar 28 08:12:38 2023 +0900
[BLUE] Optimize ScrIoControl for speed (#5185)
Optimize IOCTL_CONSOLE_FILL_OUTPUT_ATTRIBUTE and IOCTL_CONSOLE_FILL_OUTPUT_CHARACTER
for speed by using cache. CORE-18838
---
drivers/setup/blue/blue.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/setup/blue/blue.c b/drivers/setup/blue/blue.c
index 81011fe10cc..06e498d8208 100644
--- a/drivers/setup/blue/blue.c
+++ b/drivers/setup/blue/blue.c
@@ -1073,6 +1073,8 @@ ScrIoControl(
if (DeviceExtension->Enabled && DeviceExtension->VideoMemory)
{
+ UCHAR attr = Buf->wAttribute;
+
vidmem = DeviceExtension->VideoMemory;
offset = (Buf->dwCoord.X + Buf->dwCoord.Y *
DeviceExtension->Columns) * 2 + 1;
@@ -1082,7 +1084,7 @@ ScrIoControl(
for (dwCount = 0; dwCount < nMaxLength; dwCount++)
{
- vidmem[offset + (dwCount * 2)] = (char)Buf->wAttribute;
+ vidmem[offset + (dwCount * 2)] = attr;
}
Buf->dwTransfered = dwCount;
}
@@ -1271,6 +1273,8 @@ ScrIoControl(
if (DeviceExtension->Enabled && DeviceExtension->VideoMemory)
{
+ UCHAR ch = Buf->cCharacter;
+
vidmem = DeviceExtension->VideoMemory;
offset = (Buf->dwCoord.X + Buf->dwCoord.Y *
DeviceExtension->Columns) * 2;
@@ -1280,7 +1284,7 @@ ScrIoControl(
for (dwCount = 0; dwCount < nMaxLength; dwCount++)
{
- vidmem[offset + (dwCount * 2)] = (char)Buf->cCharacter;
+ vidmem[offset + (dwCount * 2)] = ch;
}
Buf->dwTransfered = dwCount;
}