summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2018-01-17 15:14:47 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-01-17 15:14:47 +0000
commit8bd669bb535895814c5eb79716ed67f67e1d76b5 (patch)
tree3834653e2d0ec45f1cd647a9809593a150705f68
parent8fc7dc6da9356e57f7318bff54e77fe567c5c6a1 (diff)
downloadpdfium-8bd669bb535895814c5eb79716ed67f67e1d76b5.tar.xz
Remove bitmap ARGB from CFX_ImageRenderer
This CL removes the fill ARGB value from CFX_ImageRenderer which is always set to 0. Change-Id: I445abd6268c14f05184988177b2fa6b80f50d41d Reviewed-on: https://pdfium-review.googlesource.com/23052 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
-rw-r--r--xfa/fxfa/cxfa_ffwidget.cpp2
-rw-r--r--xfa/fxfa/cxfa_imagerenderer.cpp27
-rw-r--r--xfa/fxfa/cxfa_imagerenderer.h3
3 files changed, 12 insertions, 20 deletions
diff --git a/xfa/fxfa/cxfa_ffwidget.cpp b/xfa/fxfa/cxfa_ffwidget.cpp
index 34965236f9..f6806f6841 100644
--- a/xfa/fxfa/cxfa_ffwidget.cpp
+++ b/xfa/fxfa/cxfa_ffwidget.cpp
@@ -1091,7 +1091,7 @@ void XFA_DrawImage(CXFA_Graphics* pGS,
CFX_Matrix(rtFit.width, 0, 0, rtFit.height, rtFit.left, rtFit.top));
mtImage.Concat(matrix);
- CXFA_ImageRenderer imageRender(pRenderDevice, pDIBitmap, 0, &mtImage,
+ CXFA_ImageRenderer imageRender(pRenderDevice, pDIBitmap, &mtImage,
FXDIB_INTERPOL);
if (!imageRender.Start()) {
return;
diff --git a/xfa/fxfa/cxfa_imagerenderer.cpp b/xfa/fxfa/cxfa_imagerenderer.cpp
index a56f4d94a6..b1a5ee7200 100644
--- a/xfa/fxfa/cxfa_imagerenderer.cpp
+++ b/xfa/fxfa/cxfa_imagerenderer.cpp
@@ -16,21 +16,18 @@
CXFA_ImageRenderer::CXFA_ImageRenderer(
CFX_RenderDevice* pDevice,
const RetainPtr<CFX_DIBSource>& pDIBSource,
- FX_ARGB bitmap_argb,
const CFX_Matrix* pImage2Device,
uint32_t flags)
: m_pDevice(pDevice),
m_ImageMatrix(*pImage2Device),
m_pDIBSource(pDIBSource),
- m_FillArgb(bitmap_argb),
m_Flags(flags) {}
CXFA_ImageRenderer::~CXFA_ImageRenderer() {}
bool CXFA_ImageRenderer::Start() {
- if (m_pDevice->StartDIBitsWithBlend(m_pDIBSource, 255, m_FillArgb,
- &m_ImageMatrix, m_Flags, &m_DeviceHandle,
- m_BlendType)) {
+ if (m_pDevice->StartDIBitsWithBlend(m_pDIBSource, 255, 0, &m_ImageMatrix,
+ m_Flags, &m_DeviceHandle, m_BlendType)) {
if (m_DeviceHandle) {
m_Status = 3;
return true;
@@ -81,7 +78,7 @@ bool CXFA_ImageRenderer::Start() {
}
if (m_pDIBSource->IsAlphaMask()) {
if (m_pDevice->StretchBitMaskWithFlags(m_pDIBSource, dest_left, dest_top,
- dest_width, dest_height, m_FillArgb,
+ dest_width, dest_height, 0,
m_Flags)) {
return false;
}
@@ -99,8 +96,8 @@ bool CXFA_ImageRenderer::Start() {
RetainPtr<CFX_DIBitmap> pStretched =
m_pDIBSource->StretchTo(dest_width, dest_height, m_Flags, &dest_clip);
if (pStretched) {
- CompositeDIBitmap(pStretched, dest_rect.left, dest_rect.top, m_FillArgb,
- m_BlendType, false);
+ CompositeDIBitmap(pStretched, dest_rect.left, dest_rect.top, m_BlendType,
+ false);
}
return false;
}
@@ -115,9 +112,8 @@ bool CXFA_ImageRenderer::Continue() {
return false;
if (pBitmap->IsAlphaMask()) {
- m_Result =
- m_pDevice->SetBitMask(pBitmap, m_pTransformer->result().left,
- m_pTransformer->result().top, m_FillArgb);
+ m_Result = m_pDevice->SetBitMask(pBitmap, m_pTransformer->result().left,
+ m_pTransformer->result().top, 0);
} else {
m_Result = m_pDevice->SetDIBitsWithBlend(
pBitmap, m_pTransformer->result().left, m_pTransformer->result().top,
@@ -135,7 +131,6 @@ void CXFA_ImageRenderer::CompositeDIBitmap(
const RetainPtr<CFX_DIBitmap>& pDIBitmap,
int left,
int top,
- FX_ARGB mask_argb,
int blend_mode,
int iTransparency) {
if (!pDIBitmap) {
@@ -148,7 +143,7 @@ void CXFA_ImageRenderer::CompositeDIBitmap(
if (m_pDevice->SetDIBits(pDIBitmap, left, top))
return;
} else {
- uint32_t fill_argb = (mask_argb);
+ uint32_t fill_argb = 0;
if (m_pDevice->SetBitMask(pDIBitmap, left, top, fill_argb))
return;
}
@@ -181,7 +176,7 @@ void CXFA_ImageRenderer::CompositeDIBitmap(
pDIBitmap, left, top, blend_mode);
else
pClone->CompositeMask(0, 0, pClone->GetWidth(), pClone->GetHeight(),
- pDIBitmap, mask_argb, left, top, blend_mode);
+ pDIBitmap, 0, left, top, blend_mode);
} else {
pClone = pDIBitmap;
}
@@ -204,8 +199,8 @@ void CXFA_ImageRenderer::CompositeDIBitmap(
if (!pCloneConvert)
return;
- CXFA_ImageRenderer imageRender(m_pDevice, pCloneConvert, m_FillArgb,
- &m_ImageMatrix, m_Flags);
+ CXFA_ImageRenderer imageRender(m_pDevice, pCloneConvert, &m_ImageMatrix,
+ m_Flags);
if (!imageRender.Start()) {
return;
}
diff --git a/xfa/fxfa/cxfa_imagerenderer.h b/xfa/fxfa/cxfa_imagerenderer.h
index 45ab32721d..ecf4f36dc3 100644
--- a/xfa/fxfa/cxfa_imagerenderer.h
+++ b/xfa/fxfa/cxfa_imagerenderer.h
@@ -23,7 +23,6 @@ class CXFA_ImageRenderer {
public:
CXFA_ImageRenderer(CFX_RenderDevice* pDevice,
const RetainPtr<CFX_DIBSource>& pDIBSource,
- FX_ARGB bitmap_argb,
const CFX_Matrix* pImage2Device,
uint32_t flags);
~CXFA_ImageRenderer();
@@ -35,7 +34,6 @@ class CXFA_ImageRenderer {
void CompositeDIBitmap(const RetainPtr<CFX_DIBitmap>& pDIBitmap,
int left,
int top,
- FX_ARGB mask_argb,
int blend_mode,
int iTransparency);
@@ -44,7 +42,6 @@ class CXFA_ImageRenderer {
CFX_Matrix m_ImageMatrix;
RetainPtr<CFX_DIBSource> m_pDIBSource;
RetainPtr<CFX_DIBitmap> m_pCloneConvert;
- FX_ARGB m_FillArgb;
uint32_t m_Flags;
std::unique_ptr<CFX_ImageTransformer> m_pTransformer;
std::unique_ptr<CFX_ImageRenderer> m_DeviceHandle;