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 <limits.h> | 7 #include <limits.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 | 10 |
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
299 m_ExtraMaskPitch = (m_DestClip.Width() * 8 + 31) / 32 * 4; | 299 m_ExtraMaskPitch = (m_DestClip.Width() * 8 + 31) / 32 * 4; |
300 m_pInterBuf = nullptr; | 300 m_pInterBuf = nullptr; |
301 m_pSource = pSrcBitmap; | 301 m_pSource = pSrcBitmap; |
302 m_SrcWidth = pSrcBitmap->GetWidth(); | 302 m_SrcWidth = pSrcBitmap->GetWidth(); |
303 m_SrcHeight = pSrcBitmap->GetHeight(); | 303 m_SrcHeight = pSrcBitmap->GetHeight(); |
304 m_SrcPitch = (m_SrcWidth * m_SrcBpp + 31) / 32 * 4; | 304 m_SrcPitch = (m_SrcWidth * m_SrcBpp + 31) / 32 * 4; |
305 if ((flags & FXDIB_NOSMOOTH) == 0) { | 305 if ((flags & FXDIB_NOSMOOTH) == 0) { |
306 FX_BOOL bInterpol = | 306 FX_BOOL bInterpol = |
307 flags & FXDIB_INTERPOL || flags & FXDIB_BICUBIC_INTERPOL; | 307 flags & FXDIB_INTERPOL || flags & FXDIB_BICUBIC_INTERPOL; |
308 if (!bInterpol && FXSYS_abs(dest_width) != 0 && | 308 if (!bInterpol && FXSYS_abs(dest_width) != 0 && |
309 FXSYS_abs(dest_height) < | 309 FXSYS_abs(dest_height) / 8 < static_cast<long long>(m_SrcWidth) * |
310 m_SrcWidth * m_SrcHeight * 8 / FXSYS_abs(dest_width)) { | 310 m_SrcHeight / FXSYS_abs(dest_width)) { |
311 flags = FXDIB_INTERPOL; | 311 flags = FXDIB_INTERPOL; |
312 } | 312 } |
313 m_Flags = flags; | 313 m_Flags = flags; |
314 } else { | 314 } else { |
315 m_Flags = FXDIB_NOSMOOTH; | 315 m_Flags = FXDIB_NOSMOOTH; |
316 if (flags & FXDIB_DOWNSAMPLE) { | 316 if (flags & FXDIB_DOWNSAMPLE) { |
317 m_Flags |= FXDIB_DOWNSAMPLE; | 317 m_Flags |= FXDIB_DOWNSAMPLE; |
318 } | 318 } |
319 } | 319 } |
320 double scale_x = (FX_FLOAT)m_SrcWidth / (FX_FLOAT)m_DestWidth; | 320 double scale_x = (FX_FLOAT)m_SrcWidth / (FX_FLOAT)m_DestWidth; |
(...skipping 673 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
994 result_width); | 994 result_width); |
995 if (m_pMaskScanline) { | 995 if (m_pMaskScanline) { |
996 m_pSource->m_pAlphaMask->DownSampleScanline( | 996 m_pSource->m_pAlphaMask->DownSampleScanline( |
997 src_y, m_pMaskScanline.get(), 1, m_DestWidth, m_bFlipX, | 997 src_y, m_pMaskScanline.get(), 1, m_DestWidth, m_bFlipX, |
998 m_ClipRect.left, result_width); | 998 m_ClipRect.left, result_width); |
999 } | 999 } |
1000 m_pDest->ComposeScanline(dest_y, m_pScanline.get(), m_pMaskScanline.get()); | 1000 m_pDest->ComposeScanline(dest_y, m_pScanline.get(), m_pMaskScanline.get()); |
1001 } | 1001 } |
1002 return FALSE; | 1002 return FALSE; |
1003 } | 1003 } |
OLD | NEW |