From 0b95042db2e6dab5876abd12ce485fff0a8e08fe Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Thu, 21 Sep 2017 15:49:49 -0400 Subject: Rename CFX_RetainPtr to RetainPtr This CL renames CFX_RetainPtr to RetainPtr and places in the fxcrt namespace. Bug: pdfium:898 Change-Id: I8798a9f79cb0840d3f037e8d04937cedd742914e Reviewed-on: https://pdfium-review.googlesource.com/14616 Reviewed-by: Tom Sepez Commit-Queue: dsinclair --- fpdfsdk/fpdfview.cpp | 54 ++++++++++++++++++++++++++-------------------------- 1 file changed, 27 insertions(+), 27 deletions(-) (limited to 'fpdfsdk/fpdfview.cpp') diff --git a/fpdfsdk/fpdfview.cpp b/fpdfsdk/fpdfview.cpp index c52c598783..df46ec5218 100644 --- a/fpdfsdk/fpdfview.cpp +++ b/fpdfsdk/fpdfview.cpp @@ -132,7 +132,7 @@ void RenderPageImpl(CPDF_PageRenderContext* pContext, class CPDF_CustomAccess final : public IFX_SeekableReadStream { public: template - friend CFX_RetainPtr pdfium::MakeRetain(Args&&... args); + friend RetainPtr pdfium::MakeRetain(Args&&... args); // IFX_SeekableReadStream FX_FILESIZE GetSize() override; @@ -171,7 +171,7 @@ bool CPDF_CustomAccess::ReadBlock(void* buffer, class CFPDF_FileStream : public IFX_SeekableStream { public: template - friend CFX_RetainPtr pdfium::MakeRetain(Args&&... args); + friend RetainPtr pdfium::MakeRetain(Args&&... args); ~CFPDF_FileStream() override; @@ -273,7 +273,7 @@ bool CFPDF_FileStream::Flush() { #endif // PDF_ENABLE_XFA FPDF_DOCUMENT LoadDocumentImpl( - const CFX_RetainPtr& pFileAccess, + const RetainPtr& pFileAccess, FPDF_BYTESTRING password) { if (!pFileAccess) { ProcessParseError(CPDF_Parser::FILE_ERROR); @@ -409,13 +409,13 @@ unsigned long DecodeStreamMaybeCopyAndReturnLength(const CPDF_Stream* stream, return len; } -CFX_RetainPtr MakeSeekableReadStream( +RetainPtr MakeSeekableReadStream( FPDF_FILEACCESS* pFileAccess) { return pdfium::MakeRetain(pFileAccess); } #ifdef PDF_ENABLE_XFA -CFX_RetainPtr MakeSeekableStream( +RetainPtr MakeSeekableStream( FPDF_FILEHANDLER* pFilehandler) { return pdfium::MakeRetain(pFilehandler); } @@ -598,8 +598,8 @@ FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDF_LoadXFA(FPDF_DOCUMENT document) { class CMemFile final : public IFX_SeekableReadStream { public: - static CFX_RetainPtr Create(uint8_t* pBuf, FX_FILESIZE size) { - return CFX_RetainPtr(new CMemFile(pBuf, size)); + static RetainPtr Create(uint8_t* pBuf, FX_FILESIZE size) { + return RetainPtr(new CMemFile(pBuf, size)); } FX_FILESIZE GetSize() override { return m_size; } @@ -799,15 +799,15 @@ FX_RECT GetMaskDimensionsAndOffsets(CPDF_Page* pPage, // Get a bitmap of just the mask section defined by |mask_box| from a full page // bitmap |pBitmap|. -CFX_RetainPtr GetMaskBitmap(CPDF_Page* pPage, - int start_x, - int start_y, - int size_x, - int size_y, - int rotate, - CFX_RetainPtr& pSrc, - const CFX_FloatRect& mask_box, - FX_RECT* bitmap_area) { +RetainPtr GetMaskBitmap(CPDF_Page* pPage, + int start_x, + int start_y, + int size_x, + int size_y, + int rotate, + RetainPtr& pSrc, + const CFX_FloatRect& mask_box, + FX_RECT* bitmap_area) { ASSERT(bitmap_area); *bitmap_area = GetMaskDimensionsAndOffsets(pPage, start_x, start_y, size_x, size_y, rotate, mask_box); @@ -815,7 +815,7 @@ CFX_RetainPtr GetMaskBitmap(CPDF_Page* pPage, return nullptr; // Create a new bitmap to transfer part of the page bitmap to. - CFX_RetainPtr pDst = pdfium::MakeRetain(); + RetainPtr pDst = pdfium::MakeRetain(); pDst->Create(bitmap_area->Width(), bitmap_area->Height(), FXDIB_Argb); pDst->Clear(0x00ffffff); pDst->TransferBitmap(0, 0, bitmap_area->Width(), bitmap_area->Height(), pSrc, @@ -824,7 +824,7 @@ CFX_RetainPtr GetMaskBitmap(CPDF_Page* pPage, } void RenderBitmap(CFX_RenderDevice* device, - const CFX_RetainPtr& pSrc, + const RetainPtr& pSrc, const FX_RECT& mask_area) { int size_x_bm = mask_area.Width(); int size_y_bm = mask_area.Height(); @@ -832,7 +832,7 @@ void RenderBitmap(CFX_RenderDevice* device, return; // Create a new bitmap from the old one - CFX_RetainPtr pDst = pdfium::MakeRetain(); + RetainPtr pDst = pdfium::MakeRetain(); pDst->Create(size_x_bm, size_y_bm, FXDIB_Rgb32); pDst->Clear(0xffffffff); pDst->CompositeBitmap(0, 0, size_x_bm, size_y_bm, pSrc, 0, 0, @@ -862,7 +862,7 @@ FPDF_EXPORT void FPDF_CALLCONV FPDF_RenderPage(HDC dc, pPage->SetRenderContext(pdfium::MakeUnique()); CPDF_PageRenderContext* pContext = pPage->GetRenderContext(); - CFX_RetainPtr pBitmap; + RetainPtr pBitmap; // Don't render the full page to bitmap for a mask unless there are a lot // of masks. Full page bitmaps result in large spool sizes, so they should // only be used when necessary. For large numbers of masks, rendering each @@ -896,7 +896,7 @@ FPDF_EXPORT void FPDF_CALLCONV FPDF_RenderPage(HDC dc, const std::vector& mask_boxes = pPage->GetMaskBoundingBoxes(); std::vector bitmap_areas(mask_boxes.size()); - std::vector> bitmaps(mask_boxes.size()); + std::vector> bitmaps(mask_boxes.size()); for (size_t i = 0; i < mask_boxes.size(); i++) { bitmaps[i] = GetMaskBitmap(pPage, start_x, start_y, size_x, size_y, rotate, @@ -966,7 +966,7 @@ FPDF_EXPORT void FPDF_CALLCONV FPDF_RenderPageBitmap(FPDF_BITMAP bitmap, CFX_DefaultRenderDevice* pDevice = new CFX_DefaultRenderDevice; pContext->m_pDevice.reset(pDevice); - CFX_RetainPtr pBitmap(CFXBitmapFromFPDFBitmap(bitmap)); + RetainPtr pBitmap(CFXBitmapFromFPDFBitmap(bitmap)); pDevice->Attach(pBitmap, !!(flags & FPDF_REVERSE_BYTE_ORDER), nullptr, false); FPDF_RenderPage_Retail(pContext, page, start_x, start_y, size_x, size_y, rotate, flags, true, nullptr); @@ -997,7 +997,7 @@ FPDF_RenderPageBitmapWithMatrix(FPDF_BITMAP bitmap, CFX_DefaultRenderDevice* pDevice = new CFX_DefaultRenderDevice; pContext->m_pDevice.reset(pDevice); - CFX_RetainPtr pBitmap(CFXBitmapFromFPDFBitmap(bitmap)); + RetainPtr pBitmap(CFXBitmapFromFPDFBitmap(bitmap)); pDevice->Attach(pBitmap, !!(flags & FPDF_REVERSE_BYTE_ORDER), nullptr, false); CFX_FloatRect clipping_rect; @@ -1045,7 +1045,7 @@ FPDF_EXPORT void FPDF_CALLCONV FPDF_ClosePage(FPDF_PAGE page) { return; #ifdef PDF_ENABLE_XFA // Take it back across the API and throw it away. - CFX_RetainPtr().Unleak(pPage); + RetainPtr().Unleak(pPage); #else // PDF_ENABLE_XFA CPDFSDK_PageView* pPageView = static_cast(pPage->GetView()); @@ -1204,7 +1204,7 @@ FPDF_EXPORT void FPDF_CALLCONV FPDFBitmap_FillRect(FPDF_BITMAP bitmap, return; CFX_DefaultRenderDevice device; - CFX_RetainPtr pBitmap(CFXBitmapFromFPDFBitmap(bitmap)); + RetainPtr pBitmap(CFXBitmapFromFPDFBitmap(bitmap)); device.Attach(pBitmap, false, nullptr, false); if (!pBitmap->HasAlpha()) color |= 0xFF000000; @@ -1229,7 +1229,7 @@ FPDF_EXPORT int FPDF_CALLCONV FPDFBitmap_GetStride(FPDF_BITMAP bitmap) { } FPDF_EXPORT void FPDF_CALLCONV FPDFBitmap_Destroy(FPDF_BITMAP bitmap) { - CFX_RetainPtr destroyer; + RetainPtr destroyer; destroyer.Unleak(CFXBitmapFromFPDFBitmap(bitmap)); } @@ -1265,7 +1265,7 @@ FPDF_EXPORT int FPDF_CALLCONV FPDF_GetPageSizeByIndex(FPDF_DOCUMENT document, int count = pDoc->GetPageCount(); if (page_index < 0 || page_index >= count) return false; - CFX_RetainPtr pPage = pDoc->GetXFAPage(page_index); + RetainPtr pPage = pDoc->GetXFAPage(page_index); if (!pPage) return false; *width = pPage->GetPageWidth(); -- cgit v1.2.3