diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2017-09-21 15:49:49 -0400 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-09-21 20:17:31 +0000 |
commit | 0b95042db2e6dab5876abd12ce485fff0a8e08fe (patch) | |
tree | 02132ed53945fde30bfbf230ff4e9b5308dd7732 /core/fxge/skia | |
parent | a5eb9f05b7c3f82630784e043ccf75c4e019b18f (diff) | |
download | pdfium-0b95042db2e6dab5876abd12ce485fff0a8e08fe.tar.xz |
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 <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'core/fxge/skia')
-rw-r--r-- | core/fxge/skia/fx_skia_device.cpp | 62 | ||||
-rw-r--r-- | core/fxge/skia/fx_skia_device.h | 28 | ||||
-rw-r--r-- | core/fxge/skia/fx_skia_device_unittest.cpp | 2 |
3 files changed, 45 insertions, 47 deletions
diff --git a/core/fxge/skia/fx_skia_device.cpp b/core/fxge/skia/fx_skia_device.cpp index 8ca7808df3..fe9fd1a852 100644 --- a/core/fxge/skia/fx_skia_device.cpp +++ b/core/fxge/skia/fx_skia_device.cpp @@ -54,12 +54,12 @@ namespace { #ifdef _SKIA_SUPPORT_PATHS_ -void RgbByteOrderTransferBitmap(const CFX_RetainPtr<CFX_DIBitmap>& pBitmap, +void RgbByteOrderTransferBitmap(const RetainPtr<CFX_DIBitmap>& pBitmap, 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) { if (!pBitmap) @@ -262,8 +262,8 @@ void DebugDrawSkiaClipPath(SkCanvas* canvas, const SkPath& path) {} #endif // DRAW_SKIA_CLIP #ifdef _SKIA_SUPPORT_ -static void DebugValidate(const CFX_RetainPtr<CFX_DIBitmap>& bitmap, - const CFX_RetainPtr<CFX_DIBitmap>& device) { +static void DebugValidate(const RetainPtr<CFX_DIBitmap>& bitmap, + const RetainPtr<CFX_DIBitmap>& device) { if (bitmap) { SkASSERT(bitmap->GetBPP() == 8 || bitmap->GetBPP() == 32); if (bitmap->GetBPP() == 32) { @@ -564,7 +564,7 @@ void SetBitmapPaint(bool isAlphaMask, paint->setAlpha(bitmap_alpha); } -bool Upsample(const CFX_RetainPtr<CFX_DIBSource>& pSource, +bool Upsample(const RetainPtr<CFX_DIBSource>& pSource, std::unique_ptr<uint8_t, FxFreeDeleter>& dst8Storage, std::unique_ptr<uint32_t, FxFreeDeleter>& dst32Storage, SkBitmap* skBitmap, @@ -1492,9 +1492,9 @@ void CFX_SkiaDeviceDriver::PaintStroke(SkPaint* spaint, } CFX_SkiaDeviceDriver::CFX_SkiaDeviceDriver( - const CFX_RetainPtr<CFX_DIBitmap>& pBitmap, + const RetainPtr<CFX_DIBitmap>& pBitmap, bool bRgbByteOrder, - const CFX_RetainPtr<CFX_DIBitmap>& pOriDevice, + const RetainPtr<CFX_DIBitmap>& pOriDevice, bool bGroupKnockout) : m_pBitmap(pBitmap), m_pOriDevice(pOriDevice), @@ -2179,7 +2179,7 @@ bool CFX_SkiaDeviceDriver::GetClipBox(FX_RECT* pRect) { return true; } -bool CFX_SkiaDeviceDriver::GetDIBits(const CFX_RetainPtr<CFX_DIBitmap>& pBitmap, +bool CFX_SkiaDeviceDriver::GetDIBits(const RetainPtr<CFX_DIBitmap>& pBitmap, int left, int top) { if (!m_pBitmap) @@ -2216,7 +2216,7 @@ bool CFX_SkiaDeviceDriver::GetDIBits(const CFX_RetainPtr<CFX_DIBitmap>& pBitmap, m_pBitmap->UnPreMultiply(); FX_RECT rect(left, top, left + pBitmap->GetWidth(), top + pBitmap->GetHeight()); - CFX_RetainPtr<CFX_DIBitmap> pBack; + RetainPtr<CFX_DIBitmap> pBack; if (m_pOriDevice) { pBack = m_pOriDevice->Clone(&rect); if (!pBack) @@ -2244,17 +2244,16 @@ bool CFX_SkiaDeviceDriver::GetDIBits(const CFX_RetainPtr<CFX_DIBitmap>& pBitmap, #endif // _SKIA_SUPPORT_PATHS_ } -CFX_RetainPtr<CFX_DIBitmap> CFX_SkiaDeviceDriver::GetBackDrop() { +RetainPtr<CFX_DIBitmap> CFX_SkiaDeviceDriver::GetBackDrop() { return m_pOriDevice; } -bool CFX_SkiaDeviceDriver::SetDIBits( - const CFX_RetainPtr<CFX_DIBSource>& pBitmap, - uint32_t argb, - const FX_RECT* pSrcRect, - int left, - int top, - int blend_type) { +bool CFX_SkiaDeviceDriver::SetDIBits(const RetainPtr<CFX_DIBSource>& pBitmap, + uint32_t argb, + const FX_RECT* pSrcRect, + int left, + int top, + int blend_type) { if (!m_pBitmap || !m_pBitmap->GetBuffer()) return true; @@ -2280,7 +2279,7 @@ bool CFX_SkiaDeviceDriver::SetDIBits( } bool CFX_SkiaDeviceDriver::StretchDIBits( - const CFX_RetainPtr<CFX_DIBSource>& pSource, + const RetainPtr<CFX_DIBSource>& pSource, uint32_t argb, int dest_left, int dest_top, @@ -2332,7 +2331,7 @@ bool CFX_SkiaDeviceDriver::StretchDIBits( } bool CFX_SkiaDeviceDriver::StartDIBits( - const CFX_RetainPtr<CFX_DIBSource>& pSource, + const RetainPtr<CFX_DIBSource>& pSource, int bitmap_alpha, uint32_t argb, const CFX_Matrix* pMatrix, @@ -2408,7 +2407,7 @@ bool CFX_SkiaDeviceDriver::ContinueDIBits(CFX_ImageRenderer* handle, #if defined _SKIA_SUPPORT_ void CFX_SkiaDeviceDriver::PreMultiply( - const CFX_RetainPtr<CFX_DIBitmap>& pDIBitmap) { + const RetainPtr<CFX_DIBitmap>& pDIBitmap) { pDIBitmap->PreMultiply(); } #endif // _SKIA_SUPPORT_ @@ -2465,8 +2464,8 @@ void CFX_DIBitmap::UnPreMultiply() { #ifdef _SKIA_SUPPORT_ bool CFX_SkiaDeviceDriver::DrawBitsWithMask( - const CFX_RetainPtr<CFX_DIBSource>& pSource, - const CFX_RetainPtr<CFX_DIBSource>& pMask, + const RetainPtr<CFX_DIBSource>& pSource, + const RetainPtr<CFX_DIBSource>& pMask, int bitmap_alpha, const CFX_Matrix* pMatrix, int blend_type) { @@ -2506,8 +2505,8 @@ bool CFX_SkiaDeviceDriver::DrawBitsWithMask( } bool CFX_SkiaDeviceDriver::SetBitsWithMask( - const CFX_RetainPtr<CFX_DIBSource>& pBitmap, - const CFX_RetainPtr<CFX_DIBSource>& pMask, + const RetainPtr<CFX_DIBSource>& pBitmap, + const RetainPtr<CFX_DIBSource>& pMask, int dest_left, int dest_top, int bitmap_alpha, @@ -2555,11 +2554,10 @@ SkPictureRecorder* CFX_DefaultRenderDevice::CreateRecorder(int size_x, } #endif // _SKIA_SUPPORT_ -bool CFX_DefaultRenderDevice::Attach( - const CFX_RetainPtr<CFX_DIBitmap>& pBitmap, - bool bRgbByteOrder, - const CFX_RetainPtr<CFX_DIBitmap>& pOriDevice, - bool bGroupKnockout) { +bool CFX_DefaultRenderDevice::Attach(const RetainPtr<CFX_DIBitmap>& pBitmap, + bool bRgbByteOrder, + const RetainPtr<CFX_DIBitmap>& pOriDevice, + bool bGroupKnockout) { if (!pBitmap) return false; SetBitmap(pBitmap); @@ -2581,7 +2579,7 @@ bool CFX_DefaultRenderDevice::Create( int width, int height, FXDIB_Format format, - const CFX_RetainPtr<CFX_DIBitmap>& pOriDevice) { + const RetainPtr<CFX_DIBitmap>& pOriDevice) { auto pBitmap = pdfium::MakeRetain<CFX_DIBitmap>(); if (!pBitmap->Create(width, height, format)) { return false; @@ -2607,8 +2605,8 @@ void CFX_DefaultRenderDevice::DebugVerifyBitmapIsPreMultiplied() const { } bool CFX_DefaultRenderDevice::SetBitsWithMask( - const CFX_RetainPtr<CFX_DIBSource>& pBitmap, - const CFX_RetainPtr<CFX_DIBSource>& pMask, + const RetainPtr<CFX_DIBSource>& pBitmap, + const RetainPtr<CFX_DIBSource>& pMask, int left, int top, int bitmap_alpha, diff --git a/core/fxge/skia/fx_skia_device.h b/core/fxge/skia/fx_skia_device.h index df28479d9a..7dcf362c66 100644 --- a/core/fxge/skia/fx_skia_device.h +++ b/core/fxge/skia/fx_skia_device.h @@ -24,9 +24,9 @@ struct SkIRect; class CFX_SkiaDeviceDriver : public IFX_RenderDeviceDriver { public: - CFX_SkiaDeviceDriver(const CFX_RetainPtr<CFX_DIBitmap>& pBitmap, + CFX_SkiaDeviceDriver(const RetainPtr<CFX_DIBitmap>& pBitmap, bool bRgbByteOrder, - const CFX_RetainPtr<CFX_DIBitmap>& pOriDevice, + const RetainPtr<CFX_DIBitmap>& pOriDevice, bool bGroupKnockout); #ifdef _SKIA_SUPPORT_ explicit CFX_SkiaDeviceDriver(SkPictureRecorder* recorder); @@ -77,21 +77,21 @@ class CFX_SkiaDeviceDriver : public IFX_RenderDeviceDriver { bool GetClipBox(FX_RECT* pRect) override; /** Load device buffer into a DIB */ - bool GetDIBits(const CFX_RetainPtr<CFX_DIBitmap>& pBitmap, + bool GetDIBits(const RetainPtr<CFX_DIBitmap>& pBitmap, int left, int top) override; - CFX_RetainPtr<CFX_DIBitmap> GetBackDrop() override; + RetainPtr<CFX_DIBitmap> GetBackDrop() override; - bool SetDIBits(const CFX_RetainPtr<CFX_DIBSource>& pBitmap, + bool SetDIBits(const RetainPtr<CFX_DIBSource>& pBitmap, uint32_t color, const FX_RECT* pSrcRect, int dest_left, int dest_top, int blend_type) override; #ifdef _SKIA_SUPPORT_ - bool SetBitsWithMask(const CFX_RetainPtr<CFX_DIBSource>& pBitmap, - const CFX_RetainPtr<CFX_DIBSource>& pMask, + bool SetBitsWithMask(const RetainPtr<CFX_DIBSource>& pBitmap, + const RetainPtr<CFX_DIBSource>& pMask, int dest_left, int dest_top, int bitmap_alpha, @@ -102,7 +102,7 @@ class CFX_SkiaDeviceDriver : public IFX_RenderDeviceDriver { void SetClipMask(const FX_RECT& clipBox, const SkPath& skClipPath); #endif - bool StretchDIBits(const CFX_RetainPtr<CFX_DIBSource>& pBitmap, + bool StretchDIBits(const RetainPtr<CFX_DIBSource>& pBitmap, uint32_t color, int dest_left, int dest_top, @@ -112,7 +112,7 @@ class CFX_SkiaDeviceDriver : public IFX_RenderDeviceDriver { uint32_t flags, int blend_type) override; - bool StartDIBits(const CFX_RetainPtr<CFX_DIBSource>& pBitmap, + bool StartDIBits(const RetainPtr<CFX_DIBSource>& pBitmap, int bitmap_alpha, uint32_t color, const CFX_Matrix* pMatrix, @@ -123,8 +123,8 @@ class CFX_SkiaDeviceDriver : public IFX_RenderDeviceDriver { bool ContinueDIBits(CFX_ImageRenderer* handle, IFX_PauseIndicator* pPause) override; - bool DrawBitsWithMask(const CFX_RetainPtr<CFX_DIBSource>& pBitmap, - const CFX_RetainPtr<CFX_DIBSource>& pMask, + bool DrawBitsWithMask(const RetainPtr<CFX_DIBSource>& pBitmap, + const RetainPtr<CFX_DIBSource>& pMask, int bitmap_alpha, const CFX_Matrix* pMatrix, int blend_type); @@ -151,7 +151,7 @@ class CFX_SkiaDeviceDriver : public IFX_RenderDeviceDriver { void Flush() override; SkPictureRecorder* GetRecorder() const { return m_pRecorder; } void PreMultiply() { m_pBitmap->PreMultiply(); } - static void PreMultiply(const CFX_RetainPtr<CFX_DIBitmap>& pDIBitmap); + static void PreMultiply(const RetainPtr<CFX_DIBitmap>& pDIBitmap); SkCanvas* SkiaCanvas() { return m_pCanvas; } void DebugVerifyBitmapIsPreMultiplied() const; void Dump() const; @@ -159,8 +159,8 @@ class CFX_SkiaDeviceDriver : public IFX_RenderDeviceDriver { private: friend class SkiaState; - CFX_RetainPtr<CFX_DIBitmap> m_pBitmap; - CFX_RetainPtr<CFX_DIBitmap> m_pOriDevice; + RetainPtr<CFX_DIBitmap> m_pBitmap; + RetainPtr<CFX_DIBitmap> m_pOriDevice; SkCanvas* m_pCanvas; SkPictureRecorder* const m_pRecorder; std::unique_ptr<SkiaState> m_pCache; diff --git a/core/fxge/skia/fx_skia_device_unittest.cpp b/core/fxge/skia/fx_skia_device_unittest.cpp index 94d9a0f2cf..a959b6e2dc 100644 --- a/core/fxge/skia/fx_skia_device_unittest.cpp +++ b/core/fxge/skia/fx_skia_device_unittest.cpp @@ -124,7 +124,7 @@ void Harness(void (*Test)(CFX_SkiaDeviceDriver*, const State&), return; FPDFBitmap_FillRect(bitmap, 0, 0, w, h, 0x00000000); CFX_DefaultRenderDevice geDevice; - CFX_RetainPtr<CFX_DIBitmap> pBitmap(CFXBitmapFromFPDFBitmap(bitmap)); + RetainPtr<CFX_DIBitmap> pBitmap(CFXBitmapFromFPDFBitmap(bitmap)); geDevice.Attach(pBitmap, false, nullptr, false); CFX_SkiaDeviceDriver* driver = static_cast<CFX_SkiaDeviceDriver*>(geDevice.GetDeviceDriver()); |