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 "../../../include/fxge/fx_dib.h" | 9 #include "../../../include/fxge/fx_dib.h" |
10 #include "../../../include/fxge/fx_ge.h" | 10 #include "../../../include/fxge/fx_ge.h" |
(...skipping 822 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
833 if (m_Flags & FXDIB_DOWNSAMPLE) { | 833 if (m_Flags & FXDIB_DOWNSAMPLE) { |
834 return ContinueQuickStretch(pPause); | 834 return ContinueQuickStretch(pPause); |
835 } | 835 } |
836 return ContinueStretch(pPause); | 836 return ContinueStretch(pPause); |
837 } | 837 } |
838 #define MAX_PROGRESSIVE_STRETCH_PIXELS 1000000 | 838 #define MAX_PROGRESSIVE_STRETCH_PIXELS 1000000 |
839 FX_BOOL CFX_ImageStretcher::StartStretch() { | 839 FX_BOOL CFX_ImageStretcher::StartStretch() { |
840 m_pStretchEngine = | 840 m_pStretchEngine = |
841 new CStretchEngine(m_pDest, m_DestFormat, m_DestWidth, m_DestHeight, | 841 new CStretchEngine(m_pDest, m_DestFormat, m_DestWidth, m_DestHeight, |
842 m_ClipRect, m_pSource, m_Flags); | 842 m_ClipRect, m_pSource, m_Flags); |
843 if (!m_pStretchEngine) { | |
844 return FALSE; | |
845 } | |
846 m_pStretchEngine->StartStretchHorz(); | 843 m_pStretchEngine->StartStretchHorz(); |
847 if (m_pSource->GetWidth() * m_pSource->GetHeight() < | 844 if (m_pSource->GetWidth() * m_pSource->GetHeight() < |
848 MAX_PROGRESSIVE_STRETCH_PIXELS) { | 845 MAX_PROGRESSIVE_STRETCH_PIXELS) { |
849 m_pStretchEngine->Continue(NULL); | 846 m_pStretchEngine->Continue(NULL); |
850 return FALSE; | 847 return FALSE; |
851 } | 848 } |
852 return TRUE; | 849 return TRUE; |
853 } | 850 } |
854 FX_BOOL CFX_ImageStretcher::ContinueStretch(IFX_Pause* pPause) { | 851 FX_BOOL CFX_ImageStretcher::ContinueStretch(IFX_Pause* pPause) { |
855 if (m_pStretchEngine == NULL) { | 852 if (m_pStretchEngine == NULL) { |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
914 m_bFlipX, m_ClipRect.left, result_width); | 911 m_bFlipX, m_ClipRect.left, result_width); |
915 if (m_pMaskScanline) { | 912 if (m_pMaskScanline) { |
916 m_pSource->m_pAlphaMask->DownSampleScanline( | 913 m_pSource->m_pAlphaMask->DownSampleScanline( |
917 src_y, m_pMaskScanline, 1, m_DestWidth, m_bFlipX, m_ClipRect.left, | 914 src_y, m_pMaskScanline, 1, m_DestWidth, m_bFlipX, m_ClipRect.left, |
918 result_width); | 915 result_width); |
919 } | 916 } |
920 m_pDest->ComposeScanline(dest_y, m_pScanline, m_pMaskScanline); | 917 m_pDest->ComposeScanline(dest_y, m_pScanline, m_pMaskScanline); |
921 } | 918 } |
922 return FALSE; | 919 return FALSE; |
923 } | 920 } |
OLD | NEW |