| 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 |
| 11 #include "core/fxge/dib/dib_int.h" | 11 #include "core/fxge/dib/dib_int.h" |
| 12 #include "core/fxge/include/fx_dib.h" | 12 #include "core/fxge/include/fx_dib.h" |
| 13 #include "core/fxge/include/fx_ge.h" | |
| 14 | 13 |
| 15 namespace { | 14 namespace { |
| 16 | 15 |
| 17 bool SourceSizeWithinLimit(int width, int height) { | 16 bool SourceSizeWithinLimit(int width, int height) { |
| 18 const int kMaxProgressiveStretchPixels = 1000000; | 17 const int kMaxProgressiveStretchPixels = 1000000; |
| 19 return !height || width < kMaxProgressiveStretchPixels / height; | 18 return !height || width < kMaxProgressiveStretchPixels / height; |
| 20 } | 19 } |
| 21 | 20 |
| 22 FXDIB_Format GetStretchedFormat(const CFX_DIBSource& src) { | 21 FXDIB_Format GetStretchedFormat(const CFX_DIBSource& src) { |
| 23 FXDIB_Format format = src.GetFormat(); | 22 FXDIB_Format format = src.GetFormat(); |
| (...skipping 971 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 995 result_width); | 994 result_width); |
| 996 if (m_pMaskScanline) { | 995 if (m_pMaskScanline) { |
| 997 m_pSource->m_pAlphaMask->DownSampleScanline( | 996 m_pSource->m_pAlphaMask->DownSampleScanline( |
| 998 src_y, m_pMaskScanline.get(), 1, m_DestWidth, m_bFlipX, | 997 src_y, m_pMaskScanline.get(), 1, m_DestWidth, m_bFlipX, |
| 999 m_ClipRect.left, result_width); | 998 m_ClipRect.left, result_width); |
| 1000 } | 999 } |
| 1001 m_pDest->ComposeScanline(dest_y, m_pScanline.get(), m_pMaskScanline.get()); | 1000 m_pDest->ComposeScanline(dest_y, m_pScanline.get(), m_pMaskScanline.get()); |
| 1002 } | 1001 } |
| 1003 return FALSE; | 1002 return FALSE; |
| 1004 } | 1003 } |
| OLD | NEW |