| 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 | 10 |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 uint32_t color, | 162 uint32_t color, |
| 163 const CFX_Matrix* pMatrix, | 163 const CFX_Matrix* pMatrix, |
| 164 uint32_t render_flags, | 164 uint32_t render_flags, |
| 165 void*& handle, | 165 void*& handle, |
| 166 int blend_type) { | 166 int blend_type) { |
| 167 if (bitmap_alpha < 255 || pSource->HasAlpha() || | 167 if (bitmap_alpha < 255 || pSource->HasAlpha() || |
| 168 (pSource->IsAlphaMask() && (pSource->GetBPP() != 1))) { | 168 (pSource->IsAlphaMask() && (pSource->GetBPP() != 1))) { |
| 169 return FALSE; | 169 return FALSE; |
| 170 } | 170 } |
| 171 CFX_FloatRect unit_rect = pMatrix->GetUnitRect(); | 171 CFX_FloatRect unit_rect = pMatrix->GetUnitRect(); |
| 172 FX_RECT full_rect = unit_rect.GetOutterRect(); | 172 FX_RECT full_rect = unit_rect.GetOuterRect(); |
| 173 if (FXSYS_fabs(pMatrix->b) < 0.5f && pMatrix->a != 0 && | 173 if (FXSYS_fabs(pMatrix->b) < 0.5f && pMatrix->a != 0 && |
| 174 FXSYS_fabs(pMatrix->c) < 0.5f && pMatrix->d != 0) { | 174 FXSYS_fabs(pMatrix->c) < 0.5f && pMatrix->d != 0) { |
| 175 FX_BOOL bFlipX = pMatrix->a < 0; | 175 FX_BOOL bFlipX = pMatrix->a < 0; |
| 176 FX_BOOL bFlipY = pMatrix->d > 0; | 176 FX_BOOL bFlipY = pMatrix->d > 0; |
| 177 return StretchDIBits(pSource, color, | 177 return StretchDIBits(pSource, color, |
| 178 bFlipX ? full_rect.right : full_rect.left, | 178 bFlipX ? full_rect.right : full_rect.left, |
| 179 bFlipY ? full_rect.bottom : full_rect.top, | 179 bFlipY ? full_rect.bottom : full_rect.top, |
| 180 bFlipX ? -full_rect.Width() : full_rect.Width(), | 180 bFlipX ? -full_rect.Width() : full_rect.Width(), |
| 181 bFlipY ? -full_rect.Height() : full_rect.Height(), | 181 bFlipY ? -full_rect.Height() : full_rect.Height(), |
| 182 nullptr, 0, blend_type); | 182 nullptr, 0, blend_type); |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 309 // Try to get the font and draw again. | 309 // Try to get the font and draw again. |
| 310 g_pdfium_typeface_accessible_func(&lf, wsText.c_str(), nChars); | 310 g_pdfium_typeface_accessible_func(&lf, wsText.c_str(), nChars); |
| 311 return ExtTextOutW(m_hDC, 0, 0, ETO_GLYPH_INDEX, nullptr, wsText.c_str(), | 311 return ExtTextOutW(m_hDC, 0, 0, ETO_GLYPH_INDEX, nullptr, wsText.c_str(), |
| 312 nChars, nullptr); | 312 nChars, nullptr); |
| 313 #else | 313 #else |
| 314 return FALSE; | 314 return FALSE; |
| 315 #endif | 315 #endif |
| 316 } | 316 } |
| 317 | 317 |
| 318 #endif // _FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN64_DESKTOP_ | 318 #endif // _FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN64_DESKTOP_ |
| OLD | NEW |