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_ge.h" | 7 #include "../../../include/fxge/fx_ge.h" |
8 #include "../../../include/fxcodec/fx_codec.h" | 8 #include "../../../include/fxcodec/fx_codec.h" |
9 #include "../../../include/fpdfapi/fpdf_module.h" | 9 #include "../../../include/fpdfapi/fpdf_module.h" |
10 #include "../../../include/fpdfapi/fpdf_render.h" | 10 #include "../../../include/fpdfapi/fpdf_render.h" |
(...skipping 1186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1197 pSrcLine = m_pStreamAcc->GetData() + line * src_pitch; | 1197 pSrcLine = m_pStreamAcc->GetData() + line * src_pitch; |
1198 } | 1198 } |
1199 } | 1199 } |
1200 int orig_Bpp = bpc * m_nComponents / 8; | 1200 int orig_Bpp = bpc * m_nComponents / 8; |
1201 int dest_Bpp = dest_bpp / 8; | 1201 int dest_Bpp = dest_bpp / 8; |
1202 if (pSrcLine == NULL) { | 1202 if (pSrcLine == NULL) { |
1203 FXSYS_memset32(dest_scan, 0xff, dest_Bpp * clip_width); | 1203 FXSYS_memset32(dest_scan, 0xff, dest_Bpp * clip_width); |
1204 return; | 1204 return; |
1205 } | 1205 } |
1206 | 1206 |
1207 FX_SAFE_INT max_src_x = clip_left; | 1207 FX_SAFE_INT32 max_src_x = clip_left; |
1208 max_src_x += clip_width - 1; | 1208 max_src_x += clip_width - 1; |
1209 max_src_x *= src_width; | 1209 max_src_x *= src_width; |
1210 max_src_x /= dest_width; | 1210 max_src_x /= dest_width; |
1211 if (!max_src_x.IsValid()) { | 1211 if (!max_src_x.IsValid()) { |
1212 return; | 1212 return; |
1213 } | 1213 } |
1214 | 1214 |
1215 CFX_FixedBufGrow<FX_BYTE, 128> temp(orig_Bpp); | 1215 CFX_FixedBufGrow<FX_BYTE, 128> temp(orig_Bpp); |
1216 if (bpc * m_nComponents == 1) { | 1216 if (bpc * m_nComponents == 1) { |
1217 FX_DWORD set_argb = (FX_DWORD) - 1, reset_argb = 0; | 1217 FX_DWORD set_argb = (FX_DWORD) - 1, reset_argb = 0; |
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1516 if (!m_bCached) { | 1516 if (!m_bCached) { |
1517 if (m_pBitmap) { | 1517 if (m_pBitmap) { |
1518 delete m_pBitmap; | 1518 delete m_pBitmap; |
1519 m_pBitmap = NULL; | 1519 m_pBitmap = NULL; |
1520 } | 1520 } |
1521 if (m_pMask) { | 1521 if (m_pMask) { |
1522 delete m_pMask; | 1522 delete m_pMask; |
1523 } | 1523 } |
1524 } | 1524 } |
1525 } | 1525 } |
OLD | NEW |