diff options
author | Tom Sepez <tsepez@chromium.org> | 2018-08-24 21:55:46 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-08-24 21:55:46 +0000 |
commit | e6ff2ebfaa19421c8d932f4d275548156ae2e13c (patch) | |
tree | a549775ce9d4e999f8a23542524adba8c5ca42ea /core/fxge | |
parent | 16d18d935d055b74e05f615c0325318a329a7fe1 (diff) | |
download | pdfium-e6ff2ebfaa19421c8d932f4d275548156ae2e13c.tar.xz |
Rename CFX_DIBSource to CFX_DIBBase.
It is not a source from which you can get CFX_DIBs, but rather a
base class from which all DIBs inherit.
Do the same thing for the CPDF_DIBSource wrapper class.
Mechanical change apart from adding a one-line comment in cfx_dibbase.h
Change-Id: Id2bde87813ca301d9fafc55ce08d703dfc6a7184
Reviewed-on: https://pdfium-review.googlesource.com/41352
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'core/fxge')
33 files changed, 228 insertions, 232 deletions
diff --git a/core/fxge/agg/fx_agg_driver.cpp b/core/fxge/agg/fx_agg_driver.cpp index 9166fbb0c8..063f36d600 100644 --- a/core/fxge/agg/fx_agg_driver.cpp +++ b/core/fxge/agg/fx_agg_driver.cpp @@ -144,7 +144,7 @@ void RgbByteOrderTransferBitmap(const RetainPtr<CFX_DIBitmap>& pBitmap, int dest_top, int width, int height, - const RetainPtr<CFX_DIBSource>& pSrcBitmap, + const RetainPtr<CFX_DIBBase>& pSrcBitmap, int src_left, int src_top) { if (!pBitmap) @@ -1491,7 +1491,7 @@ RetainPtr<CFX_DIBitmap> CFX_AggDeviceDriver::GetBackDrop() { return m_pBackdropBitmap; } -bool CFX_AggDeviceDriver::SetDIBits(const RetainPtr<CFX_DIBSource>& pBitmap, +bool CFX_AggDeviceDriver::SetDIBits(const RetainPtr<CFX_DIBBase>& pBitmap, uint32_t argb, const FX_RECT* pSrcRect, int left, @@ -1511,7 +1511,7 @@ bool CFX_AggDeviceDriver::SetDIBits(const RetainPtr<CFX_DIBSource>& pBitmap, pSrcRect->top, blend_type, m_pClipRgn.get(), m_bRgbByteOrder); } -bool CFX_AggDeviceDriver::StretchDIBits(const RetainPtr<CFX_DIBSource>& pSource, +bool CFX_AggDeviceDriver::StretchDIBits(const RetainPtr<CFX_DIBBase>& pSource, uint32_t argb, int dest_left, int dest_top, @@ -1545,7 +1545,7 @@ bool CFX_AggDeviceDriver::StretchDIBits(const RetainPtr<CFX_DIBSource>& pSource, } bool CFX_AggDeviceDriver::StartDIBits( - const RetainPtr<CFX_DIBSource>& pSource, + const RetainPtr<CFX_DIBBase>& pSource, int bitmap_alpha, uint32_t argb, const CFX_Matrix* pMatrix, diff --git a/core/fxge/agg/fx_agg_driver.h b/core/fxge/agg/fx_agg_driver.h index b59cec004c..167b211746 100644 --- a/core/fxge/agg/fx_agg_driver.h +++ b/core/fxge/agg/fx_agg_driver.h @@ -67,13 +67,13 @@ class CFX_AggDeviceDriver : public RenderDeviceDriverIface { int left, int top) override; RetainPtr<CFX_DIBitmap> GetBackDrop() override; - bool SetDIBits(const RetainPtr<CFX_DIBSource>& pBitmap, + bool SetDIBits(const RetainPtr<CFX_DIBBase>& pBitmap, uint32_t color, const FX_RECT* pSrcRect, int left, int top, int blend_type) override; - bool StretchDIBits(const RetainPtr<CFX_DIBSource>& pBitmap, + bool StretchDIBits(const RetainPtr<CFX_DIBBase>& pBitmap, uint32_t color, int dest_left, int dest_top, @@ -82,7 +82,7 @@ class CFX_AggDeviceDriver : public RenderDeviceDriverIface { const FX_RECT* pClipRect, uint32_t flags, int blend_type) override; - bool StartDIBits(const RetainPtr<CFX_DIBSource>& pBitmap, + bool StartDIBits(const RetainPtr<CFX_DIBBase>& pBitmap, int bitmap_alpha, uint32_t color, const CFX_Matrix* pMatrix, diff --git a/core/fxge/cfx_defaultrenderdevice.h b/core/fxge/cfx_defaultrenderdevice.h index 6510e41f6f..07e3cc57c9 100644 --- a/core/fxge/cfx_defaultrenderdevice.h +++ b/core/fxge/cfx_defaultrenderdevice.h @@ -31,8 +31,8 @@ class CFX_DefaultRenderDevice : public CFX_RenderDevice { void Clear(uint32_t color); SkPictureRecorder* CreateRecorder(int size_x, int size_y); void DebugVerifyBitmapIsPreMultiplied() const override; - bool SetBitsWithMask(const RetainPtr<CFX_DIBSource>& pBitmap, - const RetainPtr<CFX_DIBSource>& pMask, + bool SetBitsWithMask(const RetainPtr<CFX_DIBBase>& pBitmap, + const RetainPtr<CFX_DIBBase>& pMask, int left, int top, int bitmap_alpha, diff --git a/core/fxge/cfx_renderdevice.cpp b/core/fxge/cfx_renderdevice.cpp index 16d723721f..ab57391401 100644 --- a/core/fxge/cfx_renderdevice.cpp +++ b/core/fxge/cfx_renderdevice.cpp @@ -722,11 +722,10 @@ RetainPtr<CFX_DIBitmap> CFX_RenderDevice::GetBackDrop() { return m_pDeviceDriver->GetBackDrop(); } -bool CFX_RenderDevice::SetDIBitsWithBlend( - const RetainPtr<CFX_DIBSource>& pBitmap, - int left, - int top, - int blend_mode) { +bool CFX_RenderDevice::SetDIBitsWithBlend(const RetainPtr<CFX_DIBBase>& pBitmap, + int left, + int top, + int blend_mode) { ASSERT(!pBitmap->IsAlphaMask()); FX_RECT dest_rect(left, top, left + pBitmap->GetWidth(), top + pBitmap->GetHeight()); @@ -767,7 +766,7 @@ bool CFX_RenderDevice::SetDIBitsWithBlend( } bool CFX_RenderDevice::StretchDIBitsWithFlagsAndBlend( - const RetainPtr<CFX_DIBSource>& pBitmap, + const RetainPtr<CFX_DIBBase>& pBitmap, int left, int top, int dest_width, @@ -782,7 +781,7 @@ bool CFX_RenderDevice::StretchDIBitsWithFlagsAndBlend( dest_height, &clip_box, flags, blend_mode); } -bool CFX_RenderDevice::SetBitMask(const RetainPtr<CFX_DIBSource>& pBitmap, +bool CFX_RenderDevice::SetBitMask(const RetainPtr<CFX_DIBBase>& pBitmap, int left, int top, uint32_t argb) { @@ -791,7 +790,7 @@ bool CFX_RenderDevice::SetBitMask(const RetainPtr<CFX_DIBSource>& pBitmap, FXDIB_BLEND_NORMAL); } -bool CFX_RenderDevice::StretchBitMask(const RetainPtr<CFX_DIBSource>& pBitmap, +bool CFX_RenderDevice::StretchBitMask(const RetainPtr<CFX_DIBBase>& pBitmap, int left, int top, int dest_width, @@ -802,7 +801,7 @@ bool CFX_RenderDevice::StretchBitMask(const RetainPtr<CFX_DIBSource>& pBitmap, } bool CFX_RenderDevice::StretchBitMaskWithFlags( - const RetainPtr<CFX_DIBSource>& pBitmap, + const RetainPtr<CFX_DIBBase>& pBitmap, int left, int top, int dest_width, @@ -818,7 +817,7 @@ bool CFX_RenderDevice::StretchBitMaskWithFlags( } bool CFX_RenderDevice::StartDIBitsWithBlend( - const RetainPtr<CFX_DIBSource>& pBitmap, + const RetainPtr<CFX_DIBBase>& pBitmap, int bitmap_alpha, uint32_t argb, const CFX_Matrix* pMatrix, @@ -839,8 +838,8 @@ void CFX_RenderDevice::DebugVerifyBitmapIsPreMultiplied() const { SkASSERT(0); } -bool CFX_RenderDevice::SetBitsWithMask(const RetainPtr<CFX_DIBSource>& pBitmap, - const RetainPtr<CFX_DIBSource>& pMask, +bool CFX_RenderDevice::SetBitsWithMask(const RetainPtr<CFX_DIBBase>& pBitmap, + const RetainPtr<CFX_DIBBase>& pMask, int left, int top, int bitmap_alpha, diff --git a/core/fxge/cfx_renderdevice.h b/core/fxge/cfx_renderdevice.h index 1d6fe48170..f0d78989be 100644 --- a/core/fxge/cfx_renderdevice.h +++ b/core/fxge/cfx_renderdevice.h @@ -153,14 +153,14 @@ class CFX_RenderDevice { RetainPtr<CFX_DIBitmap> GetBackDrop(); bool GetDIBits(const RetainPtr<CFX_DIBitmap>& pBitmap, int left, int top); - bool SetDIBits(const RetainPtr<CFX_DIBSource>& pBitmap, int left, int top) { + bool SetDIBits(const RetainPtr<CFX_DIBBase>& pBitmap, int left, int top) { return SetDIBitsWithBlend(pBitmap, left, top, FXDIB_BLEND_NORMAL); } - bool SetDIBitsWithBlend(const RetainPtr<CFX_DIBSource>& pBitmap, + bool SetDIBitsWithBlend(const RetainPtr<CFX_DIBBase>& pBitmap, int left, int top, int blend_type); - bool StretchDIBits(const RetainPtr<CFX_DIBSource>& pBitmap, + bool StretchDIBits(const RetainPtr<CFX_DIBBase>& pBitmap, int left, int top, int dest_width, @@ -168,31 +168,31 @@ class CFX_RenderDevice { return StretchDIBitsWithFlagsAndBlend(pBitmap, left, top, dest_width, dest_height, 0, FXDIB_BLEND_NORMAL); } - bool StretchDIBitsWithFlagsAndBlend(const RetainPtr<CFX_DIBSource>& pBitmap, + bool StretchDIBitsWithFlagsAndBlend(const RetainPtr<CFX_DIBBase>& pBitmap, int left, int top, int dest_width, int dest_height, uint32_t flags, int blend_type); - bool SetBitMask(const RetainPtr<CFX_DIBSource>& pBitmap, + bool SetBitMask(const RetainPtr<CFX_DIBBase>& pBitmap, int left, int top, uint32_t color); - bool StretchBitMask(const RetainPtr<CFX_DIBSource>& pBitmap, + bool StretchBitMask(const RetainPtr<CFX_DIBBase>& pBitmap, int left, int top, int dest_width, int dest_height, uint32_t color); - bool StretchBitMaskWithFlags(const RetainPtr<CFX_DIBSource>& pBitmap, + bool StretchBitMaskWithFlags(const RetainPtr<CFX_DIBBase>& pBitmap, int left, int top, int dest_width, int dest_height, uint32_t color, uint32_t flags); - bool StartDIBits(const RetainPtr<CFX_DIBSource>& pBitmap, + bool StartDIBits(const RetainPtr<CFX_DIBBase>& pBitmap, int bitmap_alpha, uint32_t color, const CFX_Matrix* pMatrix, @@ -201,7 +201,7 @@ class CFX_RenderDevice { return StartDIBitsWithBlend(pBitmap, bitmap_alpha, color, pMatrix, flags, handle, FXDIB_BLEND_NORMAL); } - bool StartDIBitsWithBlend(const RetainPtr<CFX_DIBSource>& pBitmap, + bool StartDIBitsWithBlend(const RetainPtr<CFX_DIBBase>& pBitmap, int bitmap_alpha, uint32_t color, const CFX_Matrix* pMatrix, @@ -266,8 +266,8 @@ class CFX_RenderDevice { #ifdef _SKIA_SUPPORT_ virtual void DebugVerifyBitmapIsPreMultiplied() const; - virtual bool SetBitsWithMask(const RetainPtr<CFX_DIBSource>& pBitmap, - const RetainPtr<CFX_DIBSource>& pMask, + virtual bool SetBitsWithMask(const RetainPtr<CFX_DIBBase>& pBitmap, + const RetainPtr<CFX_DIBBase>& pMask, int left, int top, int bitmap_alpha, diff --git a/core/fxge/dib/cfx_dibsource.cpp b/core/fxge/dib/cfx_dibbase.cpp index 4608b51802..79150ba616 100644 --- a/core/fxge/dib/cfx_dibsource.cpp +++ b/core/fxge/dib/cfx_dibbase.cpp @@ -4,7 +4,7 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com -#include "core/fxge/dib/cfx_dibsource.h" +#include "core/fxge/dib/cfx_dibbase.h" #include <algorithm> #include <memory> @@ -49,7 +49,7 @@ void Obtain_Pal(std::pair<uint32_t, uint32_t>* luts, class CFX_Palette { public: - explicit CFX_Palette(const RetainPtr<CFX_DIBSource>& pBitmap); + explicit CFX_Palette(const RetainPtr<CFX_DIBBase>& pBitmap); ~CFX_Palette(); const uint32_t* GetPalette() { return m_Palette.data(); } @@ -64,7 +64,7 @@ class CFX_Palette { int m_lut; }; -CFX_Palette::CFX_Palette(const RetainPtr<CFX_DIBSource>& pBitmap) +CFX_Palette::CFX_Palette(const RetainPtr<CFX_DIBBase>& pBitmap) : m_Palette(256), m_Luts(4096), m_lut(0) { int bpp = pBitmap->GetBPP() / 8; int width = pBitmap->GetWidth(); @@ -102,7 +102,7 @@ void ConvertBuffer_1bppMask2Gray(uint8_t* dest_buf, int dest_pitch, int width, int height, - const RetainPtr<CFX_DIBSource>& pSrcBitmap, + const RetainPtr<CFX_DIBBase>& pSrcBitmap, int src_left, int src_top) { static constexpr uint8_t kSetGray = 0xff; @@ -123,7 +123,7 @@ void ConvertBuffer_8bppMask2Gray(uint8_t* dest_buf, int dest_pitch, int width, int height, - const RetainPtr<CFX_DIBSource>& pSrcBitmap, + const RetainPtr<CFX_DIBBase>& pSrcBitmap, int src_left, int src_top) { for (int row = 0; row < height; ++row) { @@ -137,7 +137,7 @@ void ConvertBuffer_1bppPlt2Gray(uint8_t* dest_buf, int dest_pitch, int width, int height, - const RetainPtr<CFX_DIBSource>& pSrcBitmap, + const RetainPtr<CFX_DIBBase>& pSrcBitmap, int src_left, int src_top) { uint32_t* src_plt = pSrcBitmap->GetPalette(); @@ -182,7 +182,7 @@ void ConvertBuffer_8bppPlt2Gray(uint8_t* dest_buf, int dest_pitch, int width, int height, - const RetainPtr<CFX_DIBSource>& pSrcBitmap, + const RetainPtr<CFX_DIBBase>& pSrcBitmap, int src_left, int src_top) { uint32_t* src_plt = pSrcBitmap->GetPalette(); @@ -216,7 +216,7 @@ void ConvertBuffer_RgbOrCmyk2Gray(uint8_t* dest_buf, int dest_pitch, int width, int height, - const RetainPtr<CFX_DIBSource>& pSrcBitmap, + const RetainPtr<CFX_DIBBase>& pSrcBitmap, int src_left, int src_top) { int Bpp = pSrcBitmap->GetBPP() / 8; @@ -255,7 +255,7 @@ void ConvertBuffer_IndexCopy(uint8_t* dest_buf, int dest_pitch, int width, int height, - const RetainPtr<CFX_DIBSource>& pSrcBitmap, + const RetainPtr<CFX_DIBBase>& pSrcBitmap, int src_left, int src_top) { if (pSrcBitmap->GetBPP() == 1) { @@ -286,7 +286,7 @@ void ConvertBuffer_Plt2PltRgb8(uint8_t* dest_buf, int dest_pitch, int width, int height, - const RetainPtr<CFX_DIBSource>& pSrcBitmap, + const RetainPtr<CFX_DIBBase>& pSrcBitmap, int src_left, int src_top, uint32_t* dst_plt) { @@ -313,7 +313,7 @@ void ConvertBuffer_Rgb2PltRgb8(uint8_t* dest_buf, int dest_pitch, int width, int height, - const RetainPtr<CFX_DIBSource>& pSrcBitmap, + const RetainPtr<CFX_DIBBase>& pSrcBitmap, int src_left, int src_top, uint32_t* dst_plt) { @@ -372,7 +372,7 @@ void ConvertBuffer_1bppMask2Rgb(FXDIB_Format dest_format, int dest_pitch, int width, int height, - const RetainPtr<CFX_DIBSource>& pSrcBitmap, + const RetainPtr<CFX_DIBBase>& pSrcBitmap, int src_left, int src_top) { int comps = GetCompsFromFormat(dest_format); @@ -401,7 +401,7 @@ void ConvertBuffer_8bppMask2Rgb(FXDIB_Format dest_format, int dest_pitch, int width, int height, - const RetainPtr<CFX_DIBSource>& pSrcBitmap, + const RetainPtr<CFX_DIBBase>& pSrcBitmap, int src_left, int src_top) { int comps = GetCompsFromFormat(dest_format); @@ -424,7 +424,7 @@ void ConvertBuffer_1bppPlt2Rgb(FXDIB_Format dest_format, int dest_pitch, int width, int height, - const RetainPtr<CFX_DIBSource>& pSrcBitmap, + const RetainPtr<CFX_DIBBase>& pSrcBitmap, int src_left, int src_top) { int comps = GetCompsFromFormat(dest_format); @@ -475,7 +475,7 @@ void ConvertBuffer_8bppPlt2Rgb(FXDIB_Format dest_format, int dest_pitch, int width, int height, - const RetainPtr<CFX_DIBSource>& pSrcBitmap, + const RetainPtr<CFX_DIBBase>& pSrcBitmap, int src_left, int src_top) { int comps = GetCompsFromFormat(dest_format); @@ -518,7 +518,7 @@ void ConvertBuffer_24bppRgb2Rgb24(uint8_t* dest_buf, int dest_pitch, int width, int height, - const RetainPtr<CFX_DIBSource>& pSrcBitmap, + const RetainPtr<CFX_DIBBase>& pSrcBitmap, int src_left, int src_top) { for (int row = 0; row < height; ++row) { @@ -533,7 +533,7 @@ void ConvertBuffer_32bppRgb2Rgb24(uint8_t* dest_buf, int dest_pitch, int width, int height, - const RetainPtr<CFX_DIBSource>& pSrcBitmap, + const RetainPtr<CFX_DIBBase>& pSrcBitmap, int src_left, int src_top) { for (int row = 0; row < height; ++row) { @@ -553,7 +553,7 @@ void ConvertBuffer_Rgb2Rgb32(uint8_t* dest_buf, int dest_pitch, int width, int height, - const RetainPtr<CFX_DIBSource>& pSrcBitmap, + const RetainPtr<CFX_DIBBase>& pSrcBitmap, int src_left, int src_top) { int comps = pSrcBitmap->GetBPP() / 8; @@ -575,7 +575,7 @@ void ConvertBuffer_32bppCmyk2Rgb32(uint8_t* dest_buf, int dest_pitch, int width, int height, - const RetainPtr<CFX_DIBSource>& pSrcBitmap, + const RetainPtr<CFX_DIBBase>& pSrcBitmap, int src_left, int src_top) { for (int row = 0; row < height; ++row) { @@ -596,7 +596,7 @@ bool ConvertBuffer_8bppMask(int bpp, int dest_pitch, int width, int height, - const RetainPtr<CFX_DIBSource>& pSrcBitmap, + const RetainPtr<CFX_DIBBase>& pSrcBitmap, int src_left, int src_top) { switch (bpp) { @@ -634,7 +634,7 @@ bool ConvertBuffer_Rgb(int bpp, int dest_pitch, int width, int height, - const RetainPtr<CFX_DIBSource>& pSrcBitmap, + const RetainPtr<CFX_DIBBase>& pSrcBitmap, int src_left, int src_top) { switch (bpp) { @@ -676,7 +676,7 @@ bool ConvertBuffer_Argb(int bpp, int dest_pitch, int width, int height, - const RetainPtr<CFX_DIBSource>& pSrcBitmap, + const RetainPtr<CFX_DIBBase>& pSrcBitmap, int src_left, int src_top) { switch (bpp) { @@ -715,21 +715,20 @@ bool ConvertBuffer_Argb(int bpp, } // namespace -CFX_DIBSource::CFX_DIBSource() +CFX_DIBBase::CFX_DIBBase() : m_Width(0), m_Height(0), m_bpp(0), m_AlphaFlag(0), m_Pitch(0) {} -CFX_DIBSource::~CFX_DIBSource() {} +CFX_DIBBase::~CFX_DIBBase() {} -uint8_t* CFX_DIBSource::GetBuffer() const { +uint8_t* CFX_DIBBase::GetBuffer() const { return nullptr; } -bool CFX_DIBSource::SkipToScanline(int line, - PauseIndicatorIface* pPause) const { +bool CFX_DIBBase::SkipToScanline(int line, PauseIndicatorIface* pPause) const { return false; } -RetainPtr<CFX_DIBitmap> CFX_DIBSource::Clone(const FX_RECT* pClip) const { +RetainPtr<CFX_DIBitmap> CFX_DIBBase::Clone(const FX_RECT* pClip) const { FX_RECT rect(0, 0, m_Width, m_Height); if (pClip) { rect.Intersect(*pClip); @@ -770,7 +769,7 @@ RetainPtr<CFX_DIBitmap> CFX_DIBSource::Clone(const FX_RECT* pClip) const { return pNewBitmap; } -void CFX_DIBSource::BuildPalette() { +void CFX_DIBBase::BuildPalette() { if (m_pPalette) return; @@ -795,7 +794,7 @@ void CFX_DIBSource::BuildPalette() { } } -bool CFX_DIBSource::BuildAlphaMask() { +bool CFX_DIBBase::BuildAlphaMask() { if (m_pAlphaMask) return true; @@ -809,7 +808,7 @@ bool CFX_DIBSource::BuildAlphaMask() { return true; } -uint32_t CFX_DIBSource::GetPaletteArgb(int index) const { +uint32_t CFX_DIBBase::GetPaletteArgb(int index) const { ASSERT((GetBPP() == 1 || GetBPP() == 8) && !IsAlphaMask()); if (m_pPalette) return m_pPalette.get()[index]; @@ -826,7 +825,7 @@ uint32_t CFX_DIBSource::GetPaletteArgb(int index) const { return index * 0x10101 | 0xff000000; } -void CFX_DIBSource::SetPaletteArgb(int index, uint32_t color) { +void CFX_DIBBase::SetPaletteArgb(int index, uint32_t color) { ASSERT((GetBPP() == 1 || GetBPP() == 8) && !IsAlphaMask()); if (!m_pPalette) { BuildPalette(); @@ -834,7 +833,7 @@ void CFX_DIBSource::SetPaletteArgb(int index, uint32_t color) { m_pPalette.get()[index] = color; } -int CFX_DIBSource::FindPalette(uint32_t color) const { +int CFX_DIBBase::FindPalette(uint32_t color) const { ASSERT((GetBPP() == 1 || GetBPP() == 8) && !IsAlphaMask()); if (!m_pPalette) { if (IsCmykImage()) { @@ -856,15 +855,15 @@ int CFX_DIBSource::FindPalette(uint32_t color) const { return -1; } -void CFX_DIBSource::GetOverlapRect(int& dest_left, - int& dest_top, - int& width, - int& height, - int src_width, - int src_height, - int& src_left, - int& src_top, - const CFX_ClipRgn* pClipRgn) { +void CFX_DIBBase::GetOverlapRect(int& dest_left, + int& dest_top, + int& width, + int& height, + int src_width, + int src_height, + int& src_left, + int& src_top, + const CFX_ClipRgn* pClipRgn) { if (width == 0 || height == 0) return; @@ -893,7 +892,7 @@ void CFX_DIBSource::GetOverlapRect(int& dest_left, height = dest_rect.bottom - dest_rect.top; } -void CFX_DIBSource::SetPalette(const uint32_t* pSrc) { +void CFX_DIBBase::SetPalette(const uint32_t* pSrc) { static const uint32_t kPaletteSize = 256; if (!pSrc || GetBPP() > 8) { m_pPalette.reset(); @@ -906,7 +905,7 @@ void CFX_DIBSource::SetPalette(const uint32_t* pSrc) { memcpy(m_pPalette.get(), pSrc, pal_size * sizeof(uint32_t)); } -void CFX_DIBSource::GetPalette(uint32_t* pal, int alpha) const { +void CFX_DIBBase::GetPalette(uint32_t* pal, int alpha) const { ASSERT(GetBPP() <= 8 && !IsCmykImage()); if (GetBPP() == 1) { pal[0] = ((m_pPalette ? m_pPalette.get()[0] : 0xff000000) & 0xffffff) | @@ -924,7 +923,7 @@ void CFX_DIBSource::GetPalette(uint32_t* pal, int alpha) const { } } -RetainPtr<CFX_DIBitmap> CFX_DIBSource::CloneAlphaMask() const { +RetainPtr<CFX_DIBitmap> CFX_DIBBase::CloneAlphaMask() const { ASSERT(GetFormat() == FXDIB_Argb); FX_RECT rect(0, 0, m_Width, m_Height); auto pMask = pdfium::MakeRetain<CFX_DIBitmap>(); @@ -942,8 +941,8 @@ RetainPtr<CFX_DIBitmap> CFX_DIBSource::CloneAlphaMask() const { return pMask; } -bool CFX_DIBSource::SetAlphaMask(const RetainPtr<CFX_DIBSource>& pAlphaMask, - const FX_RECT* pClip) { +bool CFX_DIBBase::SetAlphaMask(const RetainPtr<CFX_DIBBase>& pAlphaMask, + const FX_RECT* pClip) { if (!HasAlpha() || GetFormat() == FXDIB_Argb) return false; @@ -970,8 +969,7 @@ bool CFX_DIBSource::SetAlphaMask(const RetainPtr<CFX_DIBSource>& pAlphaMask, return true; } -RetainPtr<CFX_DIBitmap> CFX_DIBSource::FlipImage(bool bXFlip, - bool bYFlip) const { +RetainPtr<CFX_DIBitmap> CFX_DIBBase::FlipImage(bool bXFlip, bool bYFlip) const { auto pFlipped = pdfium::MakeRetain<CFX_DIBitmap>(); if (!pFlipped->Create(m_Width, m_Height, GetFormat())) return nullptr; @@ -1042,7 +1040,7 @@ RetainPtr<CFX_DIBitmap> CFX_DIBSource::FlipImage(bool bXFlip, return pFlipped; } -RetainPtr<CFX_DIBitmap> CFX_DIBSource::CloneConvert(FXDIB_Format dest_format) { +RetainPtr<CFX_DIBitmap> CFX_DIBBase::CloneConvert(FXDIB_Format dest_format) { if (dest_format == GetFormat()) return Clone(nullptr); @@ -1068,7 +1066,7 @@ RetainPtr<CFX_DIBitmap> CFX_DIBSource::CloneConvert(FXDIB_Format dest_format) { return nullptr; } - RetainPtr<CFX_DIBSource> holder(this); + RetainPtr<CFX_DIBBase> 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)) { @@ -1080,7 +1078,7 @@ RetainPtr<CFX_DIBitmap> CFX_DIBSource::CloneConvert(FXDIB_Format dest_format) { return pClone; } -RetainPtr<CFX_DIBitmap> CFX_DIBSource::SwapXY(bool bXFlip, bool bYFlip) const { +RetainPtr<CFX_DIBitmap> CFX_DIBBase::SwapXY(bool bXFlip, bool bYFlip) const { FX_RECT dest_clip(0, 0, m_Height, m_Width); if (dest_clip.IsEmpty()) return nullptr; @@ -1170,11 +1168,10 @@ RetainPtr<CFX_DIBitmap> CFX_DIBSource::SwapXY(bool bXFlip, bool bYFlip) const { return pTransBitmap; } -RetainPtr<CFX_DIBitmap> CFX_DIBSource::TransformTo( - const CFX_Matrix* pDestMatrix, - int* result_left, - int* result_top) { - RetainPtr<CFX_DIBSource> holder(this); +RetainPtr<CFX_DIBitmap> CFX_DIBBase::TransformTo(const CFX_Matrix* pDestMatrix, + int* result_left, + int* result_top) { + RetainPtr<CFX_DIBBase> holder(this); CFX_ImageTransformer transformer(holder, pDestMatrix, 0, nullptr); transformer.Continue(nullptr); *result_left = transformer.result().left; @@ -1182,11 +1179,11 @@ RetainPtr<CFX_DIBitmap> CFX_DIBSource::TransformTo( return transformer.DetachBitmap(); } -RetainPtr<CFX_DIBitmap> CFX_DIBSource::StretchTo(int dest_width, - int dest_height, - uint32_t flags, - const FX_RECT* pClip) { - RetainPtr<CFX_DIBSource> holder(this); +RetainPtr<CFX_DIBitmap> CFX_DIBBase::StretchTo(int dest_width, + int dest_height, + uint32_t flags, + const FX_RECT* pClip) { + RetainPtr<CFX_DIBBase> holder(this); FX_RECT clip_rect(0, 0, abs(dest_width), abs(dest_height)); if (pClip) clip_rect.Intersect(*pClip); @@ -1207,13 +1204,13 @@ RetainPtr<CFX_DIBitmap> CFX_DIBSource::StretchTo(int dest_width, } // static -bool CFX_DIBSource::ConvertBuffer( +bool CFX_DIBBase::ConvertBuffer( FXDIB_Format dest_format, uint8_t* dest_buf, int dest_pitch, int width, int height, - const RetainPtr<CFX_DIBSource>& pSrcBitmap, + const RetainPtr<CFX_DIBBase>& 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_dibbase.h index 064dbe2055..ef35fc86e7 100644 --- a/core/fxge/dib/cfx_dibsource.h +++ b/core/fxge/dib/cfx_dibbase.h @@ -4,8 +4,8 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com -#ifndef CORE_FXGE_DIB_CFX_DIBSOURCE_H_ -#define CORE_FXGE_DIB_CFX_DIBSOURCE_H_ +#ifndef CORE_FXGE_DIB_CFX_DIBBASE_H_ +#define CORE_FXGE_DIB_CFX_DIBBASE_H_ #include <memory> @@ -29,9 +29,10 @@ class CFX_ClipRgn; class CFX_DIBitmap; class PauseIndicatorIface; -class CFX_DIBSource : public Retainable { +// Base class for all Device-Indepenent Bitmaps. +class CFX_DIBBase : public Retainable { public: - ~CFX_DIBSource() override; + ~CFX_DIBBase() override; virtual uint8_t* GetBuffer() const; virtual const uint8_t* GetScanline(int line) const = 0; @@ -90,7 +91,7 @@ class CFX_DIBSource : public Retainable { RetainPtr<CFX_DIBitmap> CloneAlphaMask() const; // Copies into internally-owned mask. - bool SetAlphaMask(const RetainPtr<CFX_DIBSource>& pAlphaMask, + bool SetAlphaMask(const RetainPtr<CFX_DIBBase>& pAlphaMask, const FX_RECT* pClip); void GetOverlapRect(int& dest_left, @@ -110,14 +111,14 @@ class CFX_DIBSource : public Retainable { RetainPtr<CFX_DIBitmap> m_pAlphaMask; protected: - CFX_DIBSource(); + CFX_DIBBase(); static bool ConvertBuffer(FXDIB_Format dest_format, uint8_t* dest_buf, int dest_pitch, int width, int height, - const RetainPtr<CFX_DIBSource>& pSrcBitmap, + const RetainPtr<CFX_DIBBase>& pSrcBitmap, int src_left, int src_top, std::unique_ptr<uint32_t, FxFreeDeleter>* pal); @@ -136,4 +137,4 @@ class CFX_DIBSource : public Retainable { std::unique_ptr<uint32_t, FxFreeDeleter> m_pPalette; }; -#endif // CORE_FXGE_DIB_CFX_DIBSOURCE_H_ +#endif // CORE_FXGE_DIB_CFX_DIBBASE_H_ diff --git a/core/fxge/dib/cfx_dibextractor.cpp b/core/fxge/dib/cfx_dibextractor.cpp index 9fe3114b1f..8211dc725a 100644 --- a/core/fxge/dib/cfx_dibextractor.cpp +++ b/core/fxge/dib/cfx_dibextractor.cpp @@ -6,14 +6,14 @@ #include "core/fxge/dib/cfx_dibextractor.h" -#include "core/fxge/dib/cfx_dibsource.h" +#include "core/fxge/dib/cfx_dibbase.h" -CFX_DIBExtractor::CFX_DIBExtractor(const RetainPtr<CFX_DIBSource>& pSrc) { +CFX_DIBExtractor::CFX_DIBExtractor(const RetainPtr<CFX_DIBBase>& pSrc) { if (!pSrc->GetBuffer()) { m_pBitmap = pSrc->Clone(nullptr); return; } - RetainPtr<CFX_DIBSource> pOldSrc(pSrc); + RetainPtr<CFX_DIBBase> pOldSrc(pSrc); m_pBitmap = pdfium::MakeRetain<CFX_DIBitmap>(); if (!m_pBitmap->Create(pOldSrc->GetWidth(), pOldSrc->GetHeight(), pOldSrc->GetFormat(), pOldSrc->GetBuffer(), 0)) { diff --git a/core/fxge/dib/cfx_dibextractor.h b/core/fxge/dib/cfx_dibextractor.h index b6c27a7bd7..cd97f20aac 100644 --- a/core/fxge/dib/cfx_dibextractor.h +++ b/core/fxge/dib/cfx_dibextractor.h @@ -10,11 +10,11 @@ #include "core/fxcrt/retain_ptr.h" #include "core/fxge/dib/cfx_dibitmap.h" -class CFX_DIBSource; +class CFX_DIBBase; class CFX_DIBExtractor { public: - explicit CFX_DIBExtractor(const RetainPtr<CFX_DIBSource>& pSrc); + explicit CFX_DIBExtractor(const RetainPtr<CFX_DIBBase>& pSrc); ~CFX_DIBExtractor(); RetainPtr<CFX_DIBitmap> GetBitmap() { return m_pBitmap; } diff --git a/core/fxge/dib/cfx_dibitmap.cpp b/core/fxge/dib/cfx_dibitmap.cpp index 2c99bd16e0..89cfbb68d3 100644 --- a/core/fxge/dib/cfx_dibitmap.cpp +++ b/core/fxge/dib/cfx_dibitmap.cpp @@ -85,7 +85,7 @@ bool CFX_DIBitmap::Create(int width, return false; } -bool CFX_DIBitmap::Copy(const RetainPtr<CFX_DIBSource>& pSrc) { +bool CFX_DIBitmap::Copy(const RetainPtr<CFX_DIBBase>& pSrc) { if (m_pBuffer) return false; @@ -188,7 +188,7 @@ bool CFX_DIBitmap::TransferBitmap(int dest_left, int dest_top, int width, int height, - const RetainPtr<CFX_DIBSource>& pSrcBitmap, + const RetainPtr<CFX_DIBBase>& pSrcBitmap, int src_left, int src_top) { if (!m_pBuffer) @@ -223,7 +223,7 @@ bool CFX_DIBitmap::TransferWithUnequalFormats( int dest_top, int width, int height, - const RetainPtr<CFX_DIBSource>& pSrcBitmap, + const RetainPtr<CFX_DIBBase>& pSrcBitmap, int src_left, int src_top) { if (m_pPalette) @@ -247,7 +247,7 @@ void CFX_DIBitmap::TransferWithMultipleBPP( int dest_top, int width, int height, - const RetainPtr<CFX_DIBSource>& pSrcBitmap, + const RetainPtr<CFX_DIBBase>& pSrcBitmap, int src_left, int src_top) { int Bpp = GetBPP() / 8; @@ -265,7 +265,7 @@ void CFX_DIBitmap::TransferEqualFormatsOneBPP( int dest_top, int width, int height, - const RetainPtr<CFX_DIBSource>& pSrcBitmap, + const RetainPtr<CFX_DIBBase>& pSrcBitmap, int src_left, int src_top) { for (int row = 0; row < height; ++row) { @@ -283,12 +283,12 @@ void CFX_DIBitmap::TransferEqualFormatsOneBPP( } bool CFX_DIBitmap::LoadChannel(FXDIB_Channel destChannel, - const RetainPtr<CFX_DIBSource>& pSrcBitmap, + const RetainPtr<CFX_DIBBase>& pSrcBitmap, FXDIB_Channel srcChannel) { if (!m_pBuffer) return false; - RetainPtr<CFX_DIBSource> pSrcClone = pSrcBitmap; + RetainPtr<CFX_DIBBase> pSrcClone = pSrcBitmap; int srcOffset; if (srcChannel == FXDIB_Alpha) { if (!pSrcBitmap->HasAlpha() && !pSrcBitmap->IsAlphaMask()) @@ -348,7 +348,7 @@ bool CFX_DIBitmap::LoadChannel(FXDIB_Channel destChannel, destOffset = kChannelOffset[destChannel]; } if (srcChannel == FXDIB_Alpha && pSrcClone->m_pAlphaMask) { - RetainPtr<CFX_DIBSource> pAlphaMask = pSrcClone->m_pAlphaMask; + RetainPtr<CFX_DIBBase> pAlphaMask = pSrcClone->m_pAlphaMask; if (pSrcClone->GetWidth() != m_Width || pSrcClone->GetHeight() != m_Height) { if (pAlphaMask) { @@ -446,7 +446,7 @@ bool CFX_DIBitmap::LoadChannel(FXDIB_Channel destChannel, int value) { return true; } -bool CFX_DIBitmap::MultiplyAlpha(const RetainPtr<CFX_DIBSource>& pSrcBitmap) { +bool CFX_DIBitmap::MultiplyAlpha(const RetainPtr<CFX_DIBBase>& pSrcBitmap) { if (!m_pBuffer) return false; @@ -881,7 +881,7 @@ bool CFX_DIBitmap::CompositeBitmap(int dest_left, int dest_top, int width, int height, - const RetainPtr<CFX_DIBSource>& pSrcBitmap, + const RetainPtr<CFX_DIBBase>& pSrcBitmap, int src_left, int src_top, int blend_type, @@ -952,7 +952,7 @@ bool CFX_DIBitmap::CompositeMask(int dest_left, int dest_top, int width, int height, - const RetainPtr<CFX_DIBSource>& pMask, + const RetainPtr<CFX_DIBBase>& pMask, uint32_t color, int src_left, int src_top, @@ -1266,7 +1266,7 @@ bool CFX_DIBitmap::ConvertFormat(FXDIB_Format dest_format) { } } bool ret = false; - RetainPtr<CFX_DIBSource> holder(this); + RetainPtr<CFX_DIBBase> 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 d9afee6800..dc6720ed96 100644 --- a/core/fxge/dib/cfx_dibitmap.h +++ b/core/fxge/dib/cfx_dibitmap.h @@ -10,10 +10,10 @@ #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 "core/fxge/dib/cfx_dibbase.h" #include "third_party/base/stl_util.h" -class CFX_DIBitmap : public CFX_DIBSource { +class CFX_DIBitmap : public CFX_DIBBase { public: template <typename T, typename... Args> friend RetainPtr<T> pdfium::MakeRetain(Args&&... args); @@ -26,9 +26,9 @@ class CFX_DIBitmap : public CFX_DIBSource { uint8_t* pBuffer, uint32_t pitch); - bool Copy(const RetainPtr<CFX_DIBSource>& pSrc); + bool Copy(const RetainPtr<CFX_DIBBase>& pSrc); - // CFX_DIBSource + // CFX_DIBBase uint8_t* GetBuffer() const override; const uint8_t* GetScanline(int line) const override; void DownSampleScanline(int line, @@ -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 RetainPtr<CFX_DIBSource>& pSrcBitmap, + const RetainPtr<CFX_DIBBase>& pSrcBitmap, FXDIB_Channel srcChannel); bool LoadChannel(FXDIB_Channel destChannel, int value); bool MultiplyAlpha(int alpha); - bool MultiplyAlpha(const RetainPtr<CFX_DIBSource>& pAlphaMask); + bool MultiplyAlpha(const RetainPtr<CFX_DIBBase>& pAlphaMask); bool TransferBitmap(int dest_left, int dest_top, int width, int height, - const RetainPtr<CFX_DIBSource>& pSrcBitmap, + const RetainPtr<CFX_DIBBase>& 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 RetainPtr<CFX_DIBSource>& pSrcBitmap, + const RetainPtr<CFX_DIBBase>& pSrcBitmap, int src_left, int src_top, int blend_type, @@ -77,7 +77,7 @@ class CFX_DIBitmap : public CFX_DIBSource { int dest_top, int width, int height, - const RetainPtr<CFX_DIBSource>& pMask, + const RetainPtr<CFX_DIBBase>& pMask, uint32_t color, int src_left, int src_top, @@ -130,21 +130,21 @@ class CFX_DIBitmap : public CFX_DIBSource { int dest_top, int width, int height, - const RetainPtr<CFX_DIBSource>& pSrcBitmap, + const RetainPtr<CFX_DIBBase>& pSrcBitmap, int src_left, int src_top); void TransferWithMultipleBPP(int dest_left, int dest_top, int width, int height, - const RetainPtr<CFX_DIBSource>& pSrcBitmap, + const RetainPtr<CFX_DIBBase>& pSrcBitmap, int src_left, int src_top); void TransferEqualFormatsOneBPP(int dest_left, int dest_top, int width, int height, - const RetainPtr<CFX_DIBSource>& pSrcBitmap, + const RetainPtr<CFX_DIBBase>& pSrcBitmap, int src_left, int src_top); }; diff --git a/core/fxge/dib/cfx_filtereddib.cpp b/core/fxge/dib/cfx_filtereddib.cpp index 1d5ed6200c..297a099a4c 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 RetainPtr<CFX_DIBSource>& pSrc) { +void CFX_FilteredDIB::LoadSrc(const RetainPtr<CFX_DIBBase>& 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 9c1efa544d..ec32a787c4 100644 --- a/core/fxge/dib/cfx_filtereddib.h +++ b/core/fxge/dib/cfx_filtereddib.h @@ -10,9 +10,9 @@ #include <vector> #include "core/fxcrt/retain_ptr.h" -#include "core/fxge/dib/cfx_dibsource.h" +#include "core/fxge/dib/cfx_dibbase.h" -class CFX_FilteredDIB : public CFX_DIBSource { +class CFX_FilteredDIB : public CFX_DIBBase { public: template <typename T, typename... Args> friend RetainPtr<T> pdfium::MakeRetain(Args&&... args); @@ -26,13 +26,13 @@ class CFX_FilteredDIB : public CFX_DIBSource { int pixels, int Bpp) const = 0; - void LoadSrc(const RetainPtr<CFX_DIBSource>& pSrc); + void LoadSrc(const RetainPtr<CFX_DIBBase>& pSrc); protected: CFX_FilteredDIB(); ~CFX_FilteredDIB() override; - // CFX_DIBSource + // CFX_DIBBase const uint8_t* GetScanline(int line) const override; void DownSampleScanline(int line, uint8_t* dest_scan, @@ -42,7 +42,7 @@ class CFX_FilteredDIB : public CFX_DIBSource { int clip_left, int clip_width) const override; - RetainPtr<CFX_DIBSource> m_pSrc; + RetainPtr<CFX_DIBBase> 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 a196068a2e..64c484f24d 100644 --- a/core/fxge/dib/cfx_imagerenderer.cpp +++ b/core/fxge/dib/cfx_imagerenderer.cpp @@ -15,7 +15,7 @@ CFX_ImageRenderer::CFX_ImageRenderer(const RetainPtr<CFX_DIBitmap>& pDevice, const CFX_ClipRgn* pClipRgn, - const RetainPtr<CFX_DIBSource>& pSource, + const RetainPtr<CFX_DIBBase>& pSource, int bitmap_alpha, uint32_t mask_color, const CFX_Matrix* pMatrix, diff --git a/core/fxge/dib/cfx_imagerenderer.h b/core/fxge/dib/cfx_imagerenderer.h index 14eaf56ff8..905ff8c25d 100644 --- a/core/fxge/dib/cfx_imagerenderer.h +++ b/core/fxge/dib/cfx_imagerenderer.h @@ -13,8 +13,8 @@ #include "core/fxcrt/retain_ptr.h" #include "core/fxcrt/unowned_ptr.h" #include "core/fxge/dib/cfx_bitmapcomposer.h" +#include "core/fxge/dib/cfx_dibbase.h" #include "core/fxge/dib/cfx_dibitmap.h" -#include "core/fxge/dib/cfx_dibsource.h" #include "core/fxge/fx_dib.h" #include "third_party/base/stl_util.h" @@ -25,7 +25,7 @@ class CFX_ImageRenderer { public: CFX_ImageRenderer(const RetainPtr<CFX_DIBitmap>& pDevice, const CFX_ClipRgn* pClipRgn, - const RetainPtr<CFX_DIBSource>& pSource, + const RetainPtr<CFX_DIBBase>& pSource, int bitmap_alpha, uint32_t mask_color, const CFX_Matrix* pMatrix, diff --git a/core/fxge/dib/cfx_imagestretcher.cpp b/core/fxge/dib/cfx_imagestretcher.cpp index 1c54e3fdd0..809d3b12dd 100644 --- a/core/fxge/dib/cfx_imagestretcher.cpp +++ b/core/fxge/dib/cfx_imagestretcher.cpp @@ -9,8 +9,8 @@ #include <climits> #include <tuple> +#include "core/fxge/dib/cfx_dibbase.h" #include "core/fxge/dib/cfx_dibitmap.h" -#include "core/fxge/dib/cfx_dibsource.h" #include "core/fxge/dib/cstretchengine.h" #include "core/fxge/fx_dib.h" #include "third_party/base/ptr_util.h" @@ -23,7 +23,7 @@ bool SourceSizeWithinLimit(int width, int height) { return !height || width < kMaxProgressiveStretchPixels / height; } -FXDIB_Format GetStretchedFormat(const CFX_DIBSource& src) { +FXDIB_Format GetStretchedFormat(const CFX_DIBBase& src) { FXDIB_Format format = src.GetFormat(); if (format == FXDIB_1bppMask) return FXDIB_8bppMask; @@ -43,7 +43,7 @@ std::tuple<int, int, int, int> CmykDecode(const uint32_t cmyk) { } // namespace CFX_ImageStretcher::CFX_ImageStretcher(ScanlineComposerIface* pDest, - const RetainPtr<CFX_DIBSource>& pSource, + const RetainPtr<CFX_DIBBase>& pSource, int dest_width, int dest_height, const FX_RECT& bitmap_rect, diff --git a/core/fxge/dib/cfx_imagestretcher.h b/core/fxge/dib/cfx_imagestretcher.h index 113372571b..8e866620fd 100644 --- a/core/fxge/dib/cfx_imagestretcher.h +++ b/core/fxge/dib/cfx_imagestretcher.h @@ -16,13 +16,13 @@ #include "core/fxge/dib/scanlinecomposer_iface.h" #include "core/fxge/fx_dib.h" -class CFX_DIBSource; +class CFX_DIBBase; class PauseIndicatorIface; class CFX_ImageStretcher { public: CFX_ImageStretcher(ScanlineComposerIface* pDest, - const RetainPtr<CFX_DIBSource>& pSource, + const RetainPtr<CFX_DIBBase>& pSource, int dest_width, int dest_height, const FX_RECT& bitmap_rect, @@ -32,7 +32,7 @@ class CFX_ImageStretcher { bool Start(); bool Continue(PauseIndicatorIface* pPause); - RetainPtr<CFX_DIBSource> source() { return m_pSource; } + RetainPtr<CFX_DIBBase> source() { return m_pSource; } private: bool StartQuickStretch(); @@ -41,7 +41,7 @@ class CFX_ImageStretcher { bool ContinueStretch(PauseIndicatorIface* pPause); UnownedPtr<ScanlineComposerIface> const m_pDest; - RetainPtr<CFX_DIBSource> m_pSource; + RetainPtr<CFX_DIBBase> 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 c41ac2bdf2..0042462c89 100644 --- a/core/fxge/dib/cfx_imagetransformer.cpp +++ b/core/fxge/dib/cfx_imagetransformer.cpp @@ -99,7 +99,7 @@ void bicubic_get_pos_weight(int pos_pixel[], v_w[3] = SDP_Table[512 - res_y]; } -FXDIB_Format GetTransformedFormat(const RetainPtr<CFX_DIBSource>& pDrc) { +FXDIB_Format GetTransformedFormat(const RetainPtr<CFX_DIBBase>& pDrc) { if (pDrc->IsAlphaMask()) return FXDIB_8bppMask; @@ -200,7 +200,7 @@ class CFX_BilinearMatrix : public CPDF_FixedMatrix { } // namespace -CFX_ImageTransformer::CFX_ImageTransformer(const RetainPtr<CFX_DIBSource>& pSrc, +CFX_ImageTransformer::CFX_ImageTransformer(const RetainPtr<CFX_DIBBase>& pSrc, const CFX_Matrix* pMatrix, int flags, const FX_RECT* pClip) diff --git a/core/fxge/dib/cfx_imagetransformer.h b/core/fxge/dib/cfx_imagetransformer.h index a5b8841611..61fe1e1ba1 100644 --- a/core/fxge/dib/cfx_imagetransformer.h +++ b/core/fxge/dib/cfx_imagetransformer.h @@ -13,14 +13,14 @@ #include "core/fxcrt/retain_ptr.h" #include "core/fxcrt/unowned_ptr.h" #include "core/fxge/dib/cfx_bitmapstorer.h" +#include "core/fxge/dib/cfx_dibbase.h" #include "core/fxge/dib/cfx_dibitmap.h" -#include "core/fxge/dib/cfx_dibsource.h" class CFX_ImageStretcher; class CFX_ImageTransformer { public: - CFX_ImageTransformer(const RetainPtr<CFX_DIBSource>& pSrc, + CFX_ImageTransformer(const RetainPtr<CFX_DIBBase>& pSrc, const CFX_Matrix* pMatrix, int flags, const FX_RECT* pClip); @@ -98,7 +98,7 @@ class CFX_ImageTransformer { int increment, std::function<void(const DownSampleData&, uint8_t*)> func); - const RetainPtr<CFX_DIBSource> m_pSrc; + const RetainPtr<CFX_DIBBase> m_pSrc; UnownedPtr<const CFX_Matrix> const m_pMatrix; const FX_RECT* const m_pClip; FX_RECT m_StretchClip; diff --git a/core/fxge/dib/cfx_scanlinecompositor.h b/core/fxge/dib/cfx_scanlinecompositor.h index 75ab578128..1c373f036b 100644 --- a/core/fxge/dib/cfx_scanlinecompositor.h +++ b/core/fxge/dib/cfx_scanlinecompositor.h @@ -9,7 +9,7 @@ #include <memory> -#include "core/fxge/dib/cfx_dibsource.h" +#include "core/fxge/dib/cfx_dibbase.h" class CFX_ScanlineCompositor { public: diff --git a/core/fxge/dib/cstretchengine.cpp b/core/fxge/dib/cstretchengine.cpp index ad9a356f34..41a843de66 100644 --- a/core/fxge/dib/cstretchengine.cpp +++ b/core/fxge/dib/cstretchengine.cpp @@ -10,8 +10,8 @@ #include <utility> #include "core/fxcrt/pauseindicator_iface.h" +#include "core/fxge/dib/cfx_dibbase.h" #include "core/fxge/dib/cfx_dibitmap.h" -#include "core/fxge/dib/cfx_dibsource.h" #include "core/fxge/dib/scanlinecomposer_iface.h" #include "core/fxge/fx_dib.h" @@ -227,7 +227,7 @@ CStretchEngine::CStretchEngine(ScanlineComposerIface* pDestBitmap, int dest_width, int dest_height, const FX_RECT& clip_rect, - const RetainPtr<CFX_DIBSource>& pSrcBitmap, + const RetainPtr<CFX_DIBBase>& pSrcBitmap, int flags) : m_DestFormat(dest_format), m_DestBpp(GetBppFromFormat(dest_format)), diff --git a/core/fxge/dib/cstretchengine.h b/core/fxge/dib/cstretchengine.h index c9f11d6006..db7a2be56d 100644 --- a/core/fxge/dib/cstretchengine.h +++ b/core/fxge/dib/cstretchengine.h @@ -24,7 +24,7 @@ class CStretchEngine { int dest_width, int dest_height, const FX_RECT& clip_rect, - const RetainPtr<CFX_DIBSource>& pSrcBitmap, + const RetainPtr<CFX_DIBBase>& pSrcBitmap, int flags); ~CStretchEngine(); @@ -80,7 +80,7 @@ class CStretchEngine { const int m_DestBpp; const int m_SrcBpp; const int m_bHasAlpha; - RetainPtr<CFX_DIBSource> const m_pSource; + RetainPtr<CFX_DIBBase> const m_pSource; const uint32_t* m_pSrcPalette; const int m_SrcWidth; const int m_SrcHeight; diff --git a/core/fxge/dib/cstretchengine_unittest.cpp b/core/fxge/dib/cstretchengine_unittest.cpp index 2c7e0342de..8169cae328 100644 --- a/core/fxge/dib/cstretchengine_unittest.cpp +++ b/core/fxge/dib/cstretchengine_unittest.cpp @@ -10,7 +10,7 @@ #include "core/fpdfapi/parser/cpdf_dictionary.h" #include "core/fpdfapi/parser/cpdf_number.h" #include "core/fpdfapi/parser/cpdf_stream.h" -#include "core/fpdfapi/render/cpdf_dibsource.h" +#include "core/fpdfapi/render/cpdf_dibbase.h" #include "core/fxcrt/fx_memory.h" #include "core/fxge/fx_dib.h" #include "testing/gtest/include/gtest/gtest.h" @@ -24,7 +24,7 @@ TEST(CStretchEngine, OverflowInCtor) { dict_obj->SetNewFor<CPDF_Number>("Height", 12500); std::unique_ptr<CPDF_Stream> stream = pdfium::MakeUnique<CPDF_Stream>(nullptr, 0, std::move(dict_obj)); - auto dib_source = pdfium::MakeRetain<CPDF_DIBSource>(); + auto dib_source = pdfium::MakeRetain<CPDF_DIBBase>(); dib_source->Load(nullptr, stream.get()); CStretchEngine engine(nullptr, FXDIB_8bppRgb, 500, 500, clip_rect, dib_source, 0); diff --git a/core/fxge/fx_dib.h b/core/fxge/fx_dib.h index 3475e5c4bd..7d8ca5fd72 100644 --- a/core/fxge/fx_dib.h +++ b/core/fxge/fx_dib.h @@ -45,7 +45,7 @@ using FX_COLORREF = uint32_t; using FX_CMYK = uint32_t; class CFX_ClipRgn; -class CFX_DIBSource; +class CFX_DIBBase; class CStretchEngine; extern const int16_t SDP_Table[513]; diff --git a/core/fxge/renderdevicedriver_iface.cpp b/core/fxge/renderdevicedriver_iface.cpp index 7023e021bd..646851ff45 100644 --- a/core/fxge/renderdevicedriver_iface.cpp +++ b/core/fxge/renderdevicedriver_iface.cpp @@ -81,8 +81,8 @@ bool RenderDeviceDriverIface::DrawShading(const CPDF_ShadingPattern* pPattern, } bool RenderDeviceDriverIface::SetBitsWithMask( - const RetainPtr<CFX_DIBSource>& pBitmap, - const RetainPtr<CFX_DIBSource>& pMask, + const RetainPtr<CFX_DIBBase>& pBitmap, + const RetainPtr<CFX_DIBBase>& pMask, int left, int top, int bitmap_alpha, diff --git a/core/fxge/renderdevicedriver_iface.h b/core/fxge/renderdevicedriver_iface.h index a0c148d117..62287abe62 100644 --- a/core/fxge/renderdevicedriver_iface.h +++ b/core/fxge/renderdevicedriver_iface.h @@ -14,7 +14,7 @@ #include "core/fxcrt/retain_ptr.h" class CFX_DIBitmap; -class CFX_DIBSource; +class CFX_DIBBase; class CFX_Font; class CFX_GraphStateData; class CFX_ImageRenderer; @@ -63,13 +63,13 @@ class RenderDeviceDriverIface { int left, int top); virtual RetainPtr<CFX_DIBitmap> GetBackDrop(); - virtual bool SetDIBits(const RetainPtr<CFX_DIBSource>& pBitmap, + virtual bool SetDIBits(const RetainPtr<CFX_DIBBase>& pBitmap, uint32_t color, const FX_RECT* pSrcRect, int dest_left, int dest_top, int blend_type) = 0; - virtual bool StretchDIBits(const RetainPtr<CFX_DIBSource>& pBitmap, + virtual bool StretchDIBits(const RetainPtr<CFX_DIBBase>& pBitmap, uint32_t color, int dest_left, int dest_top, @@ -78,7 +78,7 @@ class RenderDeviceDriverIface { const FX_RECT* pClipRect, uint32_t flags, int blend_type) = 0; - virtual bool StartDIBits(const RetainPtr<CFX_DIBSource>& pBitmap, + virtual bool StartDIBits(const RetainPtr<CFX_DIBBase>& pBitmap, int bitmap_alpha, uint32_t color, const CFX_Matrix* pMatrix, @@ -100,8 +100,8 @@ class RenderDeviceDriverIface { const FX_RECT& clip_rect, int alpha, bool bAlphaMode); - virtual bool SetBitsWithMask(const RetainPtr<CFX_DIBSource>& pBitmap, - const RetainPtr<CFX_DIBSource>& pMask, + virtual bool SetBitsWithMask(const RetainPtr<CFX_DIBBase>& pBitmap, + const RetainPtr<CFX_DIBBase>& pMask, int left, int top, int bitmap_alpha, diff --git a/core/fxge/skia/fx_skia_device.cpp b/core/fxge/skia/fx_skia_device.cpp index 0b96cdca5f..db181003ed 100644 --- a/core/fxge/skia/fx_skia_device.cpp +++ b/core/fxge/skia/fx_skia_device.cpp @@ -60,7 +60,7 @@ void RgbByteOrderTransferBitmap(const RetainPtr<CFX_DIBitmap>& pBitmap, int dest_top, int width, int height, - const RetainPtr<CFX_DIBSource>& pSrcBitmap, + const RetainPtr<CFX_DIBBase>& pSrcBitmap, int src_left, int src_top) { if (!pBitmap) @@ -566,7 +566,7 @@ void SetBitmapPaint(bool isAlphaMask, paint->setAlpha(bitmap_alpha); } -bool Upsample(const RetainPtr<CFX_DIBSource>& pSource, +bool Upsample(const RetainPtr<CFX_DIBBase>& pSource, std::unique_ptr<uint8_t, FxFreeDeleter>& dst8Storage, std::unique_ptr<uint32_t, FxFreeDeleter>& dst32Storage, SkBitmap* skBitmap, @@ -2256,7 +2256,7 @@ RetainPtr<CFX_DIBitmap> CFX_SkiaDeviceDriver::GetBackDrop() { return m_pBackdropBitmap; } -bool CFX_SkiaDeviceDriver::SetDIBits(const RetainPtr<CFX_DIBSource>& pBitmap, +bool CFX_SkiaDeviceDriver::SetDIBits(const RetainPtr<CFX_DIBBase>& pBitmap, uint32_t argb, const FX_RECT* pSrcRect, int left, @@ -2286,16 +2286,15 @@ bool CFX_SkiaDeviceDriver::SetDIBits(const RetainPtr<CFX_DIBSource>& pBitmap, #endif // _SKIA_SUPPORT_PATHS_ } -bool CFX_SkiaDeviceDriver::StretchDIBits( - const RetainPtr<CFX_DIBSource>& pSource, - uint32_t argb, - int dest_left, - int dest_top, - int dest_width, - int dest_height, - const FX_RECT* pClipRect, - uint32_t flags, - int blend_type) { +bool CFX_SkiaDeviceDriver::StretchDIBits(const RetainPtr<CFX_DIBBase>& pSource, + uint32_t argb, + int dest_left, + int dest_top, + int dest_width, + int dest_height, + const FX_RECT* pClipRect, + uint32_t flags, + int blend_type) { #ifdef _SKIA_SUPPORT_ m_pCache->FlushForDraw(); if (!m_pBitmap->GetBuffer()) @@ -2339,7 +2338,7 @@ bool CFX_SkiaDeviceDriver::StretchDIBits( } bool CFX_SkiaDeviceDriver::StartDIBits( - const RetainPtr<CFX_DIBSource>& pSource, + const RetainPtr<CFX_DIBBase>& pSource, int bitmap_alpha, uint32_t argb, const CFX_Matrix* pMatrix, @@ -2472,8 +2471,8 @@ void CFX_DIBitmap::UnPreMultiply() { #ifdef _SKIA_SUPPORT_ bool CFX_SkiaDeviceDriver::DrawBitsWithMask( - const RetainPtr<CFX_DIBSource>& pSource, - const RetainPtr<CFX_DIBSource>& pMask, + const RetainPtr<CFX_DIBBase>& pSource, + const RetainPtr<CFX_DIBBase>& pMask, int bitmap_alpha, const CFX_Matrix* pMatrix, int blend_type) { @@ -2513,8 +2512,8 @@ bool CFX_SkiaDeviceDriver::DrawBitsWithMask( } bool CFX_SkiaDeviceDriver::SetBitsWithMask( - const RetainPtr<CFX_DIBSource>& pBitmap, - const RetainPtr<CFX_DIBSource>& pMask, + const RetainPtr<CFX_DIBBase>& pBitmap, + const RetainPtr<CFX_DIBBase>& pMask, int dest_left, int dest_top, int bitmap_alpha, @@ -2614,8 +2613,8 @@ void CFX_DefaultRenderDevice::DebugVerifyBitmapIsPreMultiplied() const { } bool CFX_DefaultRenderDevice::SetBitsWithMask( - const RetainPtr<CFX_DIBSource>& pBitmap, - const RetainPtr<CFX_DIBSource>& pMask, + const RetainPtr<CFX_DIBBase>& pBitmap, + const RetainPtr<CFX_DIBBase>& pMask, int left, int top, int bitmap_alpha, @@ -2629,7 +2628,7 @@ bool CFX_DefaultRenderDevice::SetBitsWithMask( } #endif // _SKIA_SUPPORT_ -void CFX_DIBSource::DebugVerifyBitmapIsPreMultiplied(void* opt) const { +void CFX_DIBBase::DebugVerifyBitmapIsPreMultiplied(void* opt) const { #ifdef SK_DEBUG SkASSERT(32 == GetBPP()); const uint32_t* buffer = (const uint32_t*)(opt ? opt : GetBuffer()); diff --git a/core/fxge/skia/fx_skia_device.h b/core/fxge/skia/fx_skia_device.h index 692199f6bb..ce6ca6b000 100644 --- a/core/fxge/skia/fx_skia_device.h +++ b/core/fxge/skia/fx_skia_device.h @@ -83,15 +83,15 @@ class CFX_SkiaDeviceDriver : public RenderDeviceDriverIface { RetainPtr<CFX_DIBitmap> GetBackDrop() override; - bool SetDIBits(const RetainPtr<CFX_DIBSource>& pBitmap, + bool SetDIBits(const RetainPtr<CFX_DIBBase>& pBitmap, uint32_t color, const FX_RECT* pSrcRect, int dest_left, int dest_top, int blend_type) override; #ifdef _SKIA_SUPPORT_ - bool SetBitsWithMask(const RetainPtr<CFX_DIBSource>& pBitmap, - const RetainPtr<CFX_DIBSource>& pMask, + bool SetBitsWithMask(const RetainPtr<CFX_DIBBase>& pBitmap, + const RetainPtr<CFX_DIBBase>& pMask, int dest_left, int dest_top, int bitmap_alpha, @@ -102,7 +102,7 @@ class CFX_SkiaDeviceDriver : public RenderDeviceDriverIface { void SetClipMask(const FX_RECT& clipBox, const SkPath& skClipPath); #endif - bool StretchDIBits(const RetainPtr<CFX_DIBSource>& pBitmap, + bool StretchDIBits(const RetainPtr<CFX_DIBBase>& pBitmap, uint32_t color, int dest_left, int dest_top, @@ -112,7 +112,7 @@ class CFX_SkiaDeviceDriver : public RenderDeviceDriverIface { uint32_t flags, int blend_type) override; - bool StartDIBits(const RetainPtr<CFX_DIBSource>& pBitmap, + bool StartDIBits(const RetainPtr<CFX_DIBBase>& pBitmap, int bitmap_alpha, uint32_t color, const CFX_Matrix* pMatrix, @@ -123,8 +123,8 @@ class CFX_SkiaDeviceDriver : public RenderDeviceDriverIface { bool ContinueDIBits(CFX_ImageRenderer* handle, PauseIndicatorIface* pPause) override; - bool DrawBitsWithMask(const RetainPtr<CFX_DIBSource>& pBitmap, - const RetainPtr<CFX_DIBSource>& pMask, + bool DrawBitsWithMask(const RetainPtr<CFX_DIBBase>& pBitmap, + const RetainPtr<CFX_DIBBase>& pMask, int bitmap_alpha, const CFX_Matrix* pMatrix, int blend_type); diff --git a/core/fxge/win32/cfx_psrenderer.cpp b/core/fxge/win32/cfx_psrenderer.cpp index 036cb43577..f5970a3ad1 100644 --- a/core/fxge/win32/cfx_psrenderer.cpp +++ b/core/fxge/win32/cfx_psrenderer.cpp @@ -337,7 +337,7 @@ void CFX_PSRenderer::SetGraphState(const CFX_GraphStateData* pGraphState) { WriteToStream(&buf); } -bool CFX_PSRenderer::SetDIBits(const RetainPtr<CFX_DIBSource>& pSource, +bool CFX_PSRenderer::SetDIBits(const RetainPtr<CFX_DIBBase>& pSource, uint32_t color, int left, int top) { @@ -348,7 +348,7 @@ bool CFX_PSRenderer::SetDIBits(const RetainPtr<CFX_DIBSource>& pSource, return DrawDIBits(pSource, color, &matrix, 0); } -bool CFX_PSRenderer::StretchDIBits(const RetainPtr<CFX_DIBSource>& pSource, +bool CFX_PSRenderer::StretchDIBits(const RetainPtr<CFX_DIBBase>& pSource, uint32_t color, int dest_left, int dest_top, @@ -361,7 +361,7 @@ bool CFX_PSRenderer::StretchDIBits(const RetainPtr<CFX_DIBSource>& pSource, return DrawDIBits(pSource, color, &matrix, flags); } -bool CFX_PSRenderer::DrawDIBits(const RetainPtr<CFX_DIBSource>& pSource, +bool CFX_PSRenderer::DrawDIBits(const RetainPtr<CFX_DIBBase>& pSource, uint32_t color, const CFX_Matrix* pMatrix, uint32_t flags) { @@ -423,7 +423,7 @@ bool CFX_PSRenderer::DrawDIBits(const RetainPtr<CFX_DIBSource>& pSource, output_buf.release(); } else { CFX_DIBExtractor source_extractor(pSource); - RetainPtr<CFX_DIBSource> pConverted = source_extractor.GetBitmap(); + RetainPtr<CFX_DIBBase> pConverted = source_extractor.GetBitmap(); if (!pConverted) return false; switch (pSource->GetFormat()) { diff --git a/core/fxge/win32/cfx_psrenderer.h b/core/fxge/win32/cfx_psrenderer.h index 4116dd4a51..e54c2f8744 100644 --- a/core/fxge/win32/cfx_psrenderer.h +++ b/core/fxge/win32/cfx_psrenderer.h @@ -16,7 +16,7 @@ #include "core/fxcrt/retain_ptr.h" #include "core/fxge/cfx_graphstatedata.h" -class CFX_DIBSource; +class CFX_DIBBase; class CFX_FaceCache; class CFX_Font; class CFX_FontCache; @@ -52,18 +52,18 @@ class CFX_PSRenderer { uint32_t fill_color, uint32_t stroke_color, int fill_mode); - bool SetDIBits(const RetainPtr<CFX_DIBSource>& pBitmap, + bool SetDIBits(const RetainPtr<CFX_DIBBase>& pBitmap, uint32_t color, int dest_left, int dest_top); - bool StretchDIBits(const RetainPtr<CFX_DIBSource>& pBitmap, + bool StretchDIBits(const RetainPtr<CFX_DIBBase>& pBitmap, uint32_t color, int dest_left, int dest_top, int dest_width, int dest_height, uint32_t flags); - bool DrawDIBits(const RetainPtr<CFX_DIBSource>& pBitmap, + bool DrawDIBits(const RetainPtr<CFX_DIBBase>& pBitmap, uint32_t color, const CFX_Matrix* pMatrix, uint32_t flags); diff --git a/core/fxge/win32/fx_win32_device.cpp b/core/fxge/win32/fx_win32_device.cpp index ed03101ecd..c8f049704f 100644 --- a/core/fxge/win32/fx_win32_device.cpp +++ b/core/fxge/win32/fx_win32_device.cpp @@ -1187,7 +1187,7 @@ bool CGdiDisplayDriver::GetDIBits(const RetainPtr<CFX_DIBitmap>& pBitmap, return ret; } -bool CGdiDisplayDriver::SetDIBits(const RetainPtr<CFX_DIBSource>& pSource, +bool CGdiDisplayDriver::SetDIBits(const RetainPtr<CFX_DIBBase>& pSource, uint32_t color, const FX_RECT* pSrcRect, int left, @@ -1235,7 +1235,7 @@ bool CGdiDisplayDriver::SetDIBits(const RetainPtr<CFX_DIBSource>& pSource, } bool CGdiDisplayDriver::UseFoxitStretchEngine( - const RetainPtr<CFX_DIBSource>& pSource, + const RetainPtr<CFX_DIBBase>& pSource, uint32_t color, int dest_left, int dest_top, @@ -1261,7 +1261,7 @@ bool CGdiDisplayDriver::UseFoxitStretchEngine( pClipRect->top, FXDIB_BLEND_NORMAL); } -bool CGdiDisplayDriver::StretchDIBits(const RetainPtr<CFX_DIBSource>& pSource, +bool CGdiDisplayDriver::StretchDIBits(const RetainPtr<CFX_DIBBase>& pSource, uint32_t color, int dest_left, int dest_top, @@ -1328,7 +1328,7 @@ bool CGdiDisplayDriver::StretchDIBits(const RetainPtr<CFX_DIBSource>& pSource, dest_height, flags); } -bool CGdiDisplayDriver::StartDIBits(const RetainPtr<CFX_DIBSource>& pBitmap, +bool CGdiDisplayDriver::StartDIBits(const RetainPtr<CFX_DIBBase>& pBitmap, int bitmap_alpha, uint32_t color, const CFX_Matrix* pMatrix, diff --git a/core/fxge/win32/fx_win32_print.cpp b/core/fxge/win32/fx_win32_print.cpp index 1e2b2d4e9a..83a1627087 100644 --- a/core/fxge/win32/fx_win32_print.cpp +++ b/core/fxge/win32/fx_win32_print.cpp @@ -69,7 +69,7 @@ int CGdiPrinterDriver::GetDeviceCaps(int caps_id) const { return CGdiDeviceDriver::GetDeviceCaps(caps_id); } -bool CGdiPrinterDriver::SetDIBits(const RetainPtr<CFX_DIBSource>& pSource, +bool CGdiPrinterDriver::SetDIBits(const RetainPtr<CFX_DIBBase>& pSource, uint32_t color, const FX_RECT* pSrcRect, int left, @@ -96,7 +96,7 @@ bool CGdiPrinterDriver::SetDIBits(const RetainPtr<CFX_DIBSource>& pSource, return GDI_SetDIBits(pBitmap, pSrcRect, left, top); } -bool CGdiPrinterDriver::StretchDIBits(const RetainPtr<CFX_DIBSource>& pSource, +bool CGdiPrinterDriver::StretchDIBits(const RetainPtr<CFX_DIBBase>& pSource, uint32_t color, int dest_left, int dest_top, @@ -159,7 +159,7 @@ bool CGdiPrinterDriver::StretchDIBits(const RetainPtr<CFX_DIBSource>& pSource, dest_height, flags); } -bool CGdiPrinterDriver::StartDIBits(const RetainPtr<CFX_DIBSource>& pSource, +bool CGdiPrinterDriver::StartDIBits(const RetainPtr<CFX_DIBBase>& pSource, int bitmap_alpha, uint32_t color, const CFX_Matrix* pMatrix, @@ -454,7 +454,7 @@ bool CPSPrinterDriver::GetClipBox(FX_RECT* pRect) { return true; } -bool CPSPrinterDriver::SetDIBits(const RetainPtr<CFX_DIBSource>& pBitmap, +bool CPSPrinterDriver::SetDIBits(const RetainPtr<CFX_DIBBase>& pBitmap, uint32_t color, const FX_RECT* pSrcRect, int left, @@ -465,7 +465,7 @@ bool CPSPrinterDriver::SetDIBits(const RetainPtr<CFX_DIBSource>& pBitmap, return m_PSRenderer.SetDIBits(pBitmap, color, left, top); } -bool CPSPrinterDriver::StretchDIBits(const RetainPtr<CFX_DIBSource>& pBitmap, +bool CPSPrinterDriver::StretchDIBits(const RetainPtr<CFX_DIBBase>& pBitmap, uint32_t color, int dest_left, int dest_top, @@ -480,7 +480,7 @@ bool CPSPrinterDriver::StretchDIBits(const RetainPtr<CFX_DIBSource>& pBitmap, dest_width, dest_height, flags); } -bool CPSPrinterDriver::StartDIBits(const RetainPtr<CFX_DIBSource>& pBitmap, +bool CPSPrinterDriver::StartDIBits(const RetainPtr<CFX_DIBBase>& pBitmap, int bitmap_alpha, uint32_t color, const CFX_Matrix* pMatrix, @@ -565,7 +565,7 @@ bool CTextOnlyPrinterDriver::DrawPath(const CFX_PathData* pPathData, return false; } -bool CTextOnlyPrinterDriver::SetDIBits(const RetainPtr<CFX_DIBSource>& pBitmap, +bool CTextOnlyPrinterDriver::SetDIBits(const RetainPtr<CFX_DIBBase>& pBitmap, uint32_t color, const FX_RECT* pSrcRect, int left, @@ -583,7 +583,7 @@ bool CTextOnlyPrinterDriver::GetClipBox(FX_RECT* pRect) { } bool CTextOnlyPrinterDriver::StretchDIBits( - const RetainPtr<CFX_DIBSource>& pBitmap, + const RetainPtr<CFX_DIBBase>& pBitmap, uint32_t color, int dest_left, int dest_top, @@ -596,7 +596,7 @@ bool CTextOnlyPrinterDriver::StretchDIBits( } bool CTextOnlyPrinterDriver::StartDIBits( - const RetainPtr<CFX_DIBSource>& pBitmap, + const RetainPtr<CFX_DIBBase>& pBitmap, int bitmap_alpha, uint32_t color, const CFX_Matrix* pMatrix, diff --git a/core/fxge/win32/win32_int.h b/core/fxge/win32/win32_int.h index fe0e7f3ba9..76a1d8800e 100644 --- a/core/fxge/win32/win32_int.h +++ b/core/fxge/win32/win32_int.h @@ -197,13 +197,13 @@ class CGdiDisplayDriver : public CGdiDeviceDriver { bool GetDIBits(const RetainPtr<CFX_DIBitmap>& pBitmap, int left, int top) override; - bool SetDIBits(const RetainPtr<CFX_DIBSource>& pBitmap, + bool SetDIBits(const RetainPtr<CFX_DIBBase>& pBitmap, uint32_t color, const FX_RECT* pSrcRect, int left, int top, int blend_type) override; - bool StretchDIBits(const RetainPtr<CFX_DIBSource>& pBitmap, + bool StretchDIBits(const RetainPtr<CFX_DIBBase>& pBitmap, uint32_t color, int dest_left, int dest_top, @@ -212,14 +212,14 @@ class CGdiDisplayDriver : public CGdiDeviceDriver { const FX_RECT* pClipRect, uint32_t flags, int blend_type) override; - bool StartDIBits(const RetainPtr<CFX_DIBSource>& pBitmap, + bool StartDIBits(const RetainPtr<CFX_DIBBase>& pBitmap, int bitmap_alpha, uint32_t color, const CFX_Matrix* pMatrix, uint32_t render_flags, std::unique_ptr<CFX_ImageRenderer>* handle, int blend_type) override; - bool UseFoxitStretchEngine(const RetainPtr<CFX_DIBSource>& pSource, + bool UseFoxitStretchEngine(const RetainPtr<CFX_DIBBase>& pSource, uint32_t color, int dest_left, int dest_top, @@ -236,13 +236,13 @@ class CGdiPrinterDriver : public CGdiDeviceDriver { protected: int GetDeviceCaps(int caps_id) const override; - bool SetDIBits(const RetainPtr<CFX_DIBSource>& pBitmap, + bool SetDIBits(const RetainPtr<CFX_DIBBase>& pBitmap, uint32_t color, const FX_RECT* pSrcRect, int left, int top, int blend_type) override; - bool StretchDIBits(const RetainPtr<CFX_DIBSource>& pBitmap, + bool StretchDIBits(const RetainPtr<CFX_DIBBase>& pBitmap, uint32_t color, int dest_left, int dest_top, @@ -251,7 +251,7 @@ class CGdiPrinterDriver : public CGdiDeviceDriver { const FX_RECT* pClipRect, uint32_t flags, int blend_type) override; - bool StartDIBits(const RetainPtr<CFX_DIBSource>& pBitmap, + bool StartDIBits(const RetainPtr<CFX_DIBBase>& pBitmap, int bitmap_alpha, uint32_t color, const CFX_Matrix* pMatrix, @@ -295,13 +295,13 @@ class CPSPrinterDriver : public RenderDeviceDriverIface { int fill_mode, int blend_type) override; bool GetClipBox(FX_RECT* pRect) override; - bool SetDIBits(const RetainPtr<CFX_DIBSource>& pBitmap, + bool SetDIBits(const RetainPtr<CFX_DIBBase>& pBitmap, uint32_t color, const FX_RECT* pSrcRect, int left, int top, int blend_type) override; - bool StretchDIBits(const RetainPtr<CFX_DIBSource>& pBitmap, + bool StretchDIBits(const RetainPtr<CFX_DIBBase>& pBitmap, uint32_t color, int dest_left, int dest_top, @@ -310,7 +310,7 @@ class CPSPrinterDriver : public RenderDeviceDriverIface { const FX_RECT* pClipRect, uint32_t flags, int blend_type) override; - bool StartDIBits(const RetainPtr<CFX_DIBSource>& pBitmap, + bool StartDIBits(const RetainPtr<CFX_DIBBase>& pBitmap, int bitmap_alpha, uint32_t color, const CFX_Matrix* pMatrix, @@ -358,13 +358,13 @@ class CTextOnlyPrinterDriver : public RenderDeviceDriverIface { int fill_mode, int blend_type) override; bool GetClipBox(FX_RECT* pRect) override; - bool SetDIBits(const RetainPtr<CFX_DIBSource>& pBitmap, + bool SetDIBits(const RetainPtr<CFX_DIBBase>& pBitmap, uint32_t color, const FX_RECT* pSrcRect, int left, int top, int blend_type) override; - bool StretchDIBits(const RetainPtr<CFX_DIBSource>& pBitmap, + bool StretchDIBits(const RetainPtr<CFX_DIBBase>& pBitmap, uint32_t color, int dest_left, int dest_top, @@ -373,7 +373,7 @@ class CTextOnlyPrinterDriver : public RenderDeviceDriverIface { const FX_RECT* pClipRect, uint32_t flags, int blend_type) override; - bool StartDIBits(const RetainPtr<CFX_DIBSource>& pBitmap, + bool StartDIBits(const RetainPtr<CFX_DIBBase>& pBitmap, int bitmap_alpha, uint32_t color, const CFX_Matrix* pMatrix, |