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 "render_int.h" | 7 #include "render_int.h" |
8 | 8 |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 1542 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1553 m_pImageLoader = pImageLoader; | 1553 m_pImageLoader = pImageLoader; |
1554 m_pCache = pCache; | 1554 m_pCache = pCache; |
1555 m_pImage = (CPDF_ImageObject*)pImage; | 1555 m_pImage = (CPDF_ImageObject*)pImage; |
1556 m_nDownsampleWidth = nDownsampleWidth; | 1556 m_nDownsampleWidth = nDownsampleWidth; |
1557 m_nDownsampleHeight = nDownsampleHeight; | 1557 m_nDownsampleHeight = nDownsampleHeight; |
1558 FX_BOOL ret; | 1558 FX_BOOL ret; |
1559 if (pCache) { | 1559 if (pCache) { |
1560 ret = pCache->StartGetCachedBitmap(pImage->m_pImage->GetStream(), bStdCS, | 1560 ret = pCache->StartGetCachedBitmap(pImage->m_pImage->GetStream(), bStdCS, |
1561 GroupFamily, bLoadMask, pRenderStatus, | 1561 GroupFamily, bLoadMask, pRenderStatus, |
1562 m_nDownsampleWidth, m_nDownsampleHeight); | 1562 m_nDownsampleWidth, m_nDownsampleHeight); |
1563 if (ret == FALSE) { | 1563 if (!ret) { |
1564 m_pImageLoader->m_bCached = TRUE; | 1564 m_pImageLoader->m_bCached = TRUE; |
1565 m_pImageLoader->m_pBitmap = pCache->m_pCurImageCache->DetachBitmap(); | 1565 m_pImageLoader->m_pBitmap = |
1566 m_pImageLoader->m_pMask = pCache->m_pCurImageCache->DetachMask(); | 1566 pCache->GetCurImageCacheEntry()->DetachBitmap(); |
1567 m_pImageLoader->m_MatteColor = pCache->m_pCurImageCache->m_MatteColor; | 1567 m_pImageLoader->m_pMask = pCache->GetCurImageCacheEntry()->DetachMask(); |
| 1568 m_pImageLoader->m_MatteColor = |
| 1569 pCache->GetCurImageCacheEntry()->m_MatteColor; |
1568 } | 1570 } |
1569 } else { | 1571 } else { |
1570 ret = pImage->m_pImage->StartLoadDIBSource(pRenderStatus->m_pFormResource, | 1572 ret = pImage->m_pImage->StartLoadDIBSource(pRenderStatus->m_pFormResource, |
1571 pRenderStatus->m_pPageResource, | 1573 pRenderStatus->m_pPageResource, |
1572 bStdCS, GroupFamily, bLoadMask); | 1574 bStdCS, GroupFamily, bLoadMask); |
1573 if (ret == FALSE) { | 1575 if (!ret) { |
1574 m_pImageLoader->m_bCached = FALSE; | 1576 m_pImageLoader->m_bCached = FALSE; |
1575 m_pImageLoader->m_pBitmap = m_pImage->m_pImage->DetachBitmap(); | 1577 m_pImageLoader->m_pBitmap = m_pImage->m_pImage->DetachBitmap(); |
1576 m_pImageLoader->m_pMask = m_pImage->m_pImage->DetachMask(); | 1578 m_pImageLoader->m_pMask = m_pImage->m_pImage->DetachMask(); |
1577 m_pImageLoader->m_MatteColor = m_pImage->m_pImage->m_MatteColor; | 1579 m_pImageLoader->m_MatteColor = m_pImage->m_pImage->m_MatteColor; |
1578 } | 1580 } |
1579 } | 1581 } |
1580 return ret; | 1582 return ret; |
1581 } | 1583 } |
1582 FX_BOOL CPDF_ProgressiveImageLoaderHandle::Continue(IFX_Pause* pPause) { | 1584 FX_BOOL CPDF_ProgressiveImageLoaderHandle::Continue(IFX_Pause* pPause) { |
1583 FX_BOOL ret; | 1585 FX_BOOL ret; |
1584 if (m_pCache) { | 1586 if (m_pCache) { |
1585 ret = m_pCache->Continue(pPause); | 1587 ret = m_pCache->Continue(pPause); |
1586 if (ret == FALSE) { | 1588 if (!ret) { |
1587 m_pImageLoader->m_bCached = TRUE; | 1589 m_pImageLoader->m_bCached = TRUE; |
1588 m_pImageLoader->m_pBitmap = m_pCache->m_pCurImageCache->DetachBitmap(); | 1590 m_pImageLoader->m_pBitmap = |
1589 m_pImageLoader->m_pMask = m_pCache->m_pCurImageCache->DetachMask(); | 1591 m_pCache->GetCurImageCacheEntry()->DetachBitmap(); |
1590 m_pImageLoader->m_MatteColor = m_pCache->m_pCurImageCache->m_MatteColor; | 1592 m_pImageLoader->m_pMask = m_pCache->GetCurImageCacheEntry()->DetachMask(); |
| 1593 m_pImageLoader->m_MatteColor = |
| 1594 m_pCache->GetCurImageCacheEntry()->m_MatteColor; |
1591 } | 1595 } |
1592 } else { | 1596 } else { |
1593 ret = m_pImage->m_pImage->Continue(pPause); | 1597 ret = m_pImage->m_pImage->Continue(pPause); |
1594 if (ret == FALSE) { | 1598 if (!ret) { |
1595 m_pImageLoader->m_bCached = FALSE; | 1599 m_pImageLoader->m_bCached = FALSE; |
1596 m_pImageLoader->m_pBitmap = m_pImage->m_pImage->DetachBitmap(); | 1600 m_pImageLoader->m_pBitmap = m_pImage->m_pImage->DetachBitmap(); |
1597 m_pImageLoader->m_pMask = m_pImage->m_pImage->DetachMask(); | 1601 m_pImageLoader->m_pMask = m_pImage->m_pImage->DetachMask(); |
1598 m_pImageLoader->m_MatteColor = m_pImage->m_pImage->m_MatteColor; | 1602 m_pImageLoader->m_MatteColor = m_pImage->m_pImage->m_MatteColor; |
1599 } | 1603 } |
1600 } | 1604 } |
1601 return ret; | 1605 return ret; |
1602 } | 1606 } |
1603 FX_BOOL CPDF_ImageLoader::Load(const CPDF_ImageObject* pImage, | 1607 FX_BOOL CPDF_ImageLoader::Load(const CPDF_ImageObject* pImage, |
1604 CPDF_PageRenderCache* pCache, | 1608 CPDF_PageRenderCache* pCache, |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1643 } | 1647 } |
1644 FX_BOOL CPDF_ImageLoader::Continue(void* LoadHandle, IFX_Pause* pPause) { | 1648 FX_BOOL CPDF_ImageLoader::Continue(void* LoadHandle, IFX_Pause* pPause) { |
1645 return ((CPDF_ProgressiveImageLoaderHandle*)LoadHandle)->Continue(pPause); | 1649 return ((CPDF_ProgressiveImageLoaderHandle*)LoadHandle)->Continue(pPause); |
1646 } | 1650 } |
1647 CPDF_ImageLoader::~CPDF_ImageLoader() { | 1651 CPDF_ImageLoader::~CPDF_ImageLoader() { |
1648 if (!m_bCached) { | 1652 if (!m_bCached) { |
1649 delete m_pBitmap; | 1653 delete m_pBitmap; |
1650 delete m_pMask; | 1654 delete m_pMask; |
1651 } | 1655 } |
1652 } | 1656 } |
OLD | NEW |