-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix CGlyphRunResource::GetDWriteRenderingMode to choose correct DWriteRenderingMode under ClearType #2668
Conversation
…on of the suggested rendering mode from DWrite when TextRenderingMode is set to ClearType.
~Do we still support Windows Server 2008 R2? ~ Never mind - GetRecommendedRenderingMode is supported there anyway. |
Can you explain what that has to do with this change? We will only choose symmetric if DWrite itself chooses symmetric. It's not obvious, but |
I rushed into the question thinking it was new call and may not be supported on some platforms; and then realized it has been used before all along. |
All good, there are other things I am looking into that actually do have a Win8+ requirement. But those would have to be a separate PR and would be much more extensive and invasive. If that actually becomes a thing we need to have a discussion about what we're willing to change in the rendering process to fully support them. I'll file a different issue altogether. |
LGTM; low pri - can you add some comments about how a sample app might exercise each of the branches in GetDWriteRenderingMode (including the last dangling else with just an assert)? It would be helpful when writing tests for this, I think (or debugging problems...) |
Sure, I can add that. |
I am going to wait on merging this anyway until I get some more info on how effective this change will be. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your code calls DWrite and ignores the result in many cases. I'd prefer only calling DWrite if there's a chance of using the result, to avoid needless perf and risk. It should be easy enough to do, starting with changing old line 970-1 to
if ( (textRenderingMode == Grayscale) ||
((textRenderingMode == ClearType && IsDisplayMeasured()))
I did a run of all text DRTs and microsuites and everything passed. I'm suspicious that we don't have certain parts of this coverage ported for .NET Core. Before I merge this I am going to make the equivalent changes to .NET Framework and get a full pass done there. |
@rladuca changing title to WIP to prevent accidental merge. |
Full test run is back and everything looks good, merging. |
Fixes #2025