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

Side by Side Diff: core/src/fxge/win32/fx_win32_print.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_gdipext.cpp ('k') | fpdfsdk/src/formfiller/FFL_ComboBox.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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 FX_BOOL ret = GDI_StretchBitMask(pFlipped, dest_left, dest_top, abs( dest_width), abs(dest_height), color, flags, alpha_flag, pIccTransform); 73 FX_BOOL ret = GDI_StretchBitMask(pFlipped, dest_left, dest_top, abs( dest_width), abs(dest_height), color, flags, alpha_flag, pIccTransform);
74 delete pFlipped; 74 delete pFlipped;
75 return ret; 75 return ret;
76 } 76 }
77 CFX_DIBExtractor temp(pSource); 77 CFX_DIBExtractor temp(pSource);
78 CFX_DIBitmap* pBitmap = temp; 78 CFX_DIBitmap* pBitmap = temp;
79 if (pBitmap == NULL) { 79 if (pBitmap == NULL) {
80 return FALSE; 80 return FALSE;
81 } 81 }
82 return GDI_StretchBitMask(pBitmap, dest_left, dest_top, dest_width, dest _height, color, flags, alpha_flag, pIccTransform); 82 return GDI_StretchBitMask(pBitmap, dest_left, dest_top, dest_width, dest _height, color, flags, alpha_flag, pIccTransform);
83 } else { 83 }
84 ASSERT(pSource != NULL); 84 if (pSource->HasAlpha()) {
85 if (pSource->HasAlpha()) { 85 return FALSE;
86 }
87 if (dest_width < 0 || dest_height < 0) {
88 CFX_DIBitmap* pFlipped = pSource->FlipImage(dest_width < 0, dest_height < 0);
89 if (pFlipped == NULL) {
86 return FALSE; 90 return FALSE;
87 } 91 }
88 if (dest_width < 0 || dest_height < 0) { 92 if (dest_width < 0) {
89 CFX_DIBitmap* pFlipped = pSource->FlipImage(dest_width < 0, dest_hei ght < 0); 93 dest_left += dest_width;
90 if (pFlipped == NULL) {
91 return FALSE;
92 }
93 if (dest_width < 0) {
94 dest_left += dest_width;
95 }
96 if (dest_height < 0) {
97 dest_top += dest_height;
98 }
99 FX_BOOL ret = GDI_StretchDIBits(pFlipped, dest_left, dest_top, abs(d est_width), abs(dest_height), flags, pIccTransform);
100 delete pFlipped;
101 return ret;
102 } 94 }
103 CFX_DIBExtractor temp(pSource); 95 if (dest_height < 0) {
104 CFX_DIBitmap* pBitmap = temp; 96 dest_top += dest_height;
105 if (pBitmap == NULL) {
106 return FALSE;
107 } 97 }
108 return GDI_StretchDIBits(pBitmap, dest_left, dest_top, dest_width, dest_ height, flags, pIccTransform); 98 FX_BOOL ret = GDI_StretchDIBits(pFlipped, dest_left, dest_top, abs(dest_ width), abs(dest_height), flags, pIccTransform);
99 delete pFlipped;
100 return ret;
109 } 101 }
102 CFX_DIBExtractor temp(pSource);
103 CFX_DIBitmap* pBitmap = temp;
104 if (pBitmap == NULL) {
105 return FALSE;
106 }
107 return GDI_StretchDIBits(pBitmap, dest_left, dest_top, dest_width, dest_heig ht, flags, pIccTransform);
110 } 108 }
111 static CFX_DIBitmap* Transform1bppBitmap(const CFX_DIBSource* pSrc, const CFX_Af fineMatrix* pDestMatrix) 109 static CFX_DIBitmap* Transform1bppBitmap(const CFX_DIBSource* pSrc, const CFX_Af fineMatrix* pDestMatrix)
112 { 110 {
113 ASSERT(pSrc->GetFormat() == FXDIB_1bppRgb || pSrc->GetFormat() == FXDIB_1bpp Mask || pSrc->GetFormat() == FXDIB_1bppCmyk); 111 ASSERT(pSrc->GetFormat() == FXDIB_1bppRgb || pSrc->GetFormat() == FXDIB_1bpp Mask || pSrc->GetFormat() == FXDIB_1bppCmyk);
114 CFX_FloatRect unit_rect = pDestMatrix->GetUnitRect(); 112 CFX_FloatRect unit_rect = pDestMatrix->GetUnitRect();
115 FX_RECT full_rect = unit_rect.GetOutterRect(); 113 FX_RECT full_rect = unit_rect.GetOutterRect();
116 int full_left = full_rect.left; 114 int full_left = full_rect.left;
117 int full_top = full_rect.top; 115 int full_top = full_rect.top;
118 CFX_DIBExtractor src_bitmap(pSrc); 116 CFX_DIBExtractor src_bitmap(pSrc);
119 CFX_DIBitmap* pSrcBitmap = src_bitmap; 117 CFX_DIBitmap* pSrcBitmap = src_bitmap;
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after
403 handle = NULL; 401 handle = NULL;
404 return m_PSRenderer.DrawDIBits(pBitmap, color, pMatrix, render_flags, alpha_ flag, pIccTransform); 402 return m_PSRenderer.DrawDIBits(pBitmap, color, pMatrix, render_flags, alpha_ flag, pIccTransform);
405 } 403 }
406 FX_BOOL CPSPrinterDriver::DrawDeviceText(int nChars, const FXTEXT_CHARPOS* pChar Pos, CFX_Font* pFont, 404 FX_BOOL CPSPrinterDriver::DrawDeviceText(int nChars, const FXTEXT_CHARPOS* pChar Pos, CFX_Font* pFont,
407 CFX_FontCache* pCache, const CFX_AffineMatrix* pObject2Device, FX_FLOAT font_size, FX_DWORD color, 405 CFX_FontCache* pCache, const CFX_AffineMatrix* pObject2Device, FX_FLOAT font_size, FX_DWORD color,
408 int alpha_flag, void* pIccTransform) 406 int alpha_flag, void* pIccTransform)
409 { 407 {
410 return m_PSRenderer.DrawText(nChars, pCharPos, pFont, pCache, pObject2Device , font_size, color, alpha_flag, pIccTransform); 408 return m_PSRenderer.DrawText(nChars, pCharPos, pFont, pCache, pObject2Device , font_size, color, alpha_flag, pIccTransform);
411 } 409 }
412 #endif 410 #endif
OLDNEW
« no previous file with comments | « core/src/fxge/win32/fx_win32_gdipext.cpp ('k') | fpdfsdk/src/formfiller/FFL_ComboBox.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698