From c3202a95773d7a2c95038ad45c5ba2c9e095e67b Mon Sep 17 00:00:00 2001 From: Nicolas Pena Date: Tue, 4 Apr 2017 13:38:29 -0400 Subject: Let CPDF_ImageRenderer own the CFX_ImageRenderer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This CL avoids some void* usage and removes CancelDIBits after making a CPDF_ImageRenderer own its CFX_ImageRenderer. Bug: pdfium:686 Change-Id: Ied205c57a858cc14d8e2c592db3444ed465b2796 Reviewed-on: https://pdfium-review.googlesource.com/3673 Reviewed-by: Tom Sepez Commit-Queue: Nicolás Peña --- core/fxge/win32/fx_win32_device.cpp | 3 ++- core/fxge/win32/fx_win32_print.cpp | 7 ++++--- core/fxge/win32/win32_int.h | 7 ++++--- 3 files changed, 10 insertions(+), 7 deletions(-) (limited to 'core/fxge/win32') diff --git a/core/fxge/win32/fx_win32_device.cpp b/core/fxge/win32/fx_win32_device.cpp index a27ac6fbd2..811ca11c07 100644 --- a/core/fxge/win32/fx_win32_device.cpp +++ b/core/fxge/win32/fx_win32_device.cpp @@ -16,6 +16,7 @@ #include "core/fxcrt/fx_system.h" #include "core/fxge/cfx_windowsdevice.h" #include "core/fxge/dib/cfx_dibextractor.h" +#include "core/fxge/dib/cfx_imagerenderer.h" #include "core/fxge/dib/dib_int.h" #include "core/fxge/fx_font.h" #include "core/fxge/fx_freetype.h" @@ -1356,7 +1357,7 @@ bool CGdiDisplayDriver::StartDIBits(const CFX_RetainPtr& pBitmap, uint32_t color, const CFX_Matrix* pMatrix, uint32_t render_flags, - void*& handle, + std::unique_ptr* handle, int blend_type) { return false; } diff --git a/core/fxge/win32/fx_win32_print.cpp b/core/fxge/win32/fx_win32_print.cpp index 868c113880..084a136d4d 100644 --- a/core/fxge/win32/fx_win32_print.cpp +++ b/core/fxge/win32/fx_win32_print.cpp @@ -13,6 +13,7 @@ #include "core/fxcrt/fx_system.h" #include "core/fxge/cfx_windowsdevice.h" #include "core/fxge/dib/cfx_dibextractor.h" +#include "core/fxge/dib/cfx_imagerenderer.h" #include "core/fxge/dib/dib_int.h" #include "core/fxge/fx_freetype.h" #include "core/fxge/ge/fx_text_int.h" @@ -164,7 +165,7 @@ bool CGdiPrinterDriver::StartDIBits(const CFX_RetainPtr& pSource, uint32_t color, const CFX_Matrix* pMatrix, uint32_t render_flags, - void*& handle, + std::unique_ptr* handle, int blend_type) { if (bitmap_alpha < 255 || pSource->HasAlpha() || (pSource->IsAlphaMask() && (pSource->GetBPP() != 1))) { @@ -469,7 +470,7 @@ bool CPSPrinterDriver::StartDIBits(const CFX_RetainPtr& pBitmap, uint32_t color, const CFX_Matrix* pMatrix, uint32_t render_flags, - void*& handle, + std::unique_ptr* handle, int blend_type) { if (blend_type != FXDIB_BLEND_NORMAL) return false; @@ -477,7 +478,7 @@ bool CPSPrinterDriver::StartDIBits(const CFX_RetainPtr& pBitmap, if (bitmap_alpha < 255) return false; - handle = nullptr; + *handle = nullptr; return m_PSRenderer.DrawDIBits(pBitmap, color, pMatrix, render_flags); } diff --git a/core/fxge/win32/win32_int.h b/core/fxge/win32/win32_int.h index 35521d0096..a5fc853de5 100644 --- a/core/fxge/win32/win32_int.h +++ b/core/fxge/win32/win32_int.h @@ -17,6 +17,7 @@ #include "core/fxge/win32/cpsoutput.h" #include "core/fxge/win32/dwrite_int.h" +class CFX_ImageRenderer; class FXTEXT_CHARPOS; struct WINDIB_Open_Args_; @@ -215,7 +216,7 @@ class CGdiDisplayDriver : public CGdiDeviceDriver { uint32_t color, const CFX_Matrix* pMatrix, uint32_t render_flags, - void*& handle, + std::unique_ptr* handle, int blend_type) override; bool UseFoxitStretchEngine(const CFX_RetainPtr& pSource, uint32_t color, @@ -254,7 +255,7 @@ class CGdiPrinterDriver : public CGdiDeviceDriver { uint32_t color, const CFX_Matrix* pMatrix, uint32_t render_flags, - void*& handle, + std::unique_ptr* handle, int blend_type) override; bool DrawDeviceText(int nChars, const FXTEXT_CHARPOS* pCharPos, @@ -313,7 +314,7 @@ class CPSPrinterDriver : public IFX_RenderDeviceDriver { uint32_t color, const CFX_Matrix* pMatrix, uint32_t render_flags, - void*& handle, + std::unique_ptr* handle, int blend_type) override; bool DrawDeviceText(int nChars, const FXTEXT_CHARPOS* pCharPos, -- cgit v1.2.3