| 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 #if _FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN64_DESKTOP_ | 8 #if _FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN64_DESKTOP_ |
| 9 #include <windows.h> | 9 #include <windows.h> |
| 10 #include "../../../include/fxge/fx_ge_win32.h" | 10 #include "../../../include/fxge/fx_ge_win32.h" |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 pDIBitmap = NULL; | 139 pDIBitmap = NULL; |
| 140 } | 140 } |
| 141 DeleteDC(hDC); | 141 DeleteDC(hDC); |
| 142 return pDIBitmap; | 142 return pDIBitmap; |
| 143 } | 143 } |
| 144 CFX_DIBitmap* CFX_WindowsDIB::LoadDIBitmap(WINDIB_Open_Args_ args) | 144 CFX_DIBitmap* CFX_WindowsDIB::LoadDIBitmap(WINDIB_Open_Args_ args) |
| 145 { | 145 { |
| 146 CWin32Platform* pPlatform = (CWin32Platform*)CFX_GEModule::Get()->GetPlatfor
mData(); | 146 CWin32Platform* pPlatform = (CWin32Platform*)CFX_GEModule::Get()->GetPlatfor
mData(); |
| 147 if (pPlatform->m_GdiplusExt.IsAvailable()) { | 147 if (pPlatform->m_GdiplusExt.IsAvailable()) { |
| 148 return pPlatform->m_GdiplusExt.LoadDIBitmap(args); | 148 return pPlatform->m_GdiplusExt.LoadDIBitmap(args); |
| 149 } else if (args.flags == WINDIB_OPEN_MEMORY) { | 149 } |
| 150 if (args.flags == WINDIB_OPEN_MEMORY) { |
| 150 return NULL; | 151 return NULL; |
| 151 } | 152 } |
| 152 HBITMAP hBitmap = (HBITMAP)LoadImageW(NULL, (wchar_t*)args.path_name, IMAGE_
BITMAP, 0, 0, LR_LOADFROMFILE); | 153 HBITMAP hBitmap = (HBITMAP)LoadImageW(NULL, (wchar_t*)args.path_name, IMAGE_
BITMAP, 0, 0, LR_LOADFROMFILE); |
| 153 if (hBitmap == NULL) { | 154 if (hBitmap == NULL) { |
| 154 return NULL; | 155 return NULL; |
| 155 } | 156 } |
| 156 HDC hDC = CreateCompatibleDC(NULL); | 157 HDC hDC = CreateCompatibleDC(NULL); |
| 157 int width, height; | 158 int width, height; |
| 158 GetBitmapSize(hBitmap, width, height); | 159 GetBitmapSize(hBitmap, width, height); |
| 159 CFX_DIBitmap* pDIBitmap = new CFX_DIBitmap; | 160 CFX_DIBitmap* pDIBitmap = new CFX_DIBitmap; |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 267 } | 268 } |
| 268 void CFX_WindowsDIB::LoadFromDevice(HDC hDC, int left, int top) | 269 void CFX_WindowsDIB::LoadFromDevice(HDC hDC, int left, int top) |
| 269 { | 270 { |
| 270 ::BitBlt(m_hMemDC, 0, 0, m_Width, m_Height, hDC, left, top, SRCCOPY); | 271 ::BitBlt(m_hMemDC, 0, 0, m_Width, m_Height, hDC, left, top, SRCCOPY); |
| 271 } | 272 } |
| 272 void CFX_WindowsDIB::SetToDevice(HDC hDC, int left, int top) | 273 void CFX_WindowsDIB::SetToDevice(HDC hDC, int left, int top) |
| 273 { | 274 { |
| 274 ::BitBlt(hDC, left, top, m_Width, m_Height, m_hMemDC, 0, 0, SRCCOPY); | 275 ::BitBlt(hDC, left, top, m_Width, m_Height, m_hMemDC, 0, 0, SRCCOPY); |
| 275 } | 276 } |
| 276 #endif | 277 #endif |
| OLD | NEW |