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 25 matching lines...) Expand all Loading... |
36 : m_DestMin(0), | 36 : m_DestMin(0), |
37 m_ItemSize(0), | 37 m_ItemSize(0), |
38 m_pWeightTables(nullptr), | 38 m_pWeightTables(nullptr), |
39 m_dwWeightTablesSize(0) {} | 39 m_dwWeightTablesSize(0) {} |
40 | 40 |
41 CWeightTable::~CWeightTable() { | 41 CWeightTable::~CWeightTable() { |
42 FX_Free(m_pWeightTables); | 42 FX_Free(m_pWeightTables); |
43 } | 43 } |
44 | 44 |
45 size_t CWeightTable::GetPixelWeightSize() const { | 45 size_t CWeightTable::GetPixelWeightSize() const { |
46 return m_dwWeightTablesSize / sizeof(int); | 46 return m_ItemSize / sizeof(int) - 2; |
47 } | 47 } |
48 | 48 |
49 bool CWeightTable::Calc(int dest_len, | 49 bool CWeightTable::Calc(int dest_len, |
50 int dest_min, | 50 int dest_min, |
51 int dest_max, | 51 int dest_max, |
52 int src_len, | 52 int src_len, |
53 int src_min, | 53 int src_min, |
54 int src_max, | 54 int src_max, |
55 int flags) { | 55 int flags) { |
56 FX_Free(m_pWeightTables); | 56 FX_Free(m_pWeightTables); |
(...skipping 942 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
999 result_width); | 999 result_width); |
1000 if (m_pMaskScanline) { | 1000 if (m_pMaskScanline) { |
1001 m_pSource->m_pAlphaMask->DownSampleScanline( | 1001 m_pSource->m_pAlphaMask->DownSampleScanline( |
1002 src_y, m_pMaskScanline.get(), 1, m_DestWidth, m_bFlipX, | 1002 src_y, m_pMaskScanline.get(), 1, m_DestWidth, m_bFlipX, |
1003 m_ClipRect.left, result_width); | 1003 m_ClipRect.left, result_width); |
1004 } | 1004 } |
1005 m_pDest->ComposeScanline(dest_y, m_pScanline.get(), m_pMaskScanline.get()); | 1005 m_pDest->ComposeScanline(dest_y, m_pScanline.get(), m_pMaskScanline.get()); |
1006 } | 1006 } |
1007 return FALSE; | 1007 return FALSE; |
1008 } | 1008 } |
OLD | NEW |