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

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

Issue 1243953004: Re-land else-after-returns (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: 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 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
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