From 615bb96eb26570fd87004e2fa6f42eca0dbf79cd Mon Sep 17 00:00:00 2001 From: Nicolas Pena Date: Mon, 8 May 2017 15:08:12 -0400 Subject: Remove default params in CFX_DIBSource Change-Id: I9306afed2747e3b0054adeea1d39916cac47f5c5 Reviewed-on: https://pdfium-review.googlesource.com/5091 Commit-Queue: dsinclair Reviewed-by: dsinclair --- core/fpdfapi/font/cpdf_type3char.cpp | 2 +- core/fpdfapi/render/cpdf_imagecacheentry.cpp | 6 ++-- core/fpdfapi/render/cpdf_imagerenderer.cpp | 8 ++--- core/fpdfapi/render/cpdf_renderstatus.cpp | 2 +- core/fpdfapi/render/cpdf_type3cache.cpp | 10 +++--- core/fxcodec/codec/ccodec_tiffmodule.cpp | 2 +- core/fxcodec/codec/fx_codec_progress.cpp | 3 +- core/fxge/dib/cfx_dibextractor.cpp | 4 +-- core/fxge/dib/cfx_dibitmap.cpp | 8 ++--- core/fxge/dib/cfx_dibsource.cpp | 46 ++++++++++------------------ core/fxge/dib/cfx_dibsource.h | 32 +++++++------------ core/fxge/dib/cfx_imagestretcher.cpp | 8 ++--- core/fxge/skia/fx_skia_device.cpp | 10 +++--- core/fxge/win32/fx_win32_device.cpp | 2 +- core/fxge/win32/fx_win32_dib.cpp | 10 +++--- core/fxge/win32/fx_win32_gdipext.cpp | 5 ++- xfa/fxgraphics/cfx_graphics.cpp | 7 +++-- 17 files changed, 72 insertions(+), 93 deletions(-) diff --git a/core/fpdfapi/font/cpdf_type3char.cpp b/core/fpdfapi/font/cpdf_type3char.cpp index 8ac062568d..d9794c27d3 100644 --- a/core/fpdfapi/font/cpdf_type3char.cpp +++ b/core/fpdfapi/font/cpdf_type3char.cpp @@ -34,7 +34,7 @@ bool CPDF_Type3Char::LoadBitmap(CPDF_RenderContext* pContext) { CFX_RetainPtr pSource = pPageObj->AsImage()->GetImage()->LoadDIBSource(); if (pSource) - m_pBitmap = pSource->Clone(); + m_pBitmap = pSource->Clone(nullptr); m_pForm.reset(); return true; } diff --git a/core/fpdfapi/render/cpdf_imagecacheentry.cpp b/core/fpdfapi/render/cpdf_imagecacheentry.cpp index 751b3eb4b4..392eaba914 100644 --- a/core/fpdfapi/render/cpdf_imagecacheentry.cpp +++ b/core/fpdfapi/render/cpdf_imagecacheentry.cpp @@ -34,7 +34,7 @@ CPDF_ImageCacheEntry::~CPDF_ImageCacheEntry() {} void CPDF_ImageCacheEntry::Reset(const CFX_RetainPtr& pBitmap) { m_pCachedBitmap.Reset(); if (pBitmap) - m_pCachedBitmap = pBitmap->Clone(); + m_pCachedBitmap = pBitmap->Clone(nullptr); CalcSize(); } @@ -94,13 +94,13 @@ void CPDF_ImageCacheEntry::ContinueGetCachedBitmap() { m_dwTimeCount = pPageRenderCache->GetTimeCount(); if (m_pCurBitmap->GetPitch() * m_pCurBitmap->GetHeight() < FPDF_HUGE_IMAGE_SIZE) { - m_pCachedBitmap = m_pCurBitmap->Clone(); + m_pCachedBitmap = m_pCurBitmap->Clone(nullptr); m_pCurBitmap.Reset(); } else { m_pCachedBitmap = m_pCurBitmap; } if (m_pCurMask) { - m_pCachedMask = m_pCurMask->Clone(); + m_pCachedMask = m_pCurMask->Clone(nullptr); m_pCurMask.Reset(); } m_pCurBitmap = m_pCachedBitmap; diff --git a/core/fpdfapi/render/cpdf_imagerenderer.cpp b/core/fpdfapi/render/cpdf_imagerenderer.cpp index b4cc36f6c3..8a963d2be9 100644 --- a/core/fpdfapi/render/cpdf_imagerenderer.cpp +++ b/core/fpdfapi/render/cpdf_imagerenderer.cpp @@ -96,7 +96,7 @@ bool CPDF_ImageRenderer::StartRenderDIBSource() { m_pImageObject->m_GeneralState.GetTransferFunc()->TranslateImage( m_Loader.m_pBitmap); if (m_Loader.m_bCached && m_Loader.m_pMask) - m_Loader.m_pMask = m_Loader.m_pMask->Clone(); + m_Loader.m_pMask = m_Loader.m_pMask->Clone(nullptr); m_Loader.m_bCached = false; } } @@ -112,7 +112,7 @@ bool CPDF_ImageRenderer::StartRenderDIBSource() { } m_FillArgb = m_pRenderStatus->GetFillArgb(m_pImageObject); } else if (m_pRenderStatus->m_Options.m_ColorMode == RENDER_COLOR_GRAY) { - m_pClone = m_pDIBSource->Clone(); + m_pClone = m_pDIBSource->Clone(nullptr); m_pClone->ConvertColorScale(m_pRenderStatus->m_Options.m_BackColor, m_pRenderStatus->m_Options.m_ForeColor); m_pDIBSource = m_pClone; @@ -403,7 +403,7 @@ bool CPDF_ImageRenderer::StartDIBSource() { } } #ifdef _SKIA_SUPPORT_ - CFX_RetainPtr premultiplied = m_pDIBSource->Clone(); + CFX_RetainPtr premultiplied = m_pDIBSource->Clone(nullptr); if (m_pDIBSource->HasAlpha()) CFX_SkiaDeviceDriver::PreMultiply(premultiplied); if (m_pRenderStatus->m_pDevice->StartDIBitsWithBlend( @@ -511,7 +511,7 @@ bool CPDF_ImageRenderer::StartBitmapAlpha() { int left; int top; CFX_RetainPtr pTransformed = - pAlphaMask->TransformTo(&m_ImageMatrix, left, top); + pAlphaMask->TransformTo(&m_ImageMatrix, &left, &top); if (!pTransformed) return true; diff --git a/core/fpdfapi/render/cpdf_renderstatus.cpp b/core/fpdfapi/render/cpdf_renderstatus.cpp index 0b304747d4..0a288c4b00 100644 --- a/core/fpdfapi/render/cpdf_renderstatus.cpp +++ b/core/fpdfapi/render/cpdf_renderstatus.cpp @@ -2285,7 +2285,7 @@ void CPDF_RenderStatus::DrawTilingPattern(CPDF_TilingPattern* pPattern, CFX_RetainPtr pEnlargedBitmap = DrawPatternBitmap(m_pContext->GetDocument(), m_pContext->GetPageCache(), pPattern, pObj2Device, 8, 8, m_Options.m_Flags); - pPatternBitmap = pEnlargedBitmap->StretchTo(width, height); + pPatternBitmap = pEnlargedBitmap->StretchTo(width, height, 0, nullptr); } else { pPatternBitmap = DrawPatternBitmap( m_pContext->GetDocument(), m_pContext->GetPageCache(), pPattern, diff --git a/core/fpdfapi/render/cpdf_type3cache.cpp b/core/fpdfapi/render/cpdf_type3cache.cpp index 699b24f15c..f113e7a862 100644 --- a/core/fpdfapi/render/cpdf_type3cache.cpp +++ b/core/fpdfapi/render/cpdf_type3cache.cpp @@ -146,9 +146,11 @@ std::unique_ptr CPDF_Type3Cache::RenderGlyph( } pSize->AdjustBlue(top_y, bottom_y, top_line, bottom_line); pResBitmap = pBitmap->StretchTo( - (int)(FXSYS_round(image_matrix.a) * retinaScaleX), - (int)((bFlipped ? top_line - bottom_line : bottom_line - top_line) * - retinaScaleY)); + static_cast(FXSYS_round(image_matrix.a) * retinaScaleX), + static_cast( + (bFlipped ? top_line - bottom_line : bottom_line - top_line) * + retinaScaleY), + 0, nullptr); top = top_line; if (image_matrix.a < 0) { image_matrix.Scale(retinaScaleX, retinaScaleY); @@ -160,7 +162,7 @@ std::unique_ptr CPDF_Type3Cache::RenderGlyph( } if (!pResBitmap) { image_matrix.Scale(retinaScaleX, retinaScaleY); - pResBitmap = pBitmap->TransformTo(&image_matrix, left, top); + pResBitmap = pBitmap->TransformTo(&image_matrix, &left, &top); } if (!pResBitmap) return nullptr; diff --git a/core/fxcodec/codec/ccodec_tiffmodule.cpp b/core/fxcodec/codec/ccodec_tiffmodule.cpp index 3c24c33286..09eddf6076 100644 --- a/core/fxcodec/codec/ccodec_tiffmodule.cpp +++ b/core/fxcodec/codec/ccodec_tiffmodule.cpp @@ -344,7 +344,7 @@ void CCodec_TiffContext::SetPalette( uint32_t b = blue_orig[index] & 0xFF; uint32_t color = (uint32_t)b | ((uint32_t)g << 8) | ((uint32_t)r << 16) | (((uint32)0xffL) << 24); - pDIBitmap->SetPaletteEntry(index, color); + pDIBitmap->SetPaletteArgb(index, color); } } diff --git a/core/fxcodec/codec/fx_codec_progress.cpp b/core/fxcodec/codec/fx_codec_progress.cpp index e26431ffab..56c9ed9534 100644 --- a/core/fxcodec/codec/fx_codec_progress.cpp +++ b/core/fxcodec/codec/fx_codec_progress.cpp @@ -2299,7 +2299,8 @@ FXCODEC_STATUS CCodec_ProgressiveDecoder::ContinueDecode() { return m_status; } CFX_RetainPtr pStrechBitmap = pFormatBitmap->StretchTo( - m_sizeX, m_sizeY, m_bInterpol ? FXDIB_INTERPOL : FXDIB_DOWNSAMPLE); + m_sizeX, m_sizeY, m_bInterpol ? FXDIB_INTERPOL : FXDIB_DOWNSAMPLE, + nullptr); pFormatBitmap = nullptr; if (!pStrechBitmap) { m_pDeviceBitmap = nullptr; diff --git a/core/fxge/dib/cfx_dibextractor.cpp b/core/fxge/dib/cfx_dibextractor.cpp index 8de69e2e3b..325454a580 100644 --- a/core/fxge/dib/cfx_dibextractor.cpp +++ b/core/fxge/dib/cfx_dibextractor.cpp @@ -10,7 +10,7 @@ CFX_DIBExtractor::CFX_DIBExtractor(const CFX_RetainPtr& pSrc) { if (!pSrc->GetBuffer()) { - m_pBitmap = pSrc->Clone(); + m_pBitmap = pSrc->Clone(nullptr); return; } CFX_RetainPtr pOldSrc(pSrc); @@ -21,7 +21,7 @@ CFX_DIBExtractor::CFX_DIBExtractor(const CFX_RetainPtr& pSrc) { return; } m_pBitmap->SetPalette(pOldSrc->GetPalette()); - m_pBitmap->SetAlphaMask(pOldSrc->m_pAlphaMask); + m_pBitmap->SetAlphaMask(pOldSrc->m_pAlphaMask, nullptr); } CFX_DIBExtractor::~CFX_DIBExtractor() {} diff --git a/core/fxge/dib/cfx_dibitmap.cpp b/core/fxge/dib/cfx_dibitmap.cpp index 6f46e1d57e..4cba073321 100644 --- a/core/fxge/dib/cfx_dibitmap.cpp +++ b/core/fxge/dib/cfx_dibitmap.cpp @@ -94,7 +94,7 @@ bool CFX_DIBitmap::Copy(const CFX_RetainPtr& pSrc) { return false; SetPalette(pSrc->GetPalette()); - SetAlphaMask(pSrc->m_pAlphaMask); + SetAlphaMask(pSrc->m_pAlphaMask, nullptr); for (int row = 0; row < pSrc->GetHeight(); row++) memcpy(m_pBuffer.Get() + row * m_Pitch, pSrc->GetScanline(row), m_Pitch); return true; @@ -317,7 +317,7 @@ bool CFX_DIBitmap::LoadChannel(FXDIB_Channel destChannel, if (pSrcClone->GetWidth() != m_Width || pSrcClone->GetHeight() != m_Height) { if (pAlphaMask) { - pAlphaMask = pAlphaMask->StretchTo(m_Width, m_Height); + pAlphaMask = pAlphaMask->StretchTo(m_Width, m_Height, 0, nullptr); if (!pAlphaMask) return false; } @@ -327,7 +327,7 @@ bool CFX_DIBitmap::LoadChannel(FXDIB_Channel destChannel, } else if (pSrcClone->GetWidth() != m_Width || pSrcClone->GetHeight() != m_Height) { CFX_RetainPtr pSrcMatched = - pSrcClone->StretchTo(m_Width, m_Height); + pSrcClone->StretchTo(m_Width, m_Height, 0, nullptr); if (!pSrcMatched) return false; @@ -426,7 +426,7 @@ bool CFX_DIBitmap::MultiplyAlpha( CFX_RetainPtr pSrcClone = pSrcBitmap.As(); if (pSrcBitmap->GetWidth() != m_Width || pSrcBitmap->GetHeight() != m_Height) { - pSrcClone = pSrcBitmap->StretchTo(m_Width, m_Height); + pSrcClone = pSrcBitmap->StretchTo(m_Width, m_Height, 0, nullptr); if (!pSrcClone) return false; } diff --git a/core/fxge/dib/cfx_dibsource.cpp b/core/fxge/dib/cfx_dibsource.cpp index 63fcc5806a..547f01690c 100644 --- a/core/fxge/dib/cfx_dibsource.cpp +++ b/core/fxge/dib/cfx_dibsource.cpp @@ -707,24 +707,24 @@ bool CFX_DIBSource::BuildAlphaMask() { return true; } -uint32_t CFX_DIBSource::GetPaletteEntry(int index) const { +uint32_t CFX_DIBSource::GetPaletteArgb(int index) const { ASSERT((GetBPP() == 1 || GetBPP() == 8) && !IsAlphaMask()); - if (m_pPalette) { + if (m_pPalette) return m_pPalette.get()[index]; - } + if (IsCmykImage()) { - if (GetBPP() == 1) { + if (GetBPP() == 1) return index ? 0 : 0xff; - } + return 0xff - index; } - if (GetBPP() == 1) { + if (GetBPP() == 1) return index ? 0xffffffff : 0xff000000; - } + return index * 0x10101 | 0xff000000; } -void CFX_DIBSource::SetPaletteEntry(int index, uint32_t color) { +void CFX_DIBSource::SetPaletteArgb(int index, uint32_t color) { ASSERT((GetBPP() == 1 || GetBPP() == 8) && !IsAlphaMask()); if (!m_pPalette) { BuildPalette(); @@ -825,15 +825,9 @@ void CFX_DIBSource::GetPalette(uint32_t* pal, int alpha) const { } } -CFX_RetainPtr CFX_DIBSource::CloneAlphaMask( - const FX_RECT* pClip) const { +CFX_RetainPtr CFX_DIBSource::CloneAlphaMask() const { ASSERT(GetFormat() == FXDIB_Argb); FX_RECT rect(0, 0, m_Width, m_Height); - if (pClip) { - rect.Intersect(*pClip); - if (rect.IsEmpty()) - return nullptr; - } auto pMask = pdfium::MakeRetain(); if (!pMask->Create(rect.Width(), rect.Height(), FXDIB_8bppMask)) return nullptr; @@ -975,7 +969,7 @@ CFX_RetainPtr CFX_DIBSource::CloneConvert( ret = pSrcAlpha ? pClone->LoadChannel(FXDIB_Alpha, pSrcAlpha, FXDIB_Alpha) : pClone->LoadChannel(FXDIB_Alpha, 0xff); } else { - ret = pClone->SetAlphaMask(pSrcAlpha); + ret = pClone->SetAlphaMask(pSrcAlpha, nullptr); } } if (!ret) @@ -993,13 +987,9 @@ CFX_RetainPtr CFX_DIBSource::CloneConvert( return pClone; } -CFX_RetainPtr CFX_DIBSource::SwapXY( - bool bXFlip, - bool bYFlip, - const FX_RECT* pDestClip) const { +CFX_RetainPtr CFX_DIBSource::SwapXY(bool bXFlip, + bool bYFlip) const { FX_RECT dest_clip(0, 0, m_Height, m_Width); - if (pDestClip) - dest_clip.Intersect(*pDestClip); if (dest_clip.IsEmpty()) return nullptr; @@ -1094,16 +1084,14 @@ CFX_RetainPtr CFX_DIBSource::SwapXY( CFX_RetainPtr CFX_DIBSource::TransformTo( const CFX_Matrix* pDestMatrix, - int& result_left, - int& result_top, - uint32_t flags, - const FX_RECT* pDestClip) { + int* result_left, + int* result_top) { CFX_RetainPtr holder(this); - CFX_ImageTransformer transformer(holder, pDestMatrix, flags, pDestClip); + CFX_ImageTransformer transformer(holder, pDestMatrix, 0, nullptr); transformer.Start(); transformer.Continue(nullptr); - result_left = transformer.result().left; - result_top = transformer.result().top; + *result_left = transformer.result().left; + *result_top = transformer.result().top; return transformer.DetachBitmap(); } diff --git a/core/fxge/dib/cfx_dibsource.h b/core/fxge/dib/cfx_dibsource.h index 97af196677..798e092d16 100644 --- a/core/fxge/dib/cfx_dibsource.h +++ b/core/fxge/dib/cfx_dibsource.h @@ -65,39 +65,29 @@ class CFX_DIBSource : public CFX_Retainable { return IsAlphaMask() ? 0 : (m_bpp == 1 ? 2 : (m_bpp == 8 ? 256 : 0)); } - uint32_t GetPaletteEntry(int index) const; - - void SetPaletteEntry(int index, uint32_t color); - uint32_t GetPaletteArgb(int index) const { return GetPaletteEntry(index); } - void SetPaletteArgb(int index, uint32_t color) { - SetPaletteEntry(index, color); - } + uint32_t GetPaletteArgb(int index) const; + void SetPaletteArgb(int index, uint32_t color); // Copies into internally-owned palette. void SetPalette(const uint32_t* pSrcPal); - CFX_RetainPtr Clone(const FX_RECT* pClip = nullptr) const; + CFX_RetainPtr Clone(const FX_RECT* pClip) const; CFX_RetainPtr CloneConvert(FXDIB_Format format); CFX_RetainPtr StretchTo(int dest_width, int dest_height, - uint32_t flags = 0, - const FX_RECT* pClip = nullptr); + uint32_t flags, + const FX_RECT* pClip); CFX_RetainPtr TransformTo(const CFX_Matrix* pMatrix, - int& left, - int& top, - uint32_t flags = 0, - const FX_RECT* pClip = nullptr); - CFX_RetainPtr SwapXY(bool bXFlip, - bool bYFlip, - const FX_RECT* pClip = nullptr) const; + int* left, + int* top); + CFX_RetainPtr SwapXY(bool bXFlip, bool bYFlip) const; CFX_RetainPtr FlipImage(bool bXFlip, bool bYFlip) const; - CFX_RetainPtr CloneAlphaMask( - const FX_RECT* pClip = nullptr) const; + CFX_RetainPtr CloneAlphaMask() const; // Copies into internally-owned mask. bool SetAlphaMask(const CFX_RetainPtr& pAlphaMask, - const FX_RECT* pClip = nullptr); + const FX_RECT* pClip); void GetOverlapRect(int& dest_left, int& dest_top, @@ -110,7 +100,7 @@ class CFX_DIBSource : public CFX_Retainable { const CFX_ClipRgn* pClipRgn); #if defined _SKIA_SUPPORT_ || defined _SKIA_SUPPORT_PATHS_ - void DebugVerifyBitmapIsPreMultiplied(void* buffer = nullptr) const; + void DebugVerifyBitmapIsPreMultiplied(void* buffer) const; #endif CFX_RetainPtr m_pAlphaMask; diff --git a/core/fxge/dib/cfx_imagestretcher.cpp b/core/fxge/dib/cfx_imagestretcher.cpp index d633318feb..809b72d1fb 100644 --- a/core/fxge/dib/cfx_imagestretcher.cpp +++ b/core/fxge/dib/cfx_imagestretcher.cpp @@ -73,12 +73,12 @@ bool CFX_ImageStretcher::Start() { int r0; int g0; int b0; - std::tie(a0, r0, g0, b0) = ArgbDecode(m_pSource->GetPaletteEntry(0)); + std::tie(a0, r0, g0, b0) = ArgbDecode(m_pSource->GetPaletteArgb(0)); int a1; int r1; int g1; int b1; - std::tie(a1, r1, g1, b1) = ArgbDecode(m_pSource->GetPaletteEntry(1)); + std::tie(a1, r1, g1, b1) = ArgbDecode(m_pSource->GetPaletteArgb(1)); for (int i = 0; i < 256; ++i) { int a = a0 + (a1 - a0) * i / 255; int r = r0 + (r1 - r0) * i / 255; @@ -97,12 +97,12 @@ bool CFX_ImageStretcher::Start() { int m0; int y0; int k0; - std::tie(c0, m0, y0, k0) = CmykDecode(m_pSource->GetPaletteEntry(0)); + std::tie(c0, m0, y0, k0) = CmykDecode(m_pSource->GetPaletteArgb(0)); int c1; int m1; int y1; int k1; - std::tie(c1, m1, y1, k1) = CmykDecode(m_pSource->GetPaletteEntry(1)); + std::tie(c1, m1, y1, k1) = CmykDecode(m_pSource->GetPaletteArgb(1)); for (int i = 0; i < 256; ++i) { int c = c0 + (c1 - c0) * i / 255; int m = m0 + (m1 - m0) * i / 255; diff --git a/core/fxge/skia/fx_skia_device.cpp b/core/fxge/skia/fx_skia_device.cpp index 46e284d8aa..3ca022b706 100644 --- a/core/fxge/skia/fx_skia_device.cpp +++ b/core/fxge/skia/fx_skia_device.cpp @@ -262,13 +262,13 @@ static void DebugValidate(const CFX_RetainPtr& bitmap, if (bitmap) { SkASSERT(bitmap->GetBPP() == 8 || bitmap->GetBPP() == 32); if (bitmap->GetBPP() == 32) { - bitmap->DebugVerifyBitmapIsPreMultiplied(); + bitmap->DebugVerifyBitmapIsPreMultiplied(nullptr); } } if (device) { SkASSERT(device->GetBPP() == 8 || device->GetBPP() == 32); if (device->GetBPP() == 32) { - device->DebugVerifyBitmapIsPreMultiplied(); + device->DebugVerifyBitmapIsPreMultiplied(nullptr); } } } @@ -2224,7 +2224,7 @@ void CFX_DIBitmap::PreMultiply() { SkImageInfo::Make(width, height, kN32_SkColorType, kPremul_SkAlphaType); SkPixmap premultiplied(premultipliedInfo, buffer, rowBytes); unpremultiplied.readPixels(premultiplied); - this->DebugVerifyBitmapIsPreMultiplied(); + this->DebugVerifyBitmapIsPreMultiplied(nullptr); } #ifdef _SKIA_SUPPORT_PATHS_ @@ -2238,7 +2238,7 @@ void CFX_DIBitmap::UnPreMultiply() { m_nFormat = Format::kUnPreMultiplied; if (priorFormat != Format::kPreMultiplied) return; - this->DebugVerifyBitmapIsPreMultiplied(); + this->DebugVerifyBitmapIsPreMultiplied(nullptr); int height = this->GetHeight(); int width = this->GetWidth(); int rowBytes = this->GetPitch(); @@ -2327,7 +2327,7 @@ void CFX_SkiaDeviceDriver::Dump() const { #ifdef _SKIA_SUPPORT_ void CFX_SkiaDeviceDriver::DebugVerifyBitmapIsPreMultiplied() const { if (m_pOriDevice) - m_pOriDevice->DebugVerifyBitmapIsPreMultiplied(); + m_pOriDevice->DebugVerifyBitmapIsPreMultiplied(nullptr); } #endif // _SKIA_SUPPORT_ diff --git a/core/fxge/win32/fx_win32_device.cpp b/core/fxge/win32/fx_win32_device.cpp index c67ed526d3..6e960f95b4 100644 --- a/core/fxge/win32/fx_win32_device.cpp +++ b/core/fxge/win32/fx_win32_device.cpp @@ -852,7 +852,7 @@ bool CGdiDeviceDriver::GDI_StretchDIBits( if (m_DeviceClass == FXDC_PRINTER && ((int64_t)pBitmap->GetWidth() * pBitmap->GetHeight() > (int64_t)abs(dest_width) * abs(dest_height))) { - pToStrechBitmap = pBitmap->StretchTo(dest_width, dest_height); + pToStrechBitmap = pBitmap->StretchTo(dest_width, dest_height, 0, nullptr); } CFX_ByteString toStrechBitmapInfo = CFX_WindowsDIB::GetBitmapInfo(pToStrechBitmap); diff --git a/core/fxge/win32/fx_win32_dib.cpp b/core/fxge/win32/fx_win32_dib.cpp index 677fb3ab80..d1e5688ee1 100644 --- a/core/fxge/win32/fx_win32_dib.cpp +++ b/core/fxge/win32/fx_win32_dib.cpp @@ -86,13 +86,11 @@ CFX_RetainPtr _FX_WindowsDIB_LoadFromBuf(BITMAPINFO* pbmi, temp_buf = nullptr; } if (pbmi->bmiHeader.biBitCount == 1) { - for (int i = 0; i < 2; i++) { - pBitmap->SetPaletteEntry(i, ((uint32_t*)pbmi->bmiColors)[i] | 0xff000000); - } + for (int i = 0; i < 2; i++) + pBitmap->SetPaletteArgb(i, ((uint32_t*)pbmi->bmiColors)[i] | 0xff000000); } else if (pbmi->bmiHeader.biBitCount == 8) { - for (int i = 0; i < 256; i++) { - pBitmap->SetPaletteEntry(i, ((uint32_t*)pbmi->bmiColors)[i] | 0xff000000); - } + for (int i = 0; i < 256; i++) + pBitmap->SetPaletteArgb(i, ((uint32_t*)pbmi->bmiColors)[i] | 0xff000000); } return pBitmap; } diff --git a/core/fxge/win32/fx_win32_gdipext.cpp b/core/fxge/win32/fx_win32_gdipext.cpp index 87172ffff8..d718dc8abf 100644 --- a/core/fxge/win32/fx_win32_gdipext.cpp +++ b/core/fxge/win32/fx_win32_gdipext.cpp @@ -647,9 +647,8 @@ static void OutputImage(GpGraphics* pGraphics, UINT pal[258]; pal[0] = 0; pal[1] = 256; - for (int i = 0; i < 256; i++) { - pal[i + 2] = pBitmap->GetPaletteEntry(i); - } + for (int i = 0; i < 256; i++) + pal[i + 2] = pBitmap->GetPaletteArgb(i); CallFunc(GdipSetImagePalette)(bitmap, (ColorPalette*)pal); break; } diff --git a/xfa/fxgraphics/cfx_graphics.cpp b/xfa/fxgraphics/cfx_graphics.cpp index b7595eea8d..c02c30676b 100644 --- a/xfa/fxgraphics/cfx_graphics.cpp +++ b/xfa/fxgraphics/cfx_graphics.cpp @@ -328,14 +328,15 @@ void CFX_Graphics::RenderDeviceStretchImage( m1.Concat(*matrix); } CFX_RetainPtr bmp1 = - source->StretchTo((int32_t)rect.Width(), (int32_t)rect.Height()); + source->StretchTo(static_cast(rect.Width()), + static_cast(rect.Height()), 0, nullptr); CFX_Matrix m2(rect.Width(), 0.0, 0.0, rect.Height(), rect.left, rect.top); m2.Concat(m1); int32_t left; int32_t top; CFX_RetainPtr bmp2 = bmp1->FlipImage(false, true); - CFX_RetainPtr bmp3 = bmp2->TransformTo(&m2, left, top); + CFX_RetainPtr bmp3 = bmp2->TransformTo(&m2, &left, &top); CFX_RectF r = GetClipRect(); CFX_RetainPtr bitmap = m_renderDevice->GetBitmap(); bitmap->CompositeBitmap(FXSYS_round(r.left), FXSYS_round(r.top), @@ -510,7 +511,7 @@ void CFX_Graphics::SetDIBitsWithMatrix( int32_t left; int32_t top; CFX_RetainPtr bmp1 = source->FlipImage(false, true); - CFX_RetainPtr bmp2 = bmp1->TransformTo(&m, left, top); + CFX_RetainPtr bmp2 = bmp1->TransformTo(&m, &left, &top); m_renderDevice->SetDIBits(bmp2, left, top); } } -- cgit v1.2.3