Created
June 3, 2019 17:50
-
-
Save bgrainger/ae266e4b305b83503a852343869a2a68 to your computer and use it in GitHub Desktop.
Improving WPF Text Display Performance
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
HRESULT FontFileStream::ReadFileFragment(const void ** fragmentStart, UINT64 fileOffset, UINT64 fragmentSize, void ** fragmentContext) | |
{ | |
if (fragmentStart != nullptr) | |
*fragmentStart = nullptr; | |
if (fragmentContext != nullptr) | |
*fragmentContext = nullptr; | |
if (fragmentStart == nullptr || fragmentContext == nullptr) | |
return E_POINTER; | |
if (fileOffset >= m_length || fileOffset + fragmentSize > m_length) | |
return E_INVALIDARG; | |
// return a pointer into the memory-mapped font bundle | |
*fragmentStart = static_cast<const void *>(m_data + fileOffset); | |
return S_OK; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment