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/fpdfapi/fpdf_page.h" | 7 #include "../../../include/fpdfapi/fpdf_page.h" |
8 #include "../../../include/fpdfapi/fpdf_module.h" | 8 #include "../../../include/fpdfapi/fpdf_module.h" |
9 #include "../../../include/fxcodec/fx_codec.h" | 9 #include "../../../include/fxcodec/fx_codec.h" |
10 #include "pageint.h" | 10 #include "pageint.h" |
(...skipping 1145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1156 { | 1156 { |
1157 if (m_Family == PDFCS_PATTERN) { | 1157 if (m_Family == PDFCS_PATTERN) { |
1158 return sizeof(PatternValue); | 1158 return sizeof(PatternValue); |
1159 } | 1159 } |
1160 return m_nComponents * sizeof(FX_FLOAT); | 1160 return m_nComponents * sizeof(FX_FLOAT); |
1161 } | 1161 } |
1162 FX_FLOAT* CPDF_ColorSpace::CreateBuf() | 1162 FX_FLOAT* CPDF_ColorSpace::CreateBuf() |
1163 { | 1163 { |
1164 int size = GetBufSize(); | 1164 int size = GetBufSize(); |
1165 FX_BYTE* pBuf = FX_Alloc(FX_BYTE, size); | 1165 FX_BYTE* pBuf = FX_Alloc(FX_BYTE, size); |
1166 FXSYS_memset32(pBuf, 0, size); | |
1167 return (FX_FLOAT*)pBuf; | 1166 return (FX_FLOAT*)pBuf; |
1168 } | 1167 } |
1169 FX_BOOL CPDF_ColorSpace::sRGB() const | 1168 FX_BOOL CPDF_ColorSpace::sRGB() const |
1170 { | 1169 { |
1171 if (m_Family == PDFCS_DEVICERGB) { | 1170 if (m_Family == PDFCS_DEVICERGB) { |
1172 return TRUE; | 1171 return TRUE; |
1173 } | 1172 } |
1174 if (m_Family != PDFCS_ICCBASED) { | 1173 if (m_Family != PDFCS_ICCBASED) { |
1175 return FALSE; | 1174 return FALSE; |
1176 } | 1175 } |
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1394 PatternValue* pvalue = (PatternValue*)m_pBuffer; | 1393 PatternValue* pvalue = (PatternValue*)m_pBuffer; |
1395 return pvalue->m_nComps ? pvalue->m_Comps : NULL; | 1394 return pvalue->m_nComps ? pvalue->m_Comps : NULL; |
1396 } | 1395 } |
1397 FX_BOOL CPDF_Color::IsEqual(const CPDF_Color& other) const | 1396 FX_BOOL CPDF_Color::IsEqual(const CPDF_Color& other) const |
1398 { | 1397 { |
1399 if (m_pCS != other.m_pCS || m_pCS == NULL) { | 1398 if (m_pCS != other.m_pCS || m_pCS == NULL) { |
1400 return FALSE; | 1399 return FALSE; |
1401 } | 1400 } |
1402 return FXSYS_memcmp32(m_pBuffer, other.m_pBuffer, m_pCS->GetBufSize()) == 0; | 1401 return FXSYS_memcmp32(m_pBuffer, other.m_pBuffer, m_pCS->GetBufSize()) == 0; |
1403 } | 1402 } |
OLD | NEW |