| 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 "core/fxge/fx_dib.h" | 7 #include "core/fxge/fx_dib.h" |
| 8 | 8 |
| 9 #include <limits.h> | 9 #include <limits.h> |
| 10 | 10 |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 | 60 |
| 61 bool CFX_DIBSource::SkipToScanline(int line, IFX_Pause* pPause) const { | 61 bool CFX_DIBSource::SkipToScanline(int line, IFX_Pause* pPause) const { |
| 62 return false; | 62 return false; |
| 63 } | 63 } |
| 64 | 64 |
| 65 CFX_DIBitmap::CFX_DIBitmap() { | 65 CFX_DIBitmap::CFX_DIBitmap() { |
| 66 m_bExtBuf = false; | 66 m_bExtBuf = false; |
| 67 m_pBuffer = nullptr; | 67 m_pBuffer = nullptr; |
| 68 m_pPalette = nullptr; | 68 m_pPalette = nullptr; |
| 69 #ifdef _SKIA_SUPPORT_PATHS_ | 69 #ifdef _SKIA_SUPPORT_PATHS_ |
| 70 m_bUnPreMultiply = false; | 70 m_nFormat = Format::kCleared; |
| 71 #endif | 71 #endif |
| 72 } | 72 } |
| 73 | 73 |
| 74 #define _MAX_OOM_LIMIT_ 12000000 | 74 #define _MAX_OOM_LIMIT_ 12000000 |
| 75 bool CFX_DIBitmap::Create(int width, | 75 bool CFX_DIBitmap::Create(int width, |
| 76 int height, | 76 int height, |
| 77 FXDIB_Format format, | 77 FXDIB_Format format, |
| 78 uint8_t* pBuffer, | 78 uint8_t* pBuffer, |
| 79 int pitch) { | 79 int pitch) { |
| 80 m_pBuffer = nullptr; | 80 m_pBuffer = nullptr; |
| (...skipping 1607 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1688 uint32_t* pSrcPalette) { | 1688 uint32_t* pSrcPalette) { |
| 1689 m_pBitmap = pdfium::MakeUnique<CFX_DIBitmap>(); | 1689 m_pBitmap = pdfium::MakeUnique<CFX_DIBitmap>(); |
| 1690 if (!m_pBitmap->Create(width, height, src_format)) { | 1690 if (!m_pBitmap->Create(width, height, src_format)) { |
| 1691 m_pBitmap.reset(); | 1691 m_pBitmap.reset(); |
| 1692 return false; | 1692 return false; |
| 1693 } | 1693 } |
| 1694 if (pSrcPalette) | 1694 if (pSrcPalette) |
| 1695 m_pBitmap->CopyPalette(pSrcPalette); | 1695 m_pBitmap->CopyPalette(pSrcPalette); |
| 1696 return true; | 1696 return true; |
| 1697 } | 1697 } |
| OLD | NEW |