fixed chrome crash bug

added a new GammaValueDW param which only valid for DW tweak.
This commit is contained in:
MacType 2016-09-04 13:53:36 +08:00
parent f17511494f
commit fe046debfe
3 changed files with 8 additions and 3 deletions

View File

@ -63,10 +63,11 @@ bool MakeD2DParams(IDWriteFactory* dw_factory)
dw_factory = pDWriteFactory;
}
const CGdippSettings* pSettings = CGdippSettings::GetInstance();
const CGdippSettings* pSettings = CGdippSettings::GetInstanceNoInit();
//
g_D2DParams.Gamma = pSettings->GammaValue()*pSettings->GammaValue() > 1.3 ? pSettings->GammaValue()*pSettings->GammaValue() / 2 : 0.7f;
g_D2DParams.Gamma = pSettings->GammaValueForDW(); //user defined value preferred.
if (g_D2DParams.Gamma == 0)
g_D2DParams.Gamma = pSettings->GammaValue()*pSettings->GammaValue() > 1.3 ? pSettings->GammaValue()*pSettings->GammaValue() / 2 : 0.7f;
g_D2DParams.EnhancedContrast = 0.5f;
g_D2DParams.ClearTypeLevel = 1.0f;
switch (pSettings->GetFontSettings().GetAntiAliasMode())

View File

@ -364,6 +364,7 @@ SKIP:
m_nBolderMode = _GetFreeTypeProfileInt(_T("BolderMode"), 0, lpszFile);
m_nGammaMode = _GetFreeTypeProfileInt(_T("GammaMode"), -1, lpszFile);
m_fGammaValue = _GetFreeTypeProfileBoundFloat(_T("GammaValue"), 1.0f, GAMMAVALUE_MIN, GAMMAVALUE_MAX, lpszFile);
m_fGammaValueForDW = _GetFreeTypeProfileBoundFloat(_T("GammaValueDW"), 0.0f, 0, GAMMAVALUE_MAX, lpszFile);
m_fRenderWeight = _GetFreeTypeProfileBoundFloat(_T("RenderWeight"), 1.0f, RENDERWEIGHT_MIN, RENDERWEIGHT_MAX, lpszFile);
m_fContrast = _GetFreeTypeProfileBoundFloat(_T("Contrast"), 1.0f, CONTRAST_MIN, CONTRAST_MAX, lpszFile);
#ifdef _DEBUG

View File

@ -254,6 +254,7 @@ private:
int m_nBolderMode;
int m_nGammaMode;
float m_fGammaValue;
float m_fGammaValueForDW;
float m_fRenderWeight;
float m_fContrast;
int m_nMaxHeight;
@ -345,6 +346,7 @@ private:
, m_nBolderMode(0)
, m_nGammaMode(0)
, m_fGammaValue(1.0f)
, m_fGammaValueForDW(0.0f)
, m_fRenderWeight(1.0f)
, m_fContrast(1.0f)
, m_nMaxHeight(0)
@ -391,6 +393,7 @@ public:
int BolderMode() const { return m_nBolderMode; }
int GammaMode() const { return m_nGammaMode; }
float GammaValue() const { return m_fGammaValue; }
float GammaValueForDW() const { return m_fGammaValueForDW; }
float RenderWeight() const { return m_fRenderWeight; }
float Contrast() const { return m_fContrast; }
int MaxHeight() const { return m_nMaxHeight; }