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 #include <algorithm> | 5 #include <algorithm> |
6 #include <vector> | 6 #include <vector> |
7 | 7 |
8 #include "core/fxcodec/fx_codec.h" | 8 #include "core/fxcodec/fx_codec.h" |
9 #include "core/fxcrt/fx_memory.h" | 9 #include "core/fxcrt/fx_memory.h" |
10 | 10 |
(...skipping 1601 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1612 int height, | 1612 int height, |
1613 FXDIB_Format format, | 1613 FXDIB_Format format, |
1614 CFX_DIBitmap* pOriDevice) { | 1614 CFX_DIBitmap* pOriDevice) { |
1615 m_bOwnedBitmap = TRUE; | 1615 m_bOwnedBitmap = TRUE; |
1616 CFX_DIBitmap* pBitmap = new CFX_DIBitmap; | 1616 CFX_DIBitmap* pBitmap = new CFX_DIBitmap; |
1617 if (!pBitmap->Create(width, height, format)) { | 1617 if (!pBitmap->Create(width, height, format)) { |
1618 delete pBitmap; | 1618 delete pBitmap; |
1619 return false; | 1619 return false; |
1620 } | 1620 } |
1621 SetBitmap(pBitmap); | 1621 SetBitmap(pBitmap); |
1622 SetDeviceDriver(pdfium::MakeUnique<CFX_SkiaDeviceDriver>(pBitmap, FALSE, | 1622 SetDeviceDriver(pdfium::MakeUnique<CFX_SkiaDeviceDriver>(pBitmap, false, |
1623 pOriDevice, FALSE)); | 1623 pOriDevice, false)); |
1624 return true; | 1624 return true; |
1625 } | 1625 } |
1626 | 1626 |
1627 CFX_FxgeDevice::~CFX_FxgeDevice() { | 1627 CFX_FxgeDevice::~CFX_FxgeDevice() { |
1628 Flush(); | 1628 Flush(); |
1629 // call destructor of CFX_RenderDevice / CFX_SkiaDeviceDriver immediately | 1629 // call destructor of CFX_RenderDevice / CFX_SkiaDeviceDriver immediately |
1630 if (m_bOwnedBitmap && GetBitmap()) | 1630 if (m_bOwnedBitmap && GetBitmap()) |
1631 delete GetBitmap(); | 1631 delete GetBitmap(); |
1632 } | 1632 } |
1633 | 1633 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1669 uint8_t g = SkGetPackedG32(srcRow[x]); | 1669 uint8_t g = SkGetPackedG32(srcRow[x]); |
1670 uint8_t b = SkGetPackedB32(srcRow[x]); | 1670 uint8_t b = SkGetPackedB32(srcRow[x]); |
1671 SkA32Assert(a); | 1671 SkA32Assert(a); |
1672 SkASSERT(r <= a); | 1672 SkASSERT(r <= a); |
1673 SkASSERT(g <= a); | 1673 SkASSERT(g <= a); |
1674 SkASSERT(b <= a); | 1674 SkASSERT(b <= a); |
1675 } | 1675 } |
1676 } | 1676 } |
1677 #endif | 1677 #endif |
1678 } | 1678 } |
OLD | NEW |