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 912 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
923 return StartStretch(); | 923 return StartStretch(); |
924 } | 924 } |
925 | 925 |
926 FX_BOOL CFX_ImageStretcher::Continue(IFX_Pause* pPause) { | 926 FX_BOOL CFX_ImageStretcher::Continue(IFX_Pause* pPause) { |
927 if (m_Flags & FXDIB_DOWNSAMPLE) | 927 if (m_Flags & FXDIB_DOWNSAMPLE) |
928 return ContinueQuickStretch(pPause); | 928 return ContinueQuickStretch(pPause); |
929 return ContinueStretch(pPause); | 929 return ContinueStretch(pPause); |
930 } | 930 } |
931 | 931 |
932 FX_BOOL CFX_ImageStretcher::StartStretch() { | 932 FX_BOOL CFX_ImageStretcher::StartStretch() { |
933 m_pStretchEngine.reset(new CStretchEngine(m_pDest, m_DestFormat, m_DestWidth, | 933 m_pStretchEngine = WrapUnique( |
934 m_DestHeight, m_ClipRect, m_pSource, | 934 new CStretchEngine(m_pDest, m_DestFormat, m_DestWidth, m_DestHeight, |
935 m_Flags)); | 935 m_ClipRect, m_pSource, m_Flags)); |
936 m_pStretchEngine->StartStretchHorz(); | 936 m_pStretchEngine->StartStretchHorz(); |
937 if (SourceSizeWithinLimit(m_pSource->GetWidth(), m_pSource->GetHeight())) { | 937 if (SourceSizeWithinLimit(m_pSource->GetWidth(), m_pSource->GetHeight())) { |
938 m_pStretchEngine->Continue(nullptr); | 938 m_pStretchEngine->Continue(nullptr); |
939 return FALSE; | 939 return FALSE; |
940 } | 940 } |
941 return TRUE; | 941 return TRUE; |
942 } | 942 } |
943 | 943 |
944 FX_BOOL CFX_ImageStretcher::ContinueStretch(IFX_Pause* pPause) { | 944 FX_BOOL CFX_ImageStretcher::ContinueStretch(IFX_Pause* pPause) { |
945 return m_pStretchEngine && m_pStretchEngine->Continue(pPause); | 945 return m_pStretchEngine && m_pStretchEngine->Continue(pPause); |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
998 result_width); | 998 result_width); |
999 if (m_pMaskScanline) { | 999 if (m_pMaskScanline) { |
1000 m_pSource->m_pAlphaMask->DownSampleScanline( | 1000 m_pSource->m_pAlphaMask->DownSampleScanline( |
1001 src_y, m_pMaskScanline.get(), 1, m_DestWidth, m_bFlipX, | 1001 src_y, m_pMaskScanline.get(), 1, m_DestWidth, m_bFlipX, |
1002 m_ClipRect.left, result_width); | 1002 m_ClipRect.left, result_width); |
1003 } | 1003 } |
1004 m_pDest->ComposeScanline(dest_y, m_pScanline.get(), m_pMaskScanline.get()); | 1004 m_pDest->ComposeScanline(dest_y, m_pScanline.get(), m_pMaskScanline.get()); |
1005 } | 1005 } |
1006 return FALSE; | 1006 return FALSE; |
1007 } | 1007 } |
OLD | NEW |