| 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 "core/fxge/include/fx_ge.h" | 7 #include "core/fxge/include/fx_ge.h" |
| 8 | 8 |
| 9 #if _FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN64_DESKTOP_ | 9 #if _FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN64_DESKTOP_ |
| 10 #include <crtdbg.h> | 10 #include <crtdbg.h> |
| (...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 447 } | 447 } |
| 448 // Select the fallback font information class if GDI is disabled. | 448 // Select the fallback font information class if GDI is disabled. |
| 449 CFX_Win32FallbackFontInfo* pInfoFallback = new CFX_Win32FallbackFontInfo; | 449 CFX_Win32FallbackFontInfo* pInfoFallback = new CFX_Win32FallbackFontInfo; |
| 450 // Construct the font path manually, SHGetKnownFolderPath won't work under | 450 // Construct the font path manually, SHGetKnownFolderPath won't work under |
| 451 // a restrictive sandbox. | 451 // a restrictive sandbox. |
| 452 CHAR windows_path[MAX_PATH] = {}; | 452 CHAR windows_path[MAX_PATH] = {}; |
| 453 DWORD path_len = ::GetWindowsDirectoryA(windows_path, MAX_PATH); | 453 DWORD path_len = ::GetWindowsDirectoryA(windows_path, MAX_PATH); |
| 454 if (path_len > 0 && path_len < MAX_PATH) { | 454 if (path_len > 0 && path_len < MAX_PATH) { |
| 455 CFX_ByteString fonts_path(windows_path); | 455 CFX_ByteString fonts_path(windows_path); |
| 456 fonts_path += "\\Fonts"; | 456 fonts_path += "\\Fonts"; |
| 457 pInfoFallback->AddPath(fonts_path.AsByteStringC()); | 457 pInfoFallback->AddPath(fonts_path.AsStringC()); |
| 458 } | 458 } |
| 459 return pInfoFallback; | 459 return pInfoFallback; |
| 460 } | 460 } |
| 461 void CFX_GEModule::InitPlatform() { | 461 void CFX_GEModule::InitPlatform() { |
| 462 CWin32Platform* pPlatformData = new CWin32Platform; | 462 CWin32Platform* pPlatformData = new CWin32Platform; |
| 463 OSVERSIONINFO ver; | 463 OSVERSIONINFO ver; |
| 464 ver.dwOSVersionInfoSize = sizeof(ver); | 464 ver.dwOSVersionInfoSize = sizeof(ver); |
| 465 GetVersionEx(&ver); | 465 GetVersionEx(&ver); |
| 466 pPlatformData->m_bHalfTone = ver.dwMajorVersion >= 5; | 466 pPlatformData->m_bHalfTone = ver.dwMajorVersion >= 5; |
| 467 if (IsGDIEnabled()) { | 467 if (IsGDIEnabled()) { |
| (...skipping 889 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1357 SelectObject(m_hDC, m_hOldBitmap); | 1357 SelectObject(m_hDC, m_hOldBitmap); |
| 1358 DeleteDC(m_hDC); | 1358 DeleteDC(m_hDC); |
| 1359 } | 1359 } |
| 1360 if (m_hBitmap) { | 1360 if (m_hBitmap) { |
| 1361 DeleteObject(m_hBitmap); | 1361 DeleteObject(m_hBitmap); |
| 1362 } | 1362 } |
| 1363 delete GetBitmap(); | 1363 delete GetBitmap(); |
| 1364 } | 1364 } |
| 1365 | 1365 |
| 1366 #endif // _FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN64_ | 1366 #endif // _FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN64_ |
| OLD | NEW |