diff options
Diffstat (limited to 'xfa/fxfa/cxfa_ffwidget.cpp')
-rw-r--r-- | xfa/fxfa/cxfa_ffwidget.cpp | 49 |
1 files changed, 24 insertions, 25 deletions
diff --git a/xfa/fxfa/cxfa_ffwidget.cpp b/xfa/fxfa/cxfa_ffwidget.cpp index 0935f56b90..7763a19972 100644 --- a/xfa/fxfa/cxfa_ffwidget.cpp +++ b/xfa/fxfa/cxfa_ffwidget.cpp @@ -1414,7 +1414,7 @@ class CXFA_ImageRenderer { ~CXFA_ImageRenderer(); bool Start(CFX_RenderDevice* pDevice, - const CFX_RetainPtr<CFX_DIBSource>& pDIBSource, + const RetainPtr<CFX_DIBSource>& pDIBSource, FX_ARGB bitmap_argb, int bitmap_alpha, const CFX_Matrix* pImage2Device, @@ -1424,7 +1424,7 @@ class CXFA_ImageRenderer { protected: bool StartDIBSource(); - void CompositeDIBitmap(const CFX_RetainPtr<CFX_DIBitmap>& pDIBitmap, + void CompositeDIBitmap(const RetainPtr<CFX_DIBitmap>& pDIBitmap, int left, int top, FX_ARGB mask_argb, @@ -1435,8 +1435,8 @@ class CXFA_ImageRenderer { CFX_RenderDevice* m_pDevice; int m_Status; CFX_Matrix m_ImageMatrix; - CFX_RetainPtr<CFX_DIBSource> m_pDIBSource; - CFX_RetainPtr<CFX_DIBitmap> m_pCloneConvert; + RetainPtr<CFX_DIBSource> m_pDIBSource; + RetainPtr<CFX_DIBitmap> m_pCloneConvert; int m_BitmapAlpha; FX_ARGB m_FillArgb; uint32_t m_Flags; @@ -1461,7 +1461,7 @@ CXFA_ImageRenderer::CXFA_ImageRenderer() CXFA_ImageRenderer::~CXFA_ImageRenderer() {} bool CXFA_ImageRenderer::Start(CFX_RenderDevice* pDevice, - const CFX_RetainPtr<CFX_DIBSource>& pDIBSource, + const RetainPtr<CFX_DIBSource>& pDIBSource, FX_ARGB bitmap_argb, int bitmap_alpha, const CFX_Matrix* pImage2Device, @@ -1497,7 +1497,7 @@ bool CXFA_ImageRenderer::StartDIBSource() { m_Result = false; return false; } - CFX_RetainPtr<CFX_DIBSource> pDib = m_pDIBSource; + RetainPtr<CFX_DIBSource> pDib = m_pDIBSource; if (m_pDIBSource->HasAlpha() && !(m_pDevice->GetRenderCaps() & FXRC_ALPHA_IMAGE) && !(m_pDevice->GetRenderCaps() & FXRC_GET_BITS)) { @@ -1549,7 +1549,7 @@ bool CXFA_ImageRenderer::StartDIBSource() { FX_RECT dest_clip( dest_rect.left - image_rect.left, dest_rect.top - image_rect.top, dest_rect.right - image_rect.left, dest_rect.bottom - image_rect.top); - CFX_RetainPtr<CFX_DIBitmap> pStretched = + RetainPtr<CFX_DIBitmap> pStretched = m_pDIBSource->StretchTo(dest_width, dest_height, m_Flags, &dest_clip); if (pStretched) { CompositeDIBitmap(pStretched, dest_rect.left, dest_rect.top, m_FillArgb, @@ -1563,7 +1563,7 @@ bool CXFA_ImageRenderer::Continue() { if (m_pTransformer->Continue(nullptr)) return true; - CFX_RetainPtr<CFX_DIBitmap> pBitmap = m_pTransformer->DetachBitmap(); + RetainPtr<CFX_DIBitmap> pBitmap = m_pTransformer->DetachBitmap(); if (!pBitmap) return false; @@ -1589,7 +1589,7 @@ bool CXFA_ImageRenderer::Continue() { } void CXFA_ImageRenderer::CompositeDIBitmap( - const CFX_RetainPtr<CFX_DIBitmap>& pDIBitmap, + const RetainPtr<CFX_DIBitmap>& pDIBitmap, int left, int top, FX_ARGB mask_argb, @@ -1635,10 +1635,10 @@ void CXFA_ImageRenderer::CompositeDIBitmap( FX_RECT rect(left, top, left + pDIBitmap->GetWidth(), top + pDIBitmap->GetHeight()); rect.Intersect(m_pDevice->GetClipBox()); - CFX_RetainPtr<CFX_DIBitmap> pClone; + RetainPtr<CFX_DIBitmap> pClone; if (m_pDevice->GetBackDrop() && m_pDevice->GetBitmap()) { pClone = m_pDevice->GetBackDrop()->Clone(&rect); - CFX_RetainPtr<CFX_DIBitmap> pForeBitmap = m_pDevice->GetBitmap(); + RetainPtr<CFX_DIBitmap> pForeBitmap = m_pDevice->GetBitmap(); pClone->CompositeBitmap(0, 0, pClone->GetWidth(), pClone->GetHeight(), pForeBitmap, rect.left, rect.top); left = left >= 0 ? 0 : left; @@ -1667,8 +1667,7 @@ void CXFA_ImageRenderer::CompositeDIBitmap( (m_pDevice->GetRenderCaps() & FXRC_ALPHA_IMAGE)) { return; } - CFX_RetainPtr<CFX_DIBitmap> pCloneConvert = - pDIBitmap->CloneConvert(FXDIB_Rgb); + RetainPtr<CFX_DIBitmap> pCloneConvert = pDIBitmap->CloneConvert(FXDIB_Rgb); if (!pCloneConvert) return; @@ -1684,7 +1683,7 @@ void CXFA_ImageRenderer::CompositeDIBitmap( void XFA_DrawImage(CXFA_Graphics* pGS, const CFX_RectF& rtImage, const CFX_Matrix& matrix, - const CFX_RetainPtr<CFX_DIBitmap>& pDIBitmap, + const RetainPtr<CFX_DIBitmap>& pDIBitmap, int32_t iAspect, int32_t iImageXDpi, int32_t iImageYDpi, @@ -1885,11 +1884,11 @@ FXCODEC_IMAGE_TYPE XFA_GetImageType(const WideString& wsType) { return FXCODEC_IMAGE_UNKNOWN; } -CFX_RetainPtr<CFX_DIBitmap> XFA_LoadImageData(CXFA_FFDoc* pDoc, - CXFA_Image* pImage, - bool& bNameImage, - int32_t& iImageXDpi, - int32_t& iImageYDpi) { +RetainPtr<CFX_DIBitmap> XFA_LoadImageData(CXFA_FFDoc* pDoc, + CXFA_Image* pImage, + bool& bNameImage, + int32_t& iImageXDpi, + int32_t& iImageYDpi) { WideString wsHref; WideString wsImage; pImage->GetHref(wsHref); @@ -1902,7 +1901,7 @@ CFX_RetainPtr<CFX_DIBitmap> XFA_LoadImageData(CXFA_FFDoc* pDoc, FXCODEC_IMAGE_TYPE type = XFA_GetImageType(wsContentType); ByteString bsContent; uint8_t* pImageBuffer = nullptr; - CFX_RetainPtr<IFX_SeekableReadStream> pImageFileRead; + RetainPtr<IFX_SeekableReadStream> pImageFileRead; if (wsImage.GetLength() > 0) { XFA_ATTRIBUTEENUM iEncoding = (XFA_ATTRIBUTEENUM)pImage->GetTransferEncoding(); @@ -1924,7 +1923,7 @@ CFX_RetainPtr<CFX_DIBitmap> XFA_LoadImageData(CXFA_FFDoc* pDoc, } else { WideString wsURL = wsHref; if (wsURL.Left(7) != L"http://" && wsURL.Left(6) != L"ftp://") { - CFX_RetainPtr<CFX_DIBitmap> pBitmap = + RetainPtr<CFX_DIBitmap> pBitmap = pDoc->GetPDFNamedImage(wsURL.AsStringView(), iImageXDpi, iImageYDpi); if (pBitmap) { bNameImage = true; @@ -1938,7 +1937,7 @@ CFX_RetainPtr<CFX_DIBitmap> XFA_LoadImageData(CXFA_FFDoc* pDoc, return nullptr; } bNameImage = false; - CFX_RetainPtr<CFX_DIBitmap> pBitmap = + RetainPtr<CFX_DIBitmap> pBitmap = XFA_LoadImageFromBuffer(pImageFileRead, type, iImageXDpi, iImageYDpi); FX_Free(pImageBuffer); return pBitmap; @@ -1964,8 +1963,8 @@ static FXDIB_Format XFA_GetDIBFormat(FXCODEC_IMAGE_TYPE type, return dibFormat; } -CFX_RetainPtr<CFX_DIBitmap> XFA_LoadImageFromBuffer( - const CFX_RetainPtr<IFX_SeekableReadStream>& pImageFileRead, +RetainPtr<CFX_DIBitmap> XFA_LoadImageFromBuffer( + const RetainPtr<IFX_SeekableReadStream>& pImageFileRead, FXCODEC_IMAGE_TYPE type, int32_t& iImageXDpi, int32_t& iImageYDpi) { @@ -1998,7 +1997,7 @@ CFX_RetainPtr<CFX_DIBitmap> XFA_LoadImageFromBuffer( int32_t iComponents = pProgressiveDecoder->GetNumComponents(); int32_t iBpc = pProgressiveDecoder->GetBPC(); FXDIB_Format dibFormat = XFA_GetDIBFormat(type, iComponents, iBpc); - CFX_RetainPtr<CFX_DIBitmap> pBitmap = pdfium::MakeRetain<CFX_DIBitmap>(); + RetainPtr<CFX_DIBitmap> pBitmap = pdfium::MakeRetain<CFX_DIBitmap>(); pBitmap->Create(pProgressiveDecoder->GetWidth(), pProgressiveDecoder->GetHeight(), dibFormat); pBitmap->Clear(0xffffffff); |