[NTGDI][FREETYPE] Increase STACK_TEXT_BUFFER_SIZE (#6847)

Slight performance improvement. STACK_TEXT_BUFFER_SIZE = 100 was too small
for long text. This PR can reduce unnecessary buffer allocations in NtGdiExtTextOutW
function.
JIRA issue: CORE-15554
- Change STACK_TEXT_BUFFER_SIZE to 512.
This commit is contained in:
Katayama Hirofumi MZ 2024-05-06 20:39:26 +09:00 committed by GitHub
parent 0056313e15
commit 521eb0c7c0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -6492,7 +6492,8 @@ GreExtTextOutW(
return bResult;
}
#define STACK_TEXT_BUFFER_SIZE 100
#define STACK_TEXT_BUFFER_SIZE 512
BOOL
APIENTRY
NtGdiExtTextOutW(
@ -6534,7 +6535,7 @@ NtGdiExtTextOutW(
}
/* Check if our local buffer is large enough */
if (BufSize > STACK_TEXT_BUFFER_SIZE)
if (BufSize > sizeof(LocalBuffer))
{
/* It's not, allocate a temp buffer */
Buffer = ExAllocatePoolWithTag(PagedPool, BufSize, GDITAG_TEXT);