summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/fpdfapi/font/cpdf_type3char.cpp2
-rw-r--r--core/fpdfapi/render/cpdf_imagecacheentry.cpp6
-rw-r--r--core/fpdfapi/render/cpdf_imagerenderer.cpp8
-rw-r--r--core/fpdfapi/render/cpdf_renderstatus.cpp2
-rw-r--r--core/fpdfapi/render/cpdf_type3cache.cpp10
-rw-r--r--core/fxcodec/codec/ccodec_tiffmodule.cpp2
-rw-r--r--core/fxcodec/codec/fx_codec_progress.cpp3
-rw-r--r--core/fxge/dib/cfx_dibextractor.cpp4
-rw-r--r--core/fxge/dib/cfx_dibitmap.cpp8
-rw-r--r--core/fxge/dib/cfx_dibsource.cpp46
-rw-r--r--core/fxge/dib/cfx_dibsource.h32
-rw-r--r--core/fxge/dib/cfx_imagestretcher.cpp8
-rw-r--r--core/fxge/skia/fx_skia_device.cpp10
-rw-r--r--core/fxge/win32/fx_win32_device.cpp2
-rw-r--r--core/fxge/win32/fx_win32_dib.cpp10
-rw-r--r--core/fxge/win32/fx_win32_gdipext.cpp5
16 files changed, 68 insertions, 90 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<CFX_DIBSource> 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<CFX_DIBitmap>& 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<CFX_DIBitmap> premultiplied = m_pDIBSource->Clone();
+ CFX_RetainPtr<CFX_DIBitmap> 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<CFX_DIBitmap> 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<CFX_DIBitmap> 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<CFX_GlyphBitmap> 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<int>(FXSYS_round(image_matrix.a) * retinaScaleX),
+ static_cast<int>(
+ (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<CFX_GlyphBitmap> 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<CFX_DIBitmap> 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<CFX_DIBSource>& pSrc) {
if (!pSrc->GetBuffer()) {
- m_pBitmap = pSrc->Clone();
+ m_pBitmap = pSrc->Clone(nullptr);
return;
}
CFX_RetainPtr<CFX_DIBSource> pOldSrc(pSrc);
@@ -21,7 +21,7 @@ CFX_DIBExtractor::CFX_DIBExtractor(const CFX_RetainPtr<CFX_DIBSource>& 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<CFX_DIBSource>& 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<CFX_DIBitmap> 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<CFX_DIBitmap> pSrcClone = pSrcBitmap.As<CFX_DIBitmap>();
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_DIBitmap> CFX_DIBSource::CloneAlphaMask(
- const FX_RECT* pClip) const {
+CFX_RetainPtr<CFX_DIBitmap> 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<CFX_DIBitmap>();
if (!pMask->Create(rect.Width(), rect.Height(), FXDIB_8bppMask))
return nullptr;
@@ -975,7 +969,7 @@ CFX_RetainPtr<CFX_DIBitmap> 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_DIBitmap> CFX_DIBSource::CloneConvert(
return pClone;
}
-CFX_RetainPtr<CFX_DIBitmap> CFX_DIBSource::SwapXY(
- bool bXFlip,
- bool bYFlip,
- const FX_RECT* pDestClip) const {
+CFX_RetainPtr<CFX_DIBitmap> 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_DIBitmap> CFX_DIBSource::SwapXY(
CFX_RetainPtr<CFX_DIBitmap> 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<CFX_DIBSource> 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<CFX_DIBitmap> Clone(const FX_RECT* pClip = nullptr) const;
+ CFX_RetainPtr<CFX_DIBitmap> Clone(const FX_RECT* pClip) const;
CFX_RetainPtr<CFX_DIBitmap> CloneConvert(FXDIB_Format format);
CFX_RetainPtr<CFX_DIBitmap> StretchTo(int dest_width,
int dest_height,
- uint32_t flags = 0,
- const FX_RECT* pClip = nullptr);
+ uint32_t flags,
+ const FX_RECT* pClip);
CFX_RetainPtr<CFX_DIBitmap> TransformTo(const CFX_Matrix* pMatrix,
- int& left,
- int& top,
- uint32_t flags = 0,
- const FX_RECT* pClip = nullptr);
- CFX_RetainPtr<CFX_DIBitmap> SwapXY(bool bXFlip,
- bool bYFlip,
- const FX_RECT* pClip = nullptr) const;
+ int* left,
+ int* top);
+ CFX_RetainPtr<CFX_DIBitmap> SwapXY(bool bXFlip, bool bYFlip) const;
CFX_RetainPtr<CFX_DIBitmap> FlipImage(bool bXFlip, bool bYFlip) const;
- CFX_RetainPtr<CFX_DIBitmap> CloneAlphaMask(
- const FX_RECT* pClip = nullptr) const;
+ CFX_RetainPtr<CFX_DIBitmap> CloneAlphaMask() const;
// Copies into internally-owned mask.
bool SetAlphaMask(const CFX_RetainPtr<CFX_DIBSource>& 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<CFX_DIBitmap> 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<CFX_DIBitmap>& 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<CFX_DIBitmap> _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;
}