| OLD | NEW |
| 1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
| 6 | 6 |
| 7 #include "../../../include/fxge/fx_ge.h" | 7 #include "../../../include/fxge/fx_ge.h" |
| 8 #include "text_int.h" | 8 #include "text_int.h" |
| 9 static CFX_GEModule* g_pGEModule = NULL; | 9 static CFX_GEModule* g_pGEModule = NULL; |
| 10 CFX_GEModule::CFX_GEModule() | 10 CFX_GEModule::CFX_GEModule() |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 if (m_pFontCache == NULL) { | 57 if (m_pFontCache == NULL) { |
| 58 m_pFontCache = FX_NEW CFX_FontCache(); | 58 m_pFontCache = FX_NEW CFX_FontCache(); |
| 59 } | 59 } |
| 60 return m_pFontCache; | 60 return m_pFontCache; |
| 61 } | 61 } |
| 62 void CFX_GEModule::SetTextGamma(FX_FLOAT gammaValue) | 62 void CFX_GEModule::SetTextGamma(FX_FLOAT gammaValue) |
| 63 { | 63 { |
| 64 gammaValue /= 2.2f; | 64 gammaValue /= 2.2f; |
| 65 int i = 0; | 65 int i = 0; |
| 66 while (i < 256) { | 66 while (i < 256) { |
| 67 m_GammaValue[i] = (FX_BYTE)(FXSYS_pow((FX_FLOAT)i / 255, gammaValue) * 2
55.0f + 0.5f); | 67 m_GammaValue[i] = (uint8_t)(FXSYS_pow((FX_FLOAT)i / 255, gammaValue) * 2
55.0f + 0.5f); |
| 68 i++; | 68 i++; |
| 69 } | 69 } |
| 70 } | 70 } |
| 71 FX_LPCBYTE CFX_GEModule::GetTextGammaTable() | 71 FX_LPCBYTE CFX_GEModule::GetTextGammaTable() |
| 72 { | 72 { |
| 73 return m_GammaValue; | 73 return m_GammaValue; |
| 74 } | 74 } |
| 75 void CFX_GEModule::SetExtFontMapper(IFX_FontMapper* pFontMapper) | 75 void CFX_GEModule::SetExtFontMapper(IFX_FontMapper* pFontMapper) |
| 76 { | 76 { |
| 77 GetFontMgr()->m_pExtMapper = pFontMapper; | 77 GetFontMgr()->m_pExtMapper = pFontMapper; |
| 78 pFontMapper->m_pFontMgr = m_pFontMgr; | 78 pFontMapper->m_pFontMgr = m_pFontMgr; |
| 79 } | 79 } |
| OLD | NEW |