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 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 return FALSE; | 231 return FALSE; |
232 } | 232 } |
233 m_pLineBuf = FX_Alloc(FX_BYTE, pitch.ValueOrDie()); | 233 m_pLineBuf = FX_Alloc(FX_BYTE, pitch.ValueOrDie()); |
234 if (m_pColorSpace && bStdCS) { | 234 if (m_pColorSpace && bStdCS) { |
235 m_pColorSpace->EnableStdConversion(TRUE); | 235 m_pColorSpace->EnableStdConversion(TRUE); |
236 } | 236 } |
237 LoadPalette(); | 237 LoadPalette(); |
238 if (m_bColorKey) { | 238 if (m_bColorKey) { |
239 m_bpp = 32; | 239 m_bpp = 32; |
240 m_AlphaFlag = 2; | 240 m_AlphaFlag = 2; |
241 FX_SAFE_DWORD pitch = CalculatePitch32(m_bpp, m_Width); | 241 pitch = CalculatePitch32(m_bpp, m_Width); |
242 if (!pitch.IsValid()) { | 242 if (!pitch.IsValid()) { |
243 return FALSE; | 243 return FALSE; |
244 } | 244 } |
245 m_pMaskedLine = FX_Alloc(FX_BYTE, pitch.ValueOrDie()); | 245 m_pMaskedLine = FX_Alloc(FX_BYTE, pitch.ValueOrDie()); |
246 } | 246 } |
247 m_Pitch = pitch.ValueOrDie(); | 247 m_Pitch = pitch.ValueOrDie(); |
248 if (ppMask) { | 248 if (ppMask) { |
249 *ppMask = LoadMask(*pMatteColor); | 249 *ppMask = LoadMask(*pMatteColor); |
250 } | 250 } |
251 if (m_pColorSpace && bStdCS) { | 251 if (m_pColorSpace && bStdCS) { |
(...skipping 23 matching lines...) Expand all Loading... |
275 return 0; | 275 return 0; |
276 } | 276 } |
277 m_pLineBuf = FX_Alloc(FX_BYTE, pitch.ValueOrDie()); | 277 m_pLineBuf = FX_Alloc(FX_BYTE, pitch.ValueOrDie()); |
278 if (m_pColorSpace && m_bStdCS) { | 278 if (m_pColorSpace && m_bStdCS) { |
279 m_pColorSpace->EnableStdConversion(TRUE); | 279 m_pColorSpace->EnableStdConversion(TRUE); |
280 } | 280 } |
281 LoadPalette(); | 281 LoadPalette(); |
282 if (m_bColorKey) { | 282 if (m_bColorKey) { |
283 m_bpp = 32; | 283 m_bpp = 32; |
284 m_AlphaFlag = 2; | 284 m_AlphaFlag = 2; |
285 FX_SAFE_DWORD pitch = CalculatePitch32(m_bpp, m_Width); | 285 pitch = CalculatePitch32(m_bpp, m_Width); |
286 if (!pitch.IsValid()) { | 286 if (!pitch.IsValid()) { |
287 return 0; | 287 return 0; |
288 } | 288 } |
289 m_pMaskedLine = FX_Alloc(FX_BYTE, pitch.ValueOrDie()); | 289 m_pMaskedLine = FX_Alloc(FX_BYTE, pitch.ValueOrDie()); |
290 } | 290 } |
291 m_Pitch = pitch.ValueOrDie(); | 291 m_Pitch = pitch.ValueOrDie(); |
292 return 1; | 292 return 1; |
293 } | 293 } |
294 int CPDF_DIBSource::StartLoadDIBSource(CPDF_Document* pDoc, const CPDF_Strea
m* pStream, FX_BOOL bHasMask, | 294 int CPDF_DIBSource::StartLoadDIBSource(CPDF_Document* pDoc, const CPDF_Strea
m* pStream, FX_BOOL bHasMask, |
295 CPDF_Dictionary* pFormResources, CPDF_Dic
tionary* pPageResources, | 295 CPDF_Dictionary* pFormResources, CPDF_Dic
tionary* pPageResources, |
(...skipping 1212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1508 { | 1508 { |
1509 return ((CPDF_ProgressiveImageLoaderHandle*)LoadHandle)->Continue(pPause); | 1509 return ((CPDF_ProgressiveImageLoaderHandle*)LoadHandle)->Continue(pPause); |
1510 } | 1510 } |
1511 CPDF_ImageLoader::~CPDF_ImageLoader() | 1511 CPDF_ImageLoader::~CPDF_ImageLoader() |
1512 { | 1512 { |
1513 if (!m_bCached) { | 1513 if (!m_bCached) { |
1514 delete m_pBitmap; | 1514 delete m_pBitmap; |
1515 delete m_pMask; | 1515 delete m_pMask; |
1516 } | 1516 } |
1517 } | 1517 } |
OLD | NEW |