Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(135)

Side by Side Diff: core/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp

Issue 2136683002: Use smart pointers for class owned member variables (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « core/fpdfapi/fpdf_render/fpdf_render_image.cpp ('k') | core/fpdfapi/fpdf_render/render_int.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/fpdfapi/fpdf_render/render_int.h" 7 #include "core/fpdfapi/fpdf_render/render_int.h"
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <memory> 10 #include <memory>
(...skipping 1530 matching lines...) Expand 10 before | Expand all | Expand 10 after
1541 if (!ret) { 1541 if (!ret) {
1542 m_pImageLoader->m_bCached = FALSE; 1542 m_pImageLoader->m_bCached = FALSE;
1543 m_pImageLoader->m_pBitmap = m_pImage->m_pImage->DetachBitmap(); 1543 m_pImageLoader->m_pBitmap = m_pImage->m_pImage->DetachBitmap();
1544 m_pImageLoader->m_pMask = m_pImage->m_pImage->DetachMask(); 1544 m_pImageLoader->m_pMask = m_pImage->m_pImage->DetachMask();
1545 m_pImageLoader->m_MatteColor = m_pImage->m_pImage->m_MatteColor; 1545 m_pImageLoader->m_MatteColor = m_pImage->m_pImage->m_MatteColor;
1546 } 1546 }
1547 } 1547 }
1548 return ret; 1548 return ret;
1549 } 1549 }
1550 1550
1551 FX_BOOL CPDF_ImageLoader::Start(const CPDF_ImageObject* pImage, 1551 FX_BOOL CPDF_ImageLoader::Start(
1552 CPDF_PageRenderCache* pCache, 1552 const CPDF_ImageObject* pImage,
1553 CPDF_ImageLoaderHandle*& LoadHandle, 1553 CPDF_PageRenderCache* pCache,
1554 FX_BOOL bStdCS, 1554 std::unique_ptr<CPDF_ImageLoaderHandle>* pLoadHandle,
1555 uint32_t GroupFamily, 1555 FX_BOOL bStdCS,
1556 FX_BOOL bLoadMask, 1556 uint32_t GroupFamily,
1557 CPDF_RenderStatus* pRenderStatus, 1557 FX_BOOL bLoadMask,
1558 int32_t nDownsampleWidth, 1558 CPDF_RenderStatus* pRenderStatus,
1559 int32_t nDownsampleHeight) { 1559 int32_t nDownsampleWidth,
1560 int32_t nDownsampleHeight) {
1560 m_nDownsampleWidth = nDownsampleWidth; 1561 m_nDownsampleWidth = nDownsampleWidth;
1561 m_nDownsampleHeight = nDownsampleHeight; 1562 m_nDownsampleHeight = nDownsampleHeight;
1562 LoadHandle = new CPDF_ImageLoaderHandle; 1563 pLoadHandle->reset(new CPDF_ImageLoaderHandle);
1563 return LoadHandle->Start(this, pImage, pCache, bStdCS, GroupFamily, bLoadMask, 1564 return (*pLoadHandle)
1564 pRenderStatus, m_nDownsampleWidth, 1565 ->Start(this, pImage, pCache, bStdCS, GroupFamily, bLoadMask,
1565 m_nDownsampleHeight); 1566 pRenderStatus, m_nDownsampleWidth, m_nDownsampleHeight);
1566 } 1567 }
1567 1568
1568 FX_BOOL CPDF_ImageLoader::Continue(CPDF_ImageLoaderHandle* LoadHandle, 1569 FX_BOOL CPDF_ImageLoader::Continue(CPDF_ImageLoaderHandle* LoadHandle,
1569 IFX_Pause* pPause) { 1570 IFX_Pause* pPause) {
1570 return LoadHandle->Continue(pPause); 1571 return LoadHandle->Continue(pPause);
1571 } 1572 }
1572 1573
1573 CPDF_ImageLoader::~CPDF_ImageLoader() { 1574 CPDF_ImageLoader::~CPDF_ImageLoader() {
1574 if (!m_bCached) { 1575 if (!m_bCached) {
1575 delete m_pBitmap; 1576 delete m_pBitmap;
1576 delete m_pMask; 1577 delete m_pMask;
1577 } 1578 }
1578 } 1579 }
OLDNEW
« no previous file with comments | « core/fpdfapi/fpdf_render/fpdf_render_image.cpp ('k') | core/fpdfapi/fpdf_render/render_int.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698