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 #include <algorithm> | 10 #include <algorithm> |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 } | 56 } |
57 | 57 |
58 bool CFX_DIBSource::SkipToScanline(int line, IFX_Pause* pPause) const { | 58 bool CFX_DIBSource::SkipToScanline(int line, IFX_Pause* pPause) const { |
59 return false; | 59 return false; |
60 } | 60 } |
61 | 61 |
62 CFX_DIBitmap::CFX_DIBitmap() { | 62 CFX_DIBitmap::CFX_DIBitmap() { |
63 m_bExtBuf = false; | 63 m_bExtBuf = false; |
64 m_pBuffer = nullptr; | 64 m_pBuffer = nullptr; |
65 m_pPalette = nullptr; | 65 m_pPalette = nullptr; |
| 66 #ifdef _SKIA_SUPPORT_PATHS_ |
| 67 m_bUnPreMultiply = false; |
| 68 #endif |
66 } | 69 } |
67 | 70 |
68 #define _MAX_OOM_LIMIT_ 12000000 | 71 #define _MAX_OOM_LIMIT_ 12000000 |
69 bool CFX_DIBitmap::Create(int width, | 72 bool CFX_DIBitmap::Create(int width, |
70 int height, | 73 int height, |
71 FXDIB_Format format, | 74 FXDIB_Format format, |
72 uint8_t* pBuffer, | 75 uint8_t* pBuffer, |
73 int pitch) { | 76 int pitch) { |
74 m_pBuffer = nullptr; | 77 m_pBuffer = nullptr; |
75 m_bpp = (uint8_t)format; | 78 m_bpp = (uint8_t)format; |
(...skipping 1606 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1682 uint32_t* pSrcPalette) { | 1685 uint32_t* pSrcPalette) { |
1683 m_pBitmap = pdfium::MakeUnique<CFX_DIBitmap>(); | 1686 m_pBitmap = pdfium::MakeUnique<CFX_DIBitmap>(); |
1684 if (!m_pBitmap->Create(width, height, src_format)) { | 1687 if (!m_pBitmap->Create(width, height, src_format)) { |
1685 m_pBitmap.reset(); | 1688 m_pBitmap.reset(); |
1686 return false; | 1689 return false; |
1687 } | 1690 } |
1688 if (pSrcPalette) | 1691 if (pSrcPalette) |
1689 m_pBitmap->CopyPalette(pSrcPalette); | 1692 m_pBitmap->CopyPalette(pSrcPalette); |
1690 return true; | 1693 return true; |
1691 } | 1694 } |
OLD | NEW |