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 <windows.h> | 10 #include <windows.h> |
(...skipping 655 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
666 } | 666 } |
667 Point destinationPoints[] = {Point(dest_left, dest_top), | 667 Point destinationPoints[] = {Point(dest_left, dest_top), |
668 Point(dest_left + dest_width, dest_top), | 668 Point(dest_left + dest_width, dest_top), |
669 Point(dest_left, dest_top + dest_height)}; | 669 Point(dest_left, dest_top + dest_height)}; |
670 CallFunc(GdipDrawImagePointsI)(pGraphics, bitmap, destinationPoints, 3); | 670 CallFunc(GdipDrawImagePointsI)(pGraphics, bitmap, destinationPoints, 3); |
671 CallFunc(GdipDisposeImage)(bitmap); | 671 CallFunc(GdipDisposeImage)(bitmap); |
672 } | 672 } |
673 CGdiplusExt::CGdiplusExt() { | 673 CGdiplusExt::CGdiplusExt() { |
674 m_hModule = NULL; | 674 m_hModule = NULL; |
675 m_GdiModule = NULL; | 675 m_GdiModule = NULL; |
676 for (int i = 0; i < sizeof g_GdipFuncNames / sizeof(LPCSTR); i++) { | 676 for (size_t i = 0; i < sizeof g_GdipFuncNames / sizeof(LPCSTR); i++) { |
677 m_Functions[i] = NULL; | 677 m_Functions[i] = NULL; |
678 } | 678 } |
679 m_pGdiAddFontMemResourceEx = NULL; | 679 m_pGdiAddFontMemResourceEx = NULL; |
680 m_pGdiRemoveFontMemResourseEx = NULL; | 680 m_pGdiRemoveFontMemResourseEx = NULL; |
681 } | 681 } |
682 void CGdiplusExt::Load() { | 682 void CGdiplusExt::Load() { |
683 CFX_ByteString strPlusPath = ""; | 683 CFX_ByteString strPlusPath = ""; |
684 FX_CHAR buf[MAX_PATH]; | 684 FX_CHAR buf[MAX_PATH]; |
685 GetSystemDirectoryA(buf, MAX_PATH); | 685 GetSystemDirectoryA(buf, MAX_PATH); |
686 strPlusPath += buf; | 686 strPlusPath += buf; |
687 strPlusPath += "\\"; | 687 strPlusPath += "\\"; |
688 strPlusPath += "GDIPLUS.DLL"; | 688 strPlusPath += "GDIPLUS.DLL"; |
689 m_hModule = LoadLibraryA(strPlusPath.c_str()); | 689 m_hModule = LoadLibraryA(strPlusPath.c_str()); |
690 if (!m_hModule) { | 690 if (!m_hModule) { |
691 return; | 691 return; |
692 } | 692 } |
693 for (int i = 0; i < sizeof g_GdipFuncNames / sizeof(LPCSTR); i++) { | 693 for (size_t i = 0; i < sizeof g_GdipFuncNames / sizeof(LPCSTR); i++) { |
694 m_Functions[i] = GetProcAddress(m_hModule, g_GdipFuncNames[i]); | 694 m_Functions[i] = GetProcAddress(m_hModule, g_GdipFuncNames[i]); |
695 if (!m_Functions[i]) { | 695 if (!m_Functions[i]) { |
696 m_hModule = NULL; | 696 m_hModule = NULL; |
697 return; | 697 return; |
698 } | 698 } |
699 } | 699 } |
700 uintptr_t gdiplusToken; | 700 uintptr_t gdiplusToken; |
701 GdiplusStartupInput gdiplusStartupInput; | 701 GdiplusStartupInput gdiplusStartupInput; |
702 ((FuncType_GdiplusStartup)m_Functions[FuncId_GdiplusStartup])( | 702 ((FuncType_GdiplusStartup)m_Functions[FuncId_GdiplusStartup])( |
703 &gdiplusToken, &gdiplusStartupInput, NULL); | 703 &gdiplusToken, &gdiplusStartupInput, NULL); |
(...skipping 805 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1509 dest_pitch); | 1509 dest_pitch); |
1510 } | 1510 } |
1511 } | 1511 } |
1512 CFX_DIBitmap* pDIBitmap = _FX_WindowsDIB_LoadFromBuf( | 1512 CFX_DIBitmap* pDIBitmap = _FX_WindowsDIB_LoadFromBuf( |
1513 pInfo->pbmi, pData, pInfo->pbmi->bmiHeader.biBitCount == 32); | 1513 pInfo->pbmi, pData, pInfo->pbmi->bmiHeader.biBitCount == 32); |
1514 FX_Free(pData); | 1514 FX_Free(pData); |
1515 FreeDIBitmap(pInfo); | 1515 FreeDIBitmap(pInfo); |
1516 return pDIBitmap; | 1516 return pDIBitmap; |
1517 } | 1517 } |
1518 #endif | 1518 #endif |
OLD | NEW |