Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(221)

Side by Side Diff: core/src/fxge/win32/fx_win32_dib.cpp

Issue 1239313005: Merge to XFA - else after returns. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Fix issues. Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « core/src/fxge/win32/fx_win32_device.cpp ('k') | core/src/fxge/win32/fx_win32_dwrite.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 pDIBitmap = NULL; 146 pDIBitmap = NULL;
147 } 147 }
148 DeleteDC(hDC); 148 DeleteDC(hDC);
149 return pDIBitmap; 149 return pDIBitmap;
150 } 150 }
151 CFX_DIBitmap* CFX_WindowsDIB::LoadDIBitmap(WINDIB_Open_Args_ args) 151 CFX_DIBitmap* CFX_WindowsDIB::LoadDIBitmap(WINDIB_Open_Args_ args)
152 { 152 {
153 CWin32Platform* pPlatform = (CWin32Platform*)CFX_GEModule::Get()->GetPlatfor mData(); 153 CWin32Platform* pPlatform = (CWin32Platform*)CFX_GEModule::Get()->GetPlatfor mData();
154 if (pPlatform->m_GdiplusExt.IsAvailable()) { 154 if (pPlatform->m_GdiplusExt.IsAvailable()) {
155 return pPlatform->m_GdiplusExt.LoadDIBitmap(args); 155 return pPlatform->m_GdiplusExt.LoadDIBitmap(args);
156 } else if (args.flags == WINDIB_OPEN_MEMORY) { 156 }
157 if (args.flags == WINDIB_OPEN_MEMORY) {
157 return NULL; 158 return NULL;
158 } 159 }
159 HBITMAP hBitmap = (HBITMAP)LoadImageW(NULL, (wchar_t*)args.path_name, IMAGE_ BITMAP, 0, 0, LR_LOADFROMFILE); 160 HBITMAP hBitmap = (HBITMAP)LoadImageW(NULL, (wchar_t*)args.path_name, IMAGE_ BITMAP, 0, 0, LR_LOADFROMFILE);
160 if (hBitmap == NULL) { 161 if (hBitmap == NULL) {
161 return NULL; 162 return NULL;
162 } 163 }
163 HDC hDC = CreateCompatibleDC(NULL); 164 HDC hDC = CreateCompatibleDC(NULL);
164 int width, height; 165 int width, height;
165 GetBitmapSize(hBitmap, width, height); 166 GetBitmapSize(hBitmap, width, height);
166 CFX_DIBitmap* pDIBitmap = FX_NEW CFX_DIBitmap; 167 CFX_DIBitmap* pDIBitmap = FX_NEW CFX_DIBitmap;
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
281 } 282 }
282 void CFX_WindowsDIB::LoadFromDevice(HDC hDC, int left, int top) 283 void CFX_WindowsDIB::LoadFromDevice(HDC hDC, int left, int top)
283 { 284 {
284 ::BitBlt(m_hMemDC, 0, 0, m_Width, m_Height, hDC, left, top, SRCCOPY); 285 ::BitBlt(m_hMemDC, 0, 0, m_Width, m_Height, hDC, left, top, SRCCOPY);
285 } 286 }
286 void CFX_WindowsDIB::SetToDevice(HDC hDC, int left, int top) 287 void CFX_WindowsDIB::SetToDevice(HDC hDC, int left, int top)
287 { 288 {
288 ::BitBlt(hDC, left, top, m_Width, m_Height, m_hMemDC, 0, 0, SRCCOPY); 289 ::BitBlt(hDC, left, top, m_Width, m_Height, m_hMemDC, 0, 0, SRCCOPY);
289 } 290 }
290 #endif 291 #endif
OLDNEW
« no previous file with comments | « core/src/fxge/win32/fx_win32_device.cpp ('k') | core/src/fxge/win32/fx_win32_dwrite.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698