| 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 "../../../include/fxge/fx_dib.h" | 7 #include "../../../include/fxge/fx_dib.h" |
| 8 #include "../../../include/fxge/fx_ge.h" | 8 #include "../../../include/fxge/fx_ge.h" |
| 9 #include "dib_int.h" | 9 #include "dib_int.h" |
| 10 #include <limits.h> | 10 #include <limits.h> |
| (...skipping 747 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 758 { | 758 { |
| 759 if (m_Flags & FXDIB_DOWNSAMPLE) { | 759 if (m_Flags & FXDIB_DOWNSAMPLE) { |
| 760 return ContinueQuickStretch(pPause); | 760 return ContinueQuickStretch(pPause); |
| 761 } else { | 761 } else { |
| 762 return ContinueStretch(pPause); | 762 return ContinueStretch(pPause); |
| 763 } | 763 } |
| 764 } | 764 } |
| 765 #define MAX_PROGRESSIVE_STRETCH_PIXELS 1000000 | 765 #define MAX_PROGRESSIVE_STRETCH_PIXELS 1000000 |
| 766 FX_BOOL CFX_ImageStretcher::StartStretch() | 766 FX_BOOL CFX_ImageStretcher::StartStretch() |
| 767 { | 767 { |
| 768 m_pStretchEngine = FX_NEW CStretchEngine(m_pDest, m_DestFormat, m_DestWidth,
m_DestHeight, m_ClipRect, m_pSource, m_Flags); | 768 m_pStretchEngine = new CStretchEngine(m_pDest, m_DestFormat, m_DestWidth, m_
DestHeight, m_ClipRect, m_pSource, m_Flags); |
| 769 if (!m_pStretchEngine) { | |
| 770 return FALSE; | |
| 771 } | |
| 772 m_pStretchEngine->StartStretchHorz(); | 769 m_pStretchEngine->StartStretchHorz(); |
| 773 if (m_pSource->GetWidth() * m_pSource->GetHeight() < MAX_PROGRESSIVE_STRETCH
_PIXELS) { | 770 if (m_pSource->GetWidth() * m_pSource->GetHeight() < MAX_PROGRESSIVE_STRETCH
_PIXELS) { |
| 774 m_pStretchEngine->Continue(NULL); | 771 m_pStretchEngine->Continue(NULL); |
| 775 return FALSE; | 772 return FALSE; |
| 776 } | 773 } |
| 777 return TRUE; | 774 return TRUE; |
| 778 } | 775 } |
| 779 FX_BOOL CFX_ImageStretcher::ContinueStretch(IFX_Pause* pPause) | 776 FX_BOOL CFX_ImageStretcher::ContinueStretch(IFX_Pause* pPause) |
| 780 { | 777 { |
| 781 if (m_pStretchEngine == NULL) { | 778 if (m_pStretchEngine == NULL) { |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 843 return TRUE; | 840 return TRUE; |
| 844 } | 841 } |
| 845 m_pSource->DownSampleScanline(src_y, m_pScanline, m_DestBPP, m_DestWidth
, m_bFlipX, m_ClipRect.left, result_width); | 842 m_pSource->DownSampleScanline(src_y, m_pScanline, m_DestBPP, m_DestWidth
, m_bFlipX, m_ClipRect.left, result_width); |
| 846 if (m_pMaskScanline) { | 843 if (m_pMaskScanline) { |
| 847 m_pSource->m_pAlphaMask->DownSampleScanline(src_y, m_pMaskScanline,
1, m_DestWidth, m_bFlipX, m_ClipRect.left, result_width); | 844 m_pSource->m_pAlphaMask->DownSampleScanline(src_y, m_pMaskScanline,
1, m_DestWidth, m_bFlipX, m_ClipRect.left, result_width); |
| 848 } | 845 } |
| 849 m_pDest->ComposeScanline(dest_y, m_pScanline, m_pMaskScanline); | 846 m_pDest->ComposeScanline(dest_y, m_pScanline, m_pMaskScanline); |
| 850 } | 847 } |
| 851 return FALSE; | 848 return FALSE; |
| 852 } | 849 } |
| OLD | NEW |