Chromium Code Reviews| 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 "JBig2_Image.h" | 7 #include "JBig2_Image.h" |
| 8 #include "../../../include/fxcrt/fx_basic.h" | 8 #include "../../../include/fxcrt/fx_basic.h" |
| 9 #include "../../../include/fxcrt/fx_coordinates.h" | 9 #include "../../../include/fxcrt/fx_coordinates.h" |
| 10 #include <limits.h> | 10 #include <limits.h> |
| (...skipping 758 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 769 return; | 769 return; |
| 770 } | 770 } |
| 771 m_pData = (FX_BYTE*)m_pModule->JBig2_Realloc(m_pData, h * m_nStride); | 771 m_pData = (FX_BYTE*)m_pModule->JBig2_Realloc(m_pData, h * m_nStride); |
| 772 if(h > m_nHeight) { | 772 if(h > m_nHeight) { |
| 773 JBIG2_memset(m_pData + m_nHeight * m_nStride, v ? 0xff : 0, (h - m_nHeig ht)*m_nStride); | 773 JBIG2_memset(m_pData + m_nHeight * m_nStride, v ? 0xff : 0, (h - m_nHeig ht)*m_nStride); |
| 774 } | 774 } |
| 775 m_nHeight = h; | 775 m_nHeight = h; |
| 776 } | 776 } |
| 777 FX_BOOL CJBig2_Image::composeTo_opt2(CJBig2_Image *pDst, FX_INT32 x, FX_INT32 y, JBig2ComposeOp op) | 777 FX_BOOL CJBig2_Image::composeTo_opt2(CJBig2_Image *pDst, FX_INT32 x, FX_INT32 y, JBig2ComposeOp op) |
| 778 { | 778 { |
| 779 FX_INT32 xs0, ys0, xs1, ys1, xd0, yd0, xd1, yd1, xx, yy, w, h, middleDwords, lineLeft; | 779 FX_INT32 xs0 = 0, ys0 = 0, xs1 = 0, ys1 = 0, xd0 = 0, yd0 = 0, xd1 = 0, |
| 780 FX_DWORD s1, d1, d2, shift, shift1, shift2, tmp, tmp1, tmp2, maskL, maskR, m askM; | 780 yd1 = 0, xx = 0, yy = 0, w = 0, h = 0, middleDwords = 0, lineLeft = 0; |
| 781 FX_BYTE *lineSrc, *lineDst, *sp, *dp; | 781 |
| 782 FX_DWORD s1 = 0, d1 = 0, d2 = 0, shift = 0, shift1 = 0, shift2 = 0, | |
| 783 tmp = 0, tmp1 = 0, tmp2 = 0, maskL = 0, maskR = 0, maskM = 0; | |
| 784 | |
| 785 FX_BYTE *lineSrc = NULL, *lineDst = NULL, *sp = NULL, *dp = NULL; | |
| 786 | |
| 782 if (!m_pData) { | 787 if (!m_pData) { |
| 783 return FALSE; | 788 return FALSE; |
| 784 } | 789 } |
| 785 if (x < -1048576 || x > 1048576 || y < -1048576 || y > 1048576) { | 790 if (x < -1048576 || x > 1048576 || y < -1048576 || y > 1048576) { |
| 786 return FALSE; | 791 return FALSE; |
| 787 } | 792 } |
| 788 if(y < 0) { | 793 if(y < 0) { |
| 789 ys0 = -y; | 794 ys0 = -y; |
| 790 } else { | 795 } else { |
|
Tom Sepez
2014/08/04 17:58:22
can we remove some of these else { ys0 = 0 } bra
| |
| 791 ys0 = 0; | 796 ys0 = 0; |
| 792 } | 797 } |
| 793 if(y + m_nHeight > pDst->m_nHeight) { | 798 if(y + m_nHeight > pDst->m_nHeight) { |
| 794 ys1 = pDst->m_nHeight - y; | 799 ys1 = pDst->m_nHeight - y; |
| 795 } else { | 800 } else { |
| 796 ys1 = m_nHeight; | 801 ys1 = m_nHeight; |
| 797 } | 802 } |
| 798 if(x < 0) { | 803 if(x < 0) { |
| 799 xs0 = -x; | 804 xs0 = -x; |
| 800 } else { | 805 } else { |
| (...skipping 809 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1610 dp[2] = (FX_BYTE)(tmp >> 8); | 1615 dp[2] = (FX_BYTE)(tmp >> 8); |
| 1611 dp[3] = (FX_BYTE)tmp; | 1616 dp[3] = (FX_BYTE)tmp; |
| 1612 } | 1617 } |
| 1613 lineSrc += m_nStride; | 1618 lineSrc += m_nStride; |
| 1614 lineDst += pDst->m_nStride; | 1619 lineDst += pDst->m_nStride; |
| 1615 } | 1620 } |
| 1616 } | 1621 } |
| 1617 } | 1622 } |
| 1618 return 1; | 1623 return 1; |
| 1619 } | 1624 } |
| OLD | NEW |