fixed a bug that when pentile is set (antialiasmode=6), it's grayscale.

This commit is contained in:
snowie2000 2022-07-21 16:02:23 +08:00
parent a2dd14d9c1
commit 703434272d
3 changed files with 10 additions and 2 deletions

View File

@ -197,7 +197,7 @@ Params::Params() {
// Gamma = pSettings->GammaValue()*pSettings->GammaValue() > 1.3 ? pSettings->GammaValue()*pSettings->GammaValue() / 2 : 0.7f;
EnhancedContrast = pSettings->ContrastForDW();
ClearTypeLevel = pSettings->ClearTypeLevelForDW();
switch (pSettings->GetFontSettings().GetAntiAliasMode())
switch (pSettings->AntiAliasModeForDW())
{
case 2:
case 4:

View File

@ -211,6 +211,8 @@ void CGdippSettings::DelayedInit()
break;
}
}
if (m_FontSettings.GetAntiAliasMode() > 2)
m_FontSettings.SetAntiAliasMode(2); // all non-grayscale panel should use DrawLCD routine as its output.
}
}
else {
@ -505,6 +507,7 @@ bool CGdippSettings::LoadAppSettings(LPCTSTR lpszFile)
fs.SetBoldWeight(_GetFreeTypeProfileBoundInt(_T("BoldWeight"), 0, BWEIGHT_MIN, BWEIGHT_MAX, lpszFile));
fs.SetItalicSlant(_GetFreeTypeProfileBoundInt(_T("ItalicSlant"), 0, SLANT_MIN, SLANT_MAX, lpszFile));
fs.SetKerning(!!_GetFreeTypeProfileInt(_T("EnableKerning"), 0, lpszFile));
m_nAntiAliasModeForDW = fs.GetAntiAliasMode(); // DirectWrite always use the user defined AA mode.
{
TCHAR szShadow[256];
CStringTokenizer token;
@ -1197,7 +1200,9 @@ const CFontSettings& CGdippSettings::FindIndividual(LPCTSTR lpFaceName) const
for(; p != end; ++p) {
if (p->GetHash() == hash) {
return p->GetIndividual();
CFontSettings& result = p->GetIndividual();
if (result.GetAntiAliasMode() > 2 && HarmonyLCD())
result.SetAntiAliasMode(2);
}
}
return GetFontSettings();

View File

@ -307,6 +307,7 @@ private:
float m_fContrastForDW;
float m_fClearTypeLevelForDW;
int m_nRenderingModeForDW;
int m_nAntiAliasModeForDW;
CFontSubstitutesInfo m_FontSubstitutesInfoForDW;
//FTC_Manager_Newに渡すパラメータ
@ -393,6 +394,7 @@ private:
, m_nGammaMode(0)
, m_fGammaValue(1.0f)
, m_fGammaValueForDW(0.0f)
, m_nAntiAliasModeForDW(0)
, m_fRenderWeight(1.0f)
, m_fContrast(1.0f)
, m_nMaxHeight(0)
@ -449,6 +451,7 @@ public:
float ContrastForDW() const { return m_fContrastForDW; }
float ClearTypeLevelForDW() const { return m_fClearTypeLevelForDW; }
int RenderingModeForDW() const { return m_nRenderingModeForDW; }
int AntiAliasModeForDW() const { return m_nAntiAliasModeForDW; }
/*const CFontSubstitutesInfo& GetFontSubstitutesInfoForDW() const
{ _ASSERTE(m_bDelayedInit); return m_FontSubstitutesInfoForDW; }*/