| 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 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 309 FX_BOOL CStretchEngine::StartStretchHorz() | 309 FX_BOOL CStretchEngine::StartStretchHorz() |
| 310 { | 310 { |
| 311 if (m_DestWidth == 0 || m_pDestScanline == NULL || m_SrcClip.Height() > (int
)((1U << 29) / m_InterPitch) || m_SrcClip.Height() == 0) { | 311 if (m_DestWidth == 0 || m_pDestScanline == NULL || m_SrcClip.Height() > (int
)((1U << 29) / m_InterPitch) || m_SrcClip.Height() == 0) { |
| 312 return FALSE; | 312 return FALSE; |
| 313 } | 313 } |
| 314 m_pInterBuf = FX_TryAlloc(unsigned char, m_SrcClip.Height() * m_InterPitch); | 314 m_pInterBuf = FX_TryAlloc(unsigned char, m_SrcClip.Height() * m_InterPitch); |
| 315 if (m_pInterBuf == NULL) { | 315 if (m_pInterBuf == NULL) { |
| 316 return FALSE; | 316 return FALSE; |
| 317 } | 317 } |
| 318 if (m_pSource && m_bHasAlpha && m_pSource->m_pAlphaMask) { | 318 if (m_pSource && m_bHasAlpha && m_pSource->m_pAlphaMask) { |
| 319 m_pExtraAlphaBuf = FX_Alloc(unsigned char, m_SrcClip.Height() * m_ExtraM
askPitch); | 319 m_pExtraAlphaBuf = FX_Alloc2D(unsigned char, m_SrcClip.Height(), m_Extra
MaskPitch); |
| 320 if (!m_pExtraAlphaBuf) { | |
| 321 return FALSE; | |
| 322 } | |
| 323 FX_DWORD size = (m_DestClip.Width() * 8 + 31) / 32 * 4; | 320 FX_DWORD size = (m_DestClip.Width() * 8 + 31) / 32 * 4; |
| 324 m_pDestMaskScanline = FX_TryAlloc(unsigned char, size); | 321 m_pDestMaskScanline = FX_TryAlloc(unsigned char, size); |
| 325 if (!m_pDestMaskScanline) { | 322 if (!m_pDestMaskScanline) { |
| 326 return FALSE; | 323 return FALSE; |
| 327 } | 324 } |
| 328 } | 325 } |
| 329 m_WeightTable.Calc(m_DestWidth, m_DestClip.left, m_DestClip.right, m_SrcWidt
h, m_SrcClip.left, m_SrcClip.right, m_Flags); | 326 m_WeightTable.Calc(m_DestWidth, m_DestClip.left, m_DestClip.right, m_SrcWidt
h, m_SrcClip.left, m_SrcClip.right, m_Flags); |
| 330 if (m_WeightTable.m_pWeightTables == NULL) { | 327 if (m_WeightTable.m_pWeightTables == NULL) { |
| 331 return FALSE; | 328 return FALSE; |
| 332 } | 329 } |
| (...skipping 507 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 840 return TRUE; | 837 return TRUE; |
| 841 } | 838 } |
| 842 m_pSource->DownSampleScanline(src_y, m_pScanline, m_DestBPP, m_DestWidth
, m_bFlipX, m_ClipRect.left, result_width); | 839 m_pSource->DownSampleScanline(src_y, m_pScanline, m_DestBPP, m_DestWidth
, m_bFlipX, m_ClipRect.left, result_width); |
| 843 if (m_pMaskScanline) { | 840 if (m_pMaskScanline) { |
| 844 m_pSource->m_pAlphaMask->DownSampleScanline(src_y, m_pMaskScanline,
1, m_DestWidth, m_bFlipX, m_ClipRect.left, result_width); | 841 m_pSource->m_pAlphaMask->DownSampleScanline(src_y, m_pMaskScanline,
1, m_DestWidth, m_bFlipX, m_ClipRect.left, result_width); |
| 845 } | 842 } |
| 846 m_pDest->ComposeScanline(dest_y, m_pScanline, m_pMaskScanline); | 843 m_pDest->ComposeScanline(dest_y, m_pScanline, m_pMaskScanline); |
| 847 } | 844 } |
| 848 return FALSE; | 845 return FALSE; |
| 849 } | 846 } |
| OLD | NEW |