diff options
Diffstat (limited to 'core/fxge/dib')
-rw-r--r-- | core/fxge/dib/cfx_bitmapcomposer.cpp | 2 | ||||
-rw-r--r-- | core/fxge/dib/cfx_bitmapcomposer.h | 8 | ||||
-rw-r--r-- | core/fxge/dib/cfx_bitmapstorer.cpp | 4 | ||||
-rw-r--r-- | core/fxge/dib/cfx_bitmapstorer.h | 10 | ||||
-rw-r--r-- | core/fxge/dib/cfx_dibextractor.cpp | 4 | ||||
-rw-r--r-- | core/fxge/dib/cfx_dibextractor.h | 8 | ||||
-rw-r--r-- | core/fxge/dib/cfx_dibitmap.cpp | 67 | ||||
-rw-r--r-- | core/fxge/dib/cfx_dibitmap.h | 18 | ||||
-rw-r--r-- | core/fxge/dib/cfx_dibsource.cpp | 124 | ||||
-rw-r--r-- | core/fxge/dib/cfx_dibsource.h | 34 | ||||
-rw-r--r-- | core/fxge/dib/cfx_filtereddib.cpp | 2 | ||||
-rw-r--r-- | core/fxge/dib/cfx_filtereddib.h | 8 | ||||
-rw-r--r-- | core/fxge/dib/cfx_imagerenderer.cpp | 19 | ||||
-rw-r--r-- | core/fxge/dib/cfx_imagerenderer.h | 8 | ||||
-rw-r--r-- | core/fxge/dib/cfx_imagestretcher.cpp | 13 | ||||
-rw-r--r-- | core/fxge/dib/cfx_imagestretcher.h | 8 | ||||
-rw-r--r-- | core/fxge/dib/cfx_imagetransformer.cpp | 13 | ||||
-rw-r--r-- | core/fxge/dib/cfx_imagetransformer.h | 8 | ||||
-rw-r--r-- | core/fxge/dib/cstretchengine.cpp | 2 | ||||
-rw-r--r-- | core/fxge/dib/cstretchengine.h | 6 |
20 files changed, 177 insertions, 189 deletions
diff --git a/core/fxge/dib/cfx_bitmapcomposer.cpp b/core/fxge/dib/cfx_bitmapcomposer.cpp index 5657190161..3854949207 100644 --- a/core/fxge/dib/cfx_bitmapcomposer.cpp +++ b/core/fxge/dib/cfx_bitmapcomposer.cpp @@ -14,7 +14,7 @@ CFX_BitmapComposer::CFX_BitmapComposer() CFX_BitmapComposer::~CFX_BitmapComposer() {} -void CFX_BitmapComposer::Compose(const CFX_RetainPtr<CFX_DIBitmap>& pDest, +void CFX_BitmapComposer::Compose(const RetainPtr<CFX_DIBitmap>& pDest, const CFX_ClipRgn* pClipRgn, int bitmap_alpha, uint32_t mask_color, diff --git a/core/fxge/dib/cfx_bitmapcomposer.h b/core/fxge/dib/cfx_bitmapcomposer.h index cc4ecb13fe..7fb3037cc1 100644 --- a/core/fxge/dib/cfx_bitmapcomposer.h +++ b/core/fxge/dib/cfx_bitmapcomposer.h @@ -9,9 +9,9 @@ #include <vector> -#include "core/fxcrt/cfx_retain_ptr.h" #include "core/fxcrt/cfx_unowned_ptr.h" #include "core/fxcrt/fx_coordinates.h" +#include "core/fxcrt/retain_ptr.h" #include "core/fxge/dib/cfx_scanlinecompositor.h" #include "core/fxge/dib/ifx_scanlinecomposer.h" @@ -23,7 +23,7 @@ class CFX_BitmapComposer : public IFX_ScanlineComposer { CFX_BitmapComposer(); ~CFX_BitmapComposer() override; - void Compose(const CFX_RetainPtr<CFX_DIBitmap>& pDest, + void Compose(const RetainPtr<CFX_DIBitmap>& pDest, const CFX_ClipRgn* pClipRgn, int bitmap_alpha, uint32_t mask_color, @@ -56,7 +56,7 @@ class CFX_BitmapComposer : public IFX_ScanlineComposer { const uint8_t* scanline, const uint8_t* scan_extra_alpha); - CFX_RetainPtr<CFX_DIBitmap> m_pBitmap; + RetainPtr<CFX_DIBitmap> m_pBitmap; CFX_UnownedPtr<const CFX_ClipRgn> m_pClipRgn; FXDIB_Format m_SrcFormat; int m_DestLeft; @@ -65,7 +65,7 @@ class CFX_BitmapComposer : public IFX_ScanlineComposer { int m_DestHeight; int m_BitmapAlpha; uint32_t m_MaskColor; - CFX_RetainPtr<CFX_DIBitmap> m_pClipMask; + RetainPtr<CFX_DIBitmap> m_pClipMask; CFX_ScanlineCompositor m_Compositor; bool m_bVertical; bool m_bFlipX; diff --git a/core/fxge/dib/cfx_bitmapstorer.cpp b/core/fxge/dib/cfx_bitmapstorer.cpp index 1e09708098..f649e0caea 100644 --- a/core/fxge/dib/cfx_bitmapstorer.cpp +++ b/core/fxge/dib/cfx_bitmapstorer.cpp @@ -14,11 +14,11 @@ CFX_BitmapStorer::CFX_BitmapStorer() {} CFX_BitmapStorer::~CFX_BitmapStorer() {} -CFX_RetainPtr<CFX_DIBitmap> CFX_BitmapStorer::Detach() { +RetainPtr<CFX_DIBitmap> CFX_BitmapStorer::Detach() { return std::move(m_pBitmap); } -void CFX_BitmapStorer::Replace(CFX_RetainPtr<CFX_DIBitmap>&& pBitmap) { +void CFX_BitmapStorer::Replace(RetainPtr<CFX_DIBitmap>&& pBitmap) { m_pBitmap = std::move(pBitmap); } diff --git a/core/fxge/dib/cfx_bitmapstorer.h b/core/fxge/dib/cfx_bitmapstorer.h index a574493e6e..3d3416daa1 100644 --- a/core/fxge/dib/cfx_bitmapstorer.h +++ b/core/fxge/dib/cfx_bitmapstorer.h @@ -10,8 +10,8 @@ #include <memory> #include <vector> -#include "core/fxcrt/cfx_retain_ptr.h" #include "core/fxcrt/fx_coordinates.h" +#include "core/fxcrt/retain_ptr.h" #include "core/fxge/dib/cfx_dibitmap.h" #include "core/fxge/dib/ifx_scanlinecomposer.h" #include "third_party/base/stl_util.h" @@ -30,12 +30,12 @@ class CFX_BitmapStorer : public IFX_ScanlineComposer { FXDIB_Format src_format, uint32_t* pSrcPalette) override; - CFX_RetainPtr<CFX_DIBitmap> GetBitmap() { return m_pBitmap; } - CFX_RetainPtr<CFX_DIBitmap> Detach(); - void Replace(CFX_RetainPtr<CFX_DIBitmap>&& pBitmap); + RetainPtr<CFX_DIBitmap> GetBitmap() { return m_pBitmap; } + RetainPtr<CFX_DIBitmap> Detach(); + void Replace(RetainPtr<CFX_DIBitmap>&& pBitmap); private: - CFX_RetainPtr<CFX_DIBitmap> m_pBitmap; + RetainPtr<CFX_DIBitmap> m_pBitmap; }; #endif // CORE_FXGE_DIB_CFX_BITMAPSTORER_H_ diff --git a/core/fxge/dib/cfx_dibextractor.cpp b/core/fxge/dib/cfx_dibextractor.cpp index 325454a580..13ad461cb1 100644 --- a/core/fxge/dib/cfx_dibextractor.cpp +++ b/core/fxge/dib/cfx_dibextractor.cpp @@ -8,12 +8,12 @@ #include "core/fxge/dib/cfx_dibsource.h" -CFX_DIBExtractor::CFX_DIBExtractor(const CFX_RetainPtr<CFX_DIBSource>& pSrc) { +CFX_DIBExtractor::CFX_DIBExtractor(const RetainPtr<CFX_DIBSource>& pSrc) { if (!pSrc->GetBuffer()) { m_pBitmap = pSrc->Clone(nullptr); return; } - CFX_RetainPtr<CFX_DIBSource> pOldSrc(pSrc); + RetainPtr<CFX_DIBSource> pOldSrc(pSrc); m_pBitmap = pdfium::MakeRetain<CFX_DIBitmap>(); if (!m_pBitmap->Create(pOldSrc->GetWidth(), pOldSrc->GetHeight(), pOldSrc->GetFormat(), pOldSrc->GetBuffer())) { diff --git a/core/fxge/dib/cfx_dibextractor.h b/core/fxge/dib/cfx_dibextractor.h index 25d80ecb94..b6c27a7bd7 100644 --- a/core/fxge/dib/cfx_dibextractor.h +++ b/core/fxge/dib/cfx_dibextractor.h @@ -7,20 +7,20 @@ #ifndef CORE_FXGE_DIB_CFX_DIBEXTRACTOR_H_ #define CORE_FXGE_DIB_CFX_DIBEXTRACTOR_H_ -#include "core/fxcrt/cfx_retain_ptr.h" +#include "core/fxcrt/retain_ptr.h" #include "core/fxge/dib/cfx_dibitmap.h" class CFX_DIBSource; class CFX_DIBExtractor { public: - explicit CFX_DIBExtractor(const CFX_RetainPtr<CFX_DIBSource>& pSrc); + explicit CFX_DIBExtractor(const RetainPtr<CFX_DIBSource>& pSrc); ~CFX_DIBExtractor(); - CFX_RetainPtr<CFX_DIBitmap> GetBitmap() { return m_pBitmap; } + RetainPtr<CFX_DIBitmap> GetBitmap() { return m_pBitmap; } private: - CFX_RetainPtr<CFX_DIBitmap> m_pBitmap; + RetainPtr<CFX_DIBitmap> m_pBitmap; }; #endif // CORE_FXGE_DIB_CFX_DIBEXTRACTOR_H_ diff --git a/core/fxge/dib/cfx_dibitmap.cpp b/core/fxge/dib/cfx_dibitmap.cpp index fd6defece2..8e105937ee 100644 --- a/core/fxge/dib/cfx_dibitmap.cpp +++ b/core/fxge/dib/cfx_dibitmap.cpp @@ -81,7 +81,7 @@ bool CFX_DIBitmap::Create(int width, return false; } -bool CFX_DIBitmap::Copy(const CFX_RetainPtr<CFX_DIBSource>& pSrc) { +bool CFX_DIBitmap::Copy(const RetainPtr<CFX_DIBSource>& pSrc) { if (m_pBuffer) return false; @@ -105,7 +105,7 @@ const uint8_t* CFX_DIBitmap::GetScanline(int line) const { return m_pBuffer.Get() ? m_pBuffer.Get() + line * m_Pitch : nullptr; } -void CFX_DIBitmap::TakeOver(CFX_RetainPtr<CFX_DIBitmap>&& pSrcBitmap) { +void CFX_DIBitmap::TakeOver(RetainPtr<CFX_DIBitmap>&& pSrcBitmap) { m_pBuffer = std::move(pSrcBitmap->m_pBuffer); m_pPalette = std::move(pSrcBitmap->m_pPalette); m_pAlphaMask = pSrcBitmap->m_pAlphaMask; @@ -180,14 +180,13 @@ void CFX_DIBitmap::Clear(uint32_t color) { } } -bool CFX_DIBitmap::TransferBitmap( - int dest_left, - int dest_top, - int width, - int height, - const CFX_RetainPtr<CFX_DIBSource>& pSrcBitmap, - int src_left, - int src_top) { +bool CFX_DIBitmap::TransferBitmap(int dest_left, + int dest_top, + int width, + int height, + const RetainPtr<CFX_DIBSource>& pSrcBitmap, + int src_left, + int src_top) { if (!m_pBuffer) return false; @@ -243,12 +242,12 @@ bool CFX_DIBitmap::TransferBitmap( } bool CFX_DIBitmap::LoadChannel(FXDIB_Channel destChannel, - const CFX_RetainPtr<CFX_DIBSource>& pSrcBitmap, + const RetainPtr<CFX_DIBSource>& pSrcBitmap, FXDIB_Channel srcChannel) { if (!m_pBuffer) return false; - CFX_RetainPtr<CFX_DIBSource> pSrcClone = pSrcBitmap; + RetainPtr<CFX_DIBSource> pSrcClone = pSrcBitmap; int srcOffset; if (srcChannel == FXDIB_Alpha) { if (!pSrcBitmap->HasAlpha() && !pSrcBitmap->IsAlphaMask()) @@ -308,7 +307,7 @@ bool CFX_DIBitmap::LoadChannel(FXDIB_Channel destChannel, destOffset = g_ChannelOffset[destChannel]; } if (srcChannel == FXDIB_Alpha && pSrcClone->m_pAlphaMask) { - CFX_RetainPtr<CFX_DIBSource> pAlphaMask = pSrcClone->m_pAlphaMask; + RetainPtr<CFX_DIBSource> pAlphaMask = pSrcClone->m_pAlphaMask; if (pSrcClone->GetWidth() != m_Width || pSrcClone->GetHeight() != m_Height) { if (pAlphaMask) { @@ -321,14 +320,14 @@ bool CFX_DIBitmap::LoadChannel(FXDIB_Channel destChannel, srcOffset = 0; } else if (pSrcClone->GetWidth() != m_Width || pSrcClone->GetHeight() != m_Height) { - CFX_RetainPtr<CFX_DIBitmap> pSrcMatched = + RetainPtr<CFX_DIBitmap> pSrcMatched = pSrcClone->StretchTo(m_Width, m_Height, 0, nullptr); if (!pSrcMatched) return false; pSrcClone = std::move(pSrcMatched); } - CFX_RetainPtr<CFX_DIBitmap> pDst(this); + RetainPtr<CFX_DIBitmap> pDst(this); if (destChannel == FXDIB_Alpha && m_pAlphaMask) { pDst = m_pAlphaMask; destOffset = 0; @@ -406,8 +405,7 @@ bool CFX_DIBitmap::LoadChannel(FXDIB_Channel destChannel, int value) { return true; } -bool CFX_DIBitmap::MultiplyAlpha( - const CFX_RetainPtr<CFX_DIBSource>& pSrcBitmap) { +bool CFX_DIBitmap::MultiplyAlpha(const RetainPtr<CFX_DIBSource>& pSrcBitmap) { if (!m_pBuffer) return false; @@ -418,7 +416,7 @@ bool CFX_DIBitmap::MultiplyAlpha( if (!IsAlphaMask() && !HasAlpha()) return LoadChannel(FXDIB_Alpha, pSrcBitmap, FXDIB_Alpha); - CFX_RetainPtr<CFX_DIBitmap> pSrcClone = pSrcBitmap.As<CFX_DIBitmap>(); + RetainPtr<CFX_DIBitmap> pSrcClone = pSrcBitmap.As<CFX_DIBitmap>(); if (pSrcBitmap->GetWidth() != m_Width || pSrcBitmap->GetHeight() != m_Height) { pSrcClone = pSrcBitmap->StretchTo(m_Width, m_Height, 0, nullptr); @@ -834,17 +832,16 @@ bool CFX_DIBitmap::CalculatePitchAndSize(int height, return true; } -bool CFX_DIBitmap::CompositeBitmap( - int dest_left, - int dest_top, - int width, - int height, - const CFX_RetainPtr<CFX_DIBSource>& pSrcBitmap, - int src_left, - int src_top, - int blend_type, - const CFX_ClipRgn* pClipRgn, - bool bRgbByteOrder) { +bool CFX_DIBitmap::CompositeBitmap(int dest_left, + int dest_top, + int width, + int height, + const RetainPtr<CFX_DIBSource>& pSrcBitmap, + int src_left, + int src_top, + int blend_type, + const CFX_ClipRgn* pClipRgn, + bool bRgbByteOrder) { if (!m_pBuffer) return false; @@ -858,7 +855,7 @@ bool CFX_DIBitmap::CompositeBitmap( if (width == 0 || height == 0) { return true; } - CFX_RetainPtr<CFX_DIBitmap> pClipMask; + RetainPtr<CFX_DIBitmap> pClipMask; FX_RECT clip_box; if (pClipRgn && pClipRgn->GetType() != CFX_ClipRgn::RectI) { ASSERT(pClipRgn->GetType() == CFX_ClipRgn::MaskF); @@ -874,7 +871,7 @@ bool CFX_DIBitmap::CompositeBitmap( int dest_Bpp = m_bpp / 8; int src_Bpp = pSrcBitmap->GetBPP() / 8; bool bRgb = src_Bpp > 1 && !pSrcBitmap->IsCmykImage(); - CFX_RetainPtr<CFX_DIBitmap> pSrcAlphaMask = pSrcBitmap->m_pAlphaMask; + RetainPtr<CFX_DIBitmap> pSrcAlphaMask = pSrcBitmap->m_pAlphaMask; for (int row = 0; row < height; row++) { uint8_t* dest_scan = m_pBuffer.Get() + (dest_top + row) * m_Pitch + dest_left * dest_Bpp; @@ -910,7 +907,7 @@ bool CFX_DIBitmap::CompositeMask(int dest_left, int dest_top, int width, int height, - const CFX_RetainPtr<CFX_DIBSource>& pMask, + const RetainPtr<CFX_DIBSource>& pMask, uint32_t color, int src_left, int src_top, @@ -936,7 +933,7 @@ bool CFX_DIBitmap::CompositeMask(int dest_left, if (src_alpha == 0) return true; - CFX_RetainPtr<CFX_DIBitmap> pClipMask; + RetainPtr<CFX_DIBitmap> pClipMask; FX_RECT clip_box; if (pClipRgn && pClipRgn->GetType() != CFX_ClipRgn::RectI) { ASSERT(pClipRgn->GetType() == CFX_ClipRgn::MaskF); @@ -1197,7 +1194,7 @@ bool CFX_DIBitmap::ConvertFormat(FXDIB_Format dest_format) { if (!dest_buf) return false; - CFX_RetainPtr<CFX_DIBitmap> pAlphaMask; + RetainPtr<CFX_DIBitmap> pAlphaMask; if (dest_format == FXDIB_Argb) { memset(dest_buf.get(), 0xff, dest_pitch * m_Height + 4); if (m_pAlphaMask) { @@ -1226,7 +1223,7 @@ bool CFX_DIBitmap::ConvertFormat(FXDIB_Format dest_format) { } } bool ret = false; - CFX_RetainPtr<CFX_DIBSource> holder(this); + RetainPtr<CFX_DIBSource> holder(this); std::unique_ptr<uint32_t, FxFreeDeleter> pal_8bpp; ret = ConvertBuffer(dest_format, dest_buf.get(), dest_pitch, m_Width, m_Height, holder, 0, 0, &pal_8bpp); diff --git a/core/fxge/dib/cfx_dibitmap.h b/core/fxge/dib/cfx_dibitmap.h index 79eeaeb273..7240829773 100644 --- a/core/fxge/dib/cfx_dibitmap.h +++ b/core/fxge/dib/cfx_dibitmap.h @@ -7,16 +7,16 @@ #ifndef CORE_FXGE_DIB_CFX_DIBITMAP_H_ #define CORE_FXGE_DIB_CFX_DIBITMAP_H_ -#include "core/fxcrt/cfx_retain_ptr.h" #include "core/fxcrt/fx_coordinates.h" #include "core/fxcrt/maybe_owned.h" +#include "core/fxcrt/retain_ptr.h" #include "core/fxge/dib/cfx_dibsource.h" #include "third_party/base/stl_util.h" class CFX_DIBitmap : public CFX_DIBSource { public: template <typename T, typename... Args> - friend CFX_RetainPtr<T> pdfium::MakeRetain(Args&&... args); + friend RetainPtr<T> pdfium::MakeRetain(Args&&... args); ~CFX_DIBitmap() override; @@ -26,7 +26,7 @@ class CFX_DIBitmap : public CFX_DIBSource { uint8_t* pBuffer = nullptr, uint32_t pitch = 0); - bool Copy(const CFX_RetainPtr<CFX_DIBSource>& pSrc); + bool Copy(const RetainPtr<CFX_DIBSource>& pSrc); // CFX_DIBSource uint8_t* GetBuffer() const override; @@ -39,7 +39,7 @@ class CFX_DIBitmap : public CFX_DIBSource { int clip_left, int clip_width) const override; - void TakeOver(CFX_RetainPtr<CFX_DIBitmap>&& pSrcBitmap); + void TakeOver(RetainPtr<CFX_DIBitmap>&& pSrcBitmap); bool ConvertFormat(FXDIB_Format format); void Clear(uint32_t color); @@ -47,18 +47,18 @@ class CFX_DIBitmap : public CFX_DIBSource { void SetPixel(int x, int y, uint32_t color); bool LoadChannel(FXDIB_Channel destChannel, - const CFX_RetainPtr<CFX_DIBSource>& pSrcBitmap, + const RetainPtr<CFX_DIBSource>& pSrcBitmap, FXDIB_Channel srcChannel); bool LoadChannel(FXDIB_Channel destChannel, int value); bool MultiplyAlpha(int alpha); - bool MultiplyAlpha(const CFX_RetainPtr<CFX_DIBSource>& pAlphaMask); + bool MultiplyAlpha(const RetainPtr<CFX_DIBSource>& pAlphaMask); bool TransferBitmap(int dest_left, int dest_top, int width, int height, - const CFX_RetainPtr<CFX_DIBSource>& pSrcBitmap, + const RetainPtr<CFX_DIBSource>& pSrcBitmap, int src_left, int src_top); @@ -66,7 +66,7 @@ class CFX_DIBitmap : public CFX_DIBSource { int dest_top, int width, int height, - const CFX_RetainPtr<CFX_DIBSource>& pSrcBitmap, + const RetainPtr<CFX_DIBSource>& pSrcBitmap, int src_left, int src_top, int blend_type = FXDIB_BLEND_NORMAL, @@ -77,7 +77,7 @@ class CFX_DIBitmap : public CFX_DIBSource { int dest_top, int width, int height, - const CFX_RetainPtr<CFX_DIBSource>& pMask, + const RetainPtr<CFX_DIBSource>& pMask, uint32_t color, int src_left, int src_top, diff --git a/core/fxge/dib/cfx_dibsource.cpp b/core/fxge/dib/cfx_dibsource.cpp index c0e7841b89..9382917286 100644 --- a/core/fxge/dib/cfx_dibsource.cpp +++ b/core/fxge/dib/cfx_dibsource.cpp @@ -24,7 +24,7 @@ namespace { class CFX_Palette { public: - explicit CFX_Palette(const CFX_RetainPtr<CFX_DIBSource>& pBitmap); + explicit CFX_Palette(const RetainPtr<CFX_DIBSource>& pBitmap); ~CFX_Palette(); const uint32_t* GetPalette() { return m_Palette.data(); } @@ -64,7 +64,7 @@ void Obtain_Pal(std::pair<uint32_t, uint32_t>* luts, } } -CFX_Palette::CFX_Palette(const CFX_RetainPtr<CFX_DIBSource>& pBitmap) +CFX_Palette::CFX_Palette(const RetainPtr<CFX_DIBSource>& pBitmap) : m_Palette(256), m_Luts(4096), m_lut(0) { int bpp = pBitmap->GetBPP() / 8; int width = pBitmap->GetWidth(); @@ -102,7 +102,7 @@ bool ConvertBuffer_1bppMask2Gray(uint8_t* dest_buf, int dest_pitch, int width, int height, - const CFX_RetainPtr<CFX_DIBSource>& pSrcBitmap, + const RetainPtr<CFX_DIBSource>& pSrcBitmap, int src_left, int src_top) { uint8_t set_gray, reset_gray; @@ -126,7 +126,7 @@ bool ConvertBuffer_8bppMask2Gray(uint8_t* dest_buf, int dest_pitch, int width, int height, - const CFX_RetainPtr<CFX_DIBSource>& pSrcBitmap, + const RetainPtr<CFX_DIBSource>& pSrcBitmap, int src_left, int src_top) { for (int row = 0; row < height; row++) { @@ -141,7 +141,7 @@ bool ConvertBuffer_1bppPlt2Gray(uint8_t* dest_buf, int dest_pitch, int width, int height, - const CFX_RetainPtr<CFX_DIBSource>& pSrcBitmap, + const RetainPtr<CFX_DIBSource>& pSrcBitmap, int src_left, int src_top) { uint32_t* src_plt = pSrcBitmap->GetPalette(); @@ -188,7 +188,7 @@ bool ConvertBuffer_8bppPlt2Gray(uint8_t* dest_buf, int dest_pitch, int width, int height, - const CFX_RetainPtr<CFX_DIBSource>& pSrcBitmap, + const RetainPtr<CFX_DIBSource>& pSrcBitmap, int src_left, int src_top) { uint32_t* src_plt = pSrcBitmap->GetPalette(); @@ -220,14 +220,13 @@ bool ConvertBuffer_8bppPlt2Gray(uint8_t* dest_buf, return true; } -bool ConvertBuffer_RgbOrCmyk2Gray( - uint8_t* dest_buf, - int dest_pitch, - int width, - int height, - const CFX_RetainPtr<CFX_DIBSource>& pSrcBitmap, - int src_left, - int src_top) { +bool ConvertBuffer_RgbOrCmyk2Gray(uint8_t* dest_buf, + int dest_pitch, + int width, + int height, + const RetainPtr<CFX_DIBSource>& pSrcBitmap, + int src_left, + int src_top) { int Bpp = pSrcBitmap->GetBPP() / 8; if (pSrcBitmap->IsCmykImage()) { for (int row = 0; row < height; row++) { @@ -265,7 +264,7 @@ void ConvertBuffer_IndexCopy(uint8_t* dest_buf, int dest_pitch, int width, int height, - const CFX_RetainPtr<CFX_DIBSource>& pSrcBitmap, + const RetainPtr<CFX_DIBSource>& pSrcBitmap, int src_left, int src_top) { if (pSrcBitmap->GetBPP() == 1) { @@ -296,7 +295,7 @@ bool ConvertBuffer_Plt2PltRgb8(uint8_t* dest_buf, int dest_pitch, int width, int height, - const CFX_RetainPtr<CFX_DIBSource>& pSrcBitmap, + const RetainPtr<CFX_DIBSource>& pSrcBitmap, int src_left, int src_top, uint32_t* dst_plt) { @@ -324,7 +323,7 @@ bool ConvertBuffer_Rgb2PltRgb8(uint8_t* dest_buf, int dest_pitch, int width, int height, - const CFX_RetainPtr<CFX_DIBSource>& pSrcBitmap, + const RetainPtr<CFX_DIBSource>& pSrcBitmap, int src_left, int src_top, uint32_t* dst_plt) { @@ -387,7 +386,7 @@ bool ConvertBuffer_1bppMask2Rgb(FXDIB_Format dst_format, int dest_pitch, int width, int height, - const CFX_RetainPtr<CFX_DIBSource>& pSrcBitmap, + const RetainPtr<CFX_DIBSource>& pSrcBitmap, int src_left, int src_top) { int comps = (dst_format & 0xff) / 8; @@ -418,7 +417,7 @@ bool ConvertBuffer_8bppMask2Rgb(FXDIB_Format dst_format, int dest_pitch, int width, int height, - const CFX_RetainPtr<CFX_DIBSource>& pSrcBitmap, + const RetainPtr<CFX_DIBSource>& pSrcBitmap, int src_left, int src_top) { int comps = (dst_format & 0xff) / 8; @@ -442,7 +441,7 @@ bool ConvertBuffer_1bppPlt2Rgb(FXDIB_Format dst_format, int dest_pitch, int width, int height, - const CFX_RetainPtr<CFX_DIBSource>& pSrcBitmap, + const RetainPtr<CFX_DIBSource>& pSrcBitmap, int src_left, int src_top) { int comps = (dst_format & 0xff) / 8; @@ -494,7 +493,7 @@ bool ConvertBuffer_8bppPlt2Rgb(FXDIB_Format dst_format, int dest_pitch, int width, int height, - const CFX_RetainPtr<CFX_DIBSource>& pSrcBitmap, + const RetainPtr<CFX_DIBSource>& pSrcBitmap, int src_left, int src_top) { int comps = (dst_format & 0xff) / 8; @@ -534,14 +533,13 @@ bool ConvertBuffer_8bppPlt2Rgb(FXDIB_Format dst_format, return true; } -bool ConvertBuffer_24bppRgb2Rgb24( - uint8_t* dest_buf, - int dest_pitch, - int width, - int height, - const CFX_RetainPtr<CFX_DIBSource>& pSrcBitmap, - int src_left, - int src_top) { +bool ConvertBuffer_24bppRgb2Rgb24(uint8_t* dest_buf, + int dest_pitch, + int width, + int height, + const RetainPtr<CFX_DIBSource>& pSrcBitmap, + int src_left, + int src_top) { for (int row = 0; row < height; row++) { uint8_t* dest_scan = dest_buf + row * dest_pitch; const uint8_t* src_scan = @@ -551,14 +549,13 @@ bool ConvertBuffer_24bppRgb2Rgb24( return true; } -bool ConvertBuffer_32bppRgb2Rgb24( - uint8_t* dest_buf, - int dest_pitch, - int width, - int height, - const CFX_RetainPtr<CFX_DIBSource>& pSrcBitmap, - int src_left, - int src_top) { +bool ConvertBuffer_32bppRgb2Rgb24(uint8_t* dest_buf, + int dest_pitch, + int width, + int height, + const RetainPtr<CFX_DIBSource>& pSrcBitmap, + int src_left, + int src_top) { for (int row = 0; row < height; row++) { uint8_t* dest_scan = dest_buf + row * dest_pitch; const uint8_t* src_scan = @@ -577,7 +574,7 @@ bool ConvertBuffer_Rgb2Rgb32(uint8_t* dest_buf, int dest_pitch, int width, int height, - const CFX_RetainPtr<CFX_DIBSource>& pSrcBitmap, + const RetainPtr<CFX_DIBSource>& pSrcBitmap, int src_left, int src_top) { int comps = pSrcBitmap->GetBPP() / 8; @@ -596,14 +593,13 @@ bool ConvertBuffer_Rgb2Rgb32(uint8_t* dest_buf, return true; } -bool ConvertBuffer_32bppCmyk2Rgb32( - uint8_t* dest_buf, - int dest_pitch, - int width, - int height, - const CFX_RetainPtr<CFX_DIBSource>& pSrcBitmap, - int src_left, - int src_top) { +bool ConvertBuffer_32bppCmyk2Rgb32(uint8_t* dest_buf, + int dest_pitch, + int width, + int height, + const RetainPtr<CFX_DIBSource>& pSrcBitmap, + int src_left, + int src_top) { for (int row = 0; row < height; row++) { uint8_t* dest_scan = dest_buf + row * dest_pitch; const uint8_t* src_scan = @@ -633,7 +629,7 @@ bool CFX_DIBSource::SkipToScanline(int line, IFX_PauseIndicator* pPause) const { return false; } -CFX_RetainPtr<CFX_DIBitmap> CFX_DIBSource::Clone(const FX_RECT* pClip) const { +RetainPtr<CFX_DIBitmap> CFX_DIBSource::Clone(const FX_RECT* pClip) const { FX_RECT rect(0, 0, m_Width, m_Height); if (pClip) { rect.Intersect(*pClip); @@ -829,7 +825,7 @@ void CFX_DIBSource::GetPalette(uint32_t* pal, int alpha) const { } } -CFX_RetainPtr<CFX_DIBitmap> CFX_DIBSource::CloneAlphaMask() const { +RetainPtr<CFX_DIBitmap> CFX_DIBSource::CloneAlphaMask() const { ASSERT(GetFormat() == FXDIB_Argb); FX_RECT rect(0, 0, m_Width, m_Height); auto pMask = pdfium::MakeRetain<CFX_DIBitmap>(); @@ -848,7 +844,7 @@ CFX_RetainPtr<CFX_DIBitmap> CFX_DIBSource::CloneAlphaMask() const { return pMask; } -bool CFX_DIBSource::SetAlphaMask(const CFX_RetainPtr<CFX_DIBSource>& pAlphaMask, +bool CFX_DIBSource::SetAlphaMask(const RetainPtr<CFX_DIBSource>& pAlphaMask, const FX_RECT* pClip) { if (!HasAlpha() || GetFormat() == FXDIB_Argb) return false; @@ -876,8 +872,8 @@ bool CFX_DIBSource::SetAlphaMask(const CFX_RetainPtr<CFX_DIBSource>& pAlphaMask, return true; } -CFX_RetainPtr<CFX_DIBitmap> CFX_DIBSource::FlipImage(bool bXFlip, - bool bYFlip) const { +RetainPtr<CFX_DIBitmap> CFX_DIBSource::FlipImage(bool bXFlip, + bool bYFlip) const { auto pFlipped = pdfium::MakeRetain<CFX_DIBitmap>(); if (!pFlipped->Create(m_Width, m_Height, GetFormat())) return nullptr; @@ -948,8 +944,7 @@ CFX_RetainPtr<CFX_DIBitmap> CFX_DIBSource::FlipImage(bool bXFlip, return pFlipped; } -CFX_RetainPtr<CFX_DIBitmap> CFX_DIBSource::CloneConvert( - FXDIB_Format dest_format) { +RetainPtr<CFX_DIBitmap> CFX_DIBSource::CloneConvert(FXDIB_Format dest_format) { if (dest_format == GetFormat()) return Clone(nullptr); @@ -957,7 +952,7 @@ CFX_RetainPtr<CFX_DIBitmap> CFX_DIBSource::CloneConvert( if (!pClone->Create(m_Width, m_Height, dest_format)) return nullptr; - CFX_RetainPtr<CFX_DIBitmap> pSrcAlpha; + RetainPtr<CFX_DIBitmap> pSrcAlpha; if (HasAlpha()) { if (GetFormat() == FXDIB_Argb) pSrcAlpha = CloneAlphaMask(); @@ -979,7 +974,7 @@ CFX_RetainPtr<CFX_DIBitmap> CFX_DIBSource::CloneConvert( if (!ret) return nullptr; - CFX_RetainPtr<CFX_DIBSource> holder(this); + RetainPtr<CFX_DIBSource> holder(this); std::unique_ptr<uint32_t, FxFreeDeleter> pal_8bpp; if (!ConvertBuffer(dest_format, pClone->GetBuffer(), pClone->GetPitch(), m_Width, m_Height, holder, 0, 0, &pal_8bpp)) { @@ -991,8 +986,7 @@ CFX_RetainPtr<CFX_DIBitmap> CFX_DIBSource::CloneConvert( return pClone; } -CFX_RetainPtr<CFX_DIBitmap> CFX_DIBSource::SwapXY(bool bXFlip, - bool bYFlip) const { +RetainPtr<CFX_DIBitmap> CFX_DIBSource::SwapXY(bool bXFlip, bool bYFlip) const { FX_RECT dest_clip(0, 0, m_Height, m_Width); if (dest_clip.IsEmpty()) return nullptr; @@ -1086,11 +1080,11 @@ CFX_RetainPtr<CFX_DIBitmap> CFX_DIBSource::SwapXY(bool bXFlip, return pTransBitmap; } -CFX_RetainPtr<CFX_DIBitmap> CFX_DIBSource::TransformTo( +RetainPtr<CFX_DIBitmap> CFX_DIBSource::TransformTo( const CFX_Matrix* pDestMatrix, int* result_left, int* result_top) { - CFX_RetainPtr<CFX_DIBSource> holder(this); + RetainPtr<CFX_DIBSource> holder(this); CFX_ImageTransformer transformer(holder, pDestMatrix, 0, nullptr); transformer.Continue(nullptr); *result_left = transformer.result().left; @@ -1098,11 +1092,11 @@ CFX_RetainPtr<CFX_DIBitmap> CFX_DIBSource::TransformTo( return transformer.DetachBitmap(); } -CFX_RetainPtr<CFX_DIBitmap> CFX_DIBSource::StretchTo(int dest_width, - int dest_height, - uint32_t flags, - const FX_RECT* pClip) { - CFX_RetainPtr<CFX_DIBSource> holder(this); +RetainPtr<CFX_DIBitmap> CFX_DIBSource::StretchTo(int dest_width, + int dest_height, + uint32_t flags, + const FX_RECT* pClip) { + RetainPtr<CFX_DIBSource> holder(this); FX_RECT clip_rect(0, 0, abs(dest_width), abs(dest_height)); if (pClip) clip_rect.Intersect(*pClip); @@ -1129,7 +1123,7 @@ bool CFX_DIBSource::ConvertBuffer( int dest_pitch, int width, int height, - const CFX_RetainPtr<CFX_DIBSource>& pSrcBitmap, + const RetainPtr<CFX_DIBSource>& pSrcBitmap, int src_left, int src_top, std::unique_ptr<uint32_t, FxFreeDeleter>* p_pal) { diff --git a/core/fxge/dib/cfx_dibsource.h b/core/fxge/dib/cfx_dibsource.h index 2315318ccb..e2cdfa61ad 100644 --- a/core/fxge/dib/cfx_dibsource.h +++ b/core/fxge/dib/cfx_dibsource.h @@ -9,9 +9,9 @@ #include <memory> -#include "core/fxcrt/cfx_retain_ptr.h" #include "core/fxcrt/fx_coordinates.h" #include "core/fxcrt/fx_memory.h" +#include "core/fxcrt/retain_ptr.h" #include "core/fxge/fx_dib.h" enum FXDIB_Channel { @@ -29,7 +29,7 @@ class CFX_ClipRgn; class CFX_DIBitmap; class IFX_PauseIndicator; -class CFX_DIBSource : public CFX_Retainable { +class CFX_DIBSource : public Retainable { public: ~CFX_DIBSource() override; @@ -72,22 +72,22 @@ class CFX_DIBSource : public CFX_Retainable { // Copies into internally-owned palette. void SetPalette(const uint32_t* pSrcPal); - CFX_RetainPtr<CFX_DIBitmap> Clone(const FX_RECT* pClip) const; - CFX_RetainPtr<CFX_DIBitmap> CloneConvert(FXDIB_Format format); - CFX_RetainPtr<CFX_DIBitmap> StretchTo(int dest_width, - int dest_height, - uint32_t flags, - const FX_RECT* pClip); - CFX_RetainPtr<CFX_DIBitmap> TransformTo(const CFX_Matrix* pMatrix, - int* left, - int* top); - CFX_RetainPtr<CFX_DIBitmap> SwapXY(bool bXFlip, bool bYFlip) const; - CFX_RetainPtr<CFX_DIBitmap> FlipImage(bool bXFlip, bool bYFlip) const; + RetainPtr<CFX_DIBitmap> Clone(const FX_RECT* pClip) const; + RetainPtr<CFX_DIBitmap> CloneConvert(FXDIB_Format format); + RetainPtr<CFX_DIBitmap> StretchTo(int dest_width, + int dest_height, + uint32_t flags, + const FX_RECT* pClip); + RetainPtr<CFX_DIBitmap> TransformTo(const CFX_Matrix* pMatrix, + int* left, + int* top); + RetainPtr<CFX_DIBitmap> SwapXY(bool bXFlip, bool bYFlip) const; + RetainPtr<CFX_DIBitmap> FlipImage(bool bXFlip, bool bYFlip) const; - CFX_RetainPtr<CFX_DIBitmap> CloneAlphaMask() const; + RetainPtr<CFX_DIBitmap> CloneAlphaMask() const; // Copies into internally-owned mask. - bool SetAlphaMask(const CFX_RetainPtr<CFX_DIBSource>& pAlphaMask, + bool SetAlphaMask(const RetainPtr<CFX_DIBSource>& pAlphaMask, const FX_RECT* pClip); void GetOverlapRect(int& dest_left, @@ -104,7 +104,7 @@ class CFX_DIBSource : public CFX_Retainable { void DebugVerifyBitmapIsPreMultiplied(void* buffer) const; #endif - CFX_RetainPtr<CFX_DIBitmap> m_pAlphaMask; + RetainPtr<CFX_DIBitmap> m_pAlphaMask; protected: CFX_DIBSource(); @@ -114,7 +114,7 @@ class CFX_DIBSource : public CFX_Retainable { int dest_pitch, int width, int height, - const CFX_RetainPtr<CFX_DIBSource>& pSrcBitmap, + const RetainPtr<CFX_DIBSource>& pSrcBitmap, int src_left, int src_top, std::unique_ptr<uint32_t, FxFreeDeleter>* pal); diff --git a/core/fxge/dib/cfx_filtereddib.cpp b/core/fxge/dib/cfx_filtereddib.cpp index 2d6edd0d60..96fc8062a0 100644 --- a/core/fxge/dib/cfx_filtereddib.cpp +++ b/core/fxge/dib/cfx_filtereddib.cpp @@ -12,7 +12,7 @@ CFX_FilteredDIB::CFX_FilteredDIB() {} CFX_FilteredDIB::~CFX_FilteredDIB() {} -void CFX_FilteredDIB::LoadSrc(const CFX_RetainPtr<CFX_DIBSource>& pSrc) { +void CFX_FilteredDIB::LoadSrc(const RetainPtr<CFX_DIBSource>& pSrc) { m_pSrc = pSrc; m_Width = pSrc->GetWidth(); m_Height = pSrc->GetHeight(); diff --git a/core/fxge/dib/cfx_filtereddib.h b/core/fxge/dib/cfx_filtereddib.h index 3a16bb0750..e998c7169a 100644 --- a/core/fxge/dib/cfx_filtereddib.h +++ b/core/fxge/dib/cfx_filtereddib.h @@ -9,13 +9,13 @@ #include <vector> -#include "core/fxcrt/cfx_retain_ptr.h" +#include "core/fxcrt/retain_ptr.h" #include "core/fxge/dib/cfx_dibsource.h" class CFX_FilteredDIB : public CFX_DIBSource { public: template <typename T, typename... Args> - friend CFX_RetainPtr<T> pdfium::MakeRetain(Args&&... args); + friend RetainPtr<T> pdfium::MakeRetain(Args&&... args); ~CFX_FilteredDIB() override; @@ -28,7 +28,7 @@ class CFX_FilteredDIB : public CFX_DIBSource { int pixels, int Bpp) const = 0; - void LoadSrc(const CFX_RetainPtr<CFX_DIBSource>& pSrc); + void LoadSrc(const RetainPtr<CFX_DIBSource>& pSrc); protected: CFX_FilteredDIB(); @@ -43,7 +43,7 @@ class CFX_FilteredDIB : public CFX_DIBSource { int clip_left, int clip_width) const override; - CFX_RetainPtr<CFX_DIBSource> m_pSrc; + RetainPtr<CFX_DIBSource> m_pSrc; mutable std::vector<uint8_t> m_Scanline; }; diff --git a/core/fxge/dib/cfx_imagerenderer.cpp b/core/fxge/dib/cfx_imagerenderer.cpp index 2330fe0587..658d363c89 100644 --- a/core/fxge/dib/cfx_imagerenderer.cpp +++ b/core/fxge/dib/cfx_imagerenderer.cpp @@ -13,15 +13,14 @@ #include "core/fxge/dib/cfx_imagetransformer.h" #include "third_party/base/ptr_util.h" -CFX_ImageRenderer::CFX_ImageRenderer( - const CFX_RetainPtr<CFX_DIBitmap>& pDevice, - const CFX_ClipRgn* pClipRgn, - const CFX_RetainPtr<CFX_DIBSource>& pSource, - int bitmap_alpha, - uint32_t mask_color, - const CFX_Matrix* pMatrix, - uint32_t dib_flags, - bool bRgbByteOrder) +CFX_ImageRenderer::CFX_ImageRenderer(const RetainPtr<CFX_DIBitmap>& pDevice, + const CFX_ClipRgn* pClipRgn, + const RetainPtr<CFX_DIBSource>& pSource, + int bitmap_alpha, + uint32_t mask_color, + const CFX_Matrix* pMatrix, + uint32_t dib_flags, + bool bRgbByteOrder) : m_pDevice(pDevice), m_pClipRgn(pClipRgn), m_Matrix(*pMatrix), @@ -96,7 +95,7 @@ bool CFX_ImageRenderer::Continue(IFX_PauseIndicator* pPause) { if (m_pTransformer->Continue(pPause)) return true; - CFX_RetainPtr<CFX_DIBitmap> pBitmap = m_pTransformer->DetachBitmap(); + RetainPtr<CFX_DIBitmap> pBitmap = m_pTransformer->DetachBitmap(); if (!pBitmap || !pBitmap->GetBuffer()) return false; diff --git a/core/fxge/dib/cfx_imagerenderer.h b/core/fxge/dib/cfx_imagerenderer.h index 068fe34a89..8a441fcea3 100644 --- a/core/fxge/dib/cfx_imagerenderer.h +++ b/core/fxge/dib/cfx_imagerenderer.h @@ -9,9 +9,9 @@ #include <memory> -#include "core/fxcrt/cfx_retain_ptr.h" #include "core/fxcrt/cfx_unowned_ptr.h" #include "core/fxcrt/fx_coordinates.h" +#include "core/fxcrt/retain_ptr.h" #include "core/fxge/dib/cfx_bitmapcomposer.h" #include "core/fxge/dib/cfx_dibitmap.h" #include "core/fxge/dib/cfx_dibsource.h" @@ -23,9 +23,9 @@ class CFX_ImageStretcher; class CFX_ImageRenderer { public: - CFX_ImageRenderer(const CFX_RetainPtr<CFX_DIBitmap>& pDevice, + CFX_ImageRenderer(const RetainPtr<CFX_DIBitmap>& pDevice, const CFX_ClipRgn* pClipRgn, - const CFX_RetainPtr<CFX_DIBSource>& pSource, + const RetainPtr<CFX_DIBSource>& pSource, int bitmap_alpha, uint32_t mask_color, const CFX_Matrix* pMatrix, @@ -36,7 +36,7 @@ class CFX_ImageRenderer { bool Continue(IFX_PauseIndicator* pPause); private: - const CFX_RetainPtr<CFX_DIBitmap> m_pDevice; + const RetainPtr<CFX_DIBitmap> m_pDevice; const CFX_UnownedPtr<const CFX_ClipRgn> m_pClipRgn; const CFX_Matrix m_Matrix; const int m_BitmapAlpha; diff --git a/core/fxge/dib/cfx_imagestretcher.cpp b/core/fxge/dib/cfx_imagestretcher.cpp index 0b7c542b30..03518c688e 100644 --- a/core/fxge/dib/cfx_imagestretcher.cpp +++ b/core/fxge/dib/cfx_imagestretcher.cpp @@ -42,13 +42,12 @@ std::tuple<int, int, int, int> CmykDecode(const uint32_t cmyk) { } // namespace -CFX_ImageStretcher::CFX_ImageStretcher( - IFX_ScanlineComposer* pDest, - const CFX_RetainPtr<CFX_DIBSource>& pSource, - int dest_width, - int dest_height, - const FX_RECT& bitmap_rect, - uint32_t flags) +CFX_ImageStretcher::CFX_ImageStretcher(IFX_ScanlineComposer* pDest, + const RetainPtr<CFX_DIBSource>& pSource, + int dest_width, + int dest_height, + const FX_RECT& bitmap_rect, + uint32_t flags) : m_pDest(pDest), m_pSource(pSource), m_Flags(flags), diff --git a/core/fxge/dib/cfx_imagestretcher.h b/core/fxge/dib/cfx_imagestretcher.h index 84411015dd..5c696b79a7 100644 --- a/core/fxge/dib/cfx_imagestretcher.h +++ b/core/fxge/dib/cfx_imagestretcher.h @@ -9,10 +9,10 @@ #include <memory> -#include "core/fxcrt/cfx_retain_ptr.h" #include "core/fxcrt/cfx_unowned_ptr.h" #include "core/fxcrt/fx_coordinates.h" #include "core/fxcrt/fx_memory.h" +#include "core/fxcrt/retain_ptr.h" #include "core/fxge/dib/ifx_scanlinecomposer.h" #include "core/fxge/fx_dib.h" @@ -22,7 +22,7 @@ class IFX_PauseIndicator; class CFX_ImageStretcher { public: CFX_ImageStretcher(IFX_ScanlineComposer* pDest, - const CFX_RetainPtr<CFX_DIBSource>& pSource, + const RetainPtr<CFX_DIBSource>& pSource, int dest_width, int dest_height, const FX_RECT& bitmap_rect, @@ -32,7 +32,7 @@ class CFX_ImageStretcher { bool Start(); bool Continue(IFX_PauseIndicator* pPause); - CFX_RetainPtr<CFX_DIBSource> source() { return m_pSource; } + RetainPtr<CFX_DIBSource> source() { return m_pSource; } private: bool StartQuickStretch(); @@ -41,7 +41,7 @@ class CFX_ImageStretcher { bool ContinueStretch(IFX_PauseIndicator* pPause); CFX_UnownedPtr<IFX_ScanlineComposer> const m_pDest; - CFX_RetainPtr<CFX_DIBSource> m_pSource; + RetainPtr<CFX_DIBSource> m_pSource; std::unique_ptr<CStretchEngine> m_pStretchEngine; std::unique_ptr<uint8_t, FxFreeDeleter> m_pScanline; std::unique_ptr<uint8_t, FxFreeDeleter> m_pMaskScanline; diff --git a/core/fxge/dib/cfx_imagetransformer.cpp b/core/fxge/dib/cfx_imagetransformer.cpp index e64a2645da..51b75350e6 100644 --- a/core/fxge/dib/cfx_imagetransformer.cpp +++ b/core/fxge/dib/cfx_imagetransformer.cpp @@ -101,7 +101,7 @@ void bicubic_get_pos_weight(int pos_pixel[], v_w[3] = SDP_Table[512 - res_y]; } -FXDIB_Format GetTransformedFormat(const CFX_RetainPtr<CFX_DIBSource>& pDrc) { +FXDIB_Format GetTransformedFormat(const RetainPtr<CFX_DIBSource>& pDrc) { FXDIB_Format format = pDrc->GetFormat(); if (pDrc->IsAlphaMask()) { format = FXDIB_8bppMask; @@ -177,11 +177,10 @@ class CFX_BilinearMatrix : public CPDF_FixedMatrix { } // namespace -CFX_ImageTransformer::CFX_ImageTransformer( - const CFX_RetainPtr<CFX_DIBSource>& pSrc, - const CFX_Matrix* pMatrix, - int flags, - const FX_RECT* pClip) +CFX_ImageTransformer::CFX_ImageTransformer(const RetainPtr<CFX_DIBSource>& pSrc, + const CFX_Matrix* pMatrix, + int flags, + const FX_RECT* pClip) : m_pSrc(pSrc), m_pMatrix(pMatrix), m_pClip(pClip), @@ -818,6 +817,6 @@ bool CFX_ImageTransformer::Continue(IFX_PauseIndicator* pPause) { return false; } -CFX_RetainPtr<CFX_DIBitmap> CFX_ImageTransformer::DetachBitmap() { +RetainPtr<CFX_DIBitmap> CFX_ImageTransformer::DetachBitmap() { return m_Storer.Detach(); } diff --git a/core/fxge/dib/cfx_imagetransformer.h b/core/fxge/dib/cfx_imagetransformer.h index 0524a0c713..65c874585e 100644 --- a/core/fxge/dib/cfx_imagetransformer.h +++ b/core/fxge/dib/cfx_imagetransformer.h @@ -9,9 +9,9 @@ #include <memory> -#include "core/fxcrt/cfx_retain_ptr.h" #include "core/fxcrt/cfx_unowned_ptr.h" #include "core/fxcrt/fx_coordinates.h" +#include "core/fxcrt/retain_ptr.h" #include "core/fxge/dib/cfx_bitmapstorer.h" #include "core/fxge/dib/cfx_dibitmap.h" #include "core/fxge/dib/cfx_dibsource.h" @@ -20,7 +20,7 @@ class CFX_ImageStretcher; class CFX_ImageTransformer { public: - CFX_ImageTransformer(const CFX_RetainPtr<CFX_DIBSource>& pSrc, + CFX_ImageTransformer(const RetainPtr<CFX_DIBSource>& pSrc, const CFX_Matrix* pMatrix, int flags, const FX_RECT* pClip); @@ -29,10 +29,10 @@ class CFX_ImageTransformer { bool Continue(IFX_PauseIndicator* pPause); const FX_RECT& result() const { return m_result; } - CFX_RetainPtr<CFX_DIBitmap> DetachBitmap(); + RetainPtr<CFX_DIBitmap> DetachBitmap(); private: - const CFX_RetainPtr<CFX_DIBSource> m_pSrc; + const RetainPtr<CFX_DIBSource> m_pSrc; CFX_UnownedPtr<const CFX_Matrix> const m_pMatrix; const FX_RECT* const m_pClip; FX_RECT m_StretchClip; diff --git a/core/fxge/dib/cstretchengine.cpp b/core/fxge/dib/cstretchengine.cpp index 4822d32b83..6803959730 100644 --- a/core/fxge/dib/cstretchengine.cpp +++ b/core/fxge/dib/cstretchengine.cpp @@ -222,7 +222,7 @@ CStretchEngine::CStretchEngine(IFX_ScanlineComposer* pDestBitmap, int dest_width, int dest_height, const FX_RECT& clip_rect, - const CFX_RetainPtr<CFX_DIBSource>& pSrcBitmap, + const RetainPtr<CFX_DIBSource>& pSrcBitmap, int flags) { m_State = 0; m_DestFormat = dest_format; diff --git a/core/fxge/dib/cstretchengine.h b/core/fxge/dib/cstretchengine.h index 14c0975023..bdf79004a1 100644 --- a/core/fxge/dib/cstretchengine.h +++ b/core/fxge/dib/cstretchengine.h @@ -9,9 +9,9 @@ #include <vector> -#include "core/fxcrt/cfx_retain_ptr.h" #include "core/fxcrt/cfx_unowned_ptr.h" #include "core/fxcrt/fx_coordinates.h" +#include "core/fxcrt/retain_ptr.h" #include "core/fxge/fx_dib.h" class IFX_PauseIndicator; @@ -24,7 +24,7 @@ class CStretchEngine { int dest_width, int dest_height, const FX_RECT& clip_rect, - const CFX_RetainPtr<CFX_DIBSource>& pSrcBitmap, + const RetainPtr<CFX_DIBSource>& pSrcBitmap, int flags); ~CStretchEngine(); @@ -68,7 +68,7 @@ class CStretchEngine { std::vector<uint8_t> m_DestScanline; std::vector<uint8_t> m_DestMaskScanline; FX_RECT m_SrcClip; - CFX_RetainPtr<CFX_DIBSource> m_pSource; + RetainPtr<CFX_DIBSource> m_pSource; uint32_t* m_pSrcPalette; int m_SrcWidth; int m_SrcHeight; |