summaryrefslogtreecommitdiff
path: root/core/fpdfapi
diff options
context:
space:
mode:
Diffstat (limited to 'core/fpdfapi')
-rw-r--r--core/fpdfapi/fpdf_render/fpdf_render.cpp8
-rw-r--r--core/fpdfapi/fpdf_render/fpdf_render_image.cpp25
-rw-r--r--core/fpdfapi/fpdf_render/fpdf_render_text.cpp12
3 files changed, 25 insertions, 20 deletions
diff --git a/core/fpdfapi/fpdf_render/fpdf_render.cpp b/core/fpdfapi/fpdf_render/fpdf_render.cpp
index 3144191469..365e4c0464 100644
--- a/core/fpdfapi/fpdf_render/fpdf_render.cpp
+++ b/core/fpdfapi/fpdf_render/fpdf_render.cpp
@@ -455,6 +455,7 @@ FX_BOOL IsAvailableMatrix(const CFX_Matrix& matrix) {
}
return TRUE;
}
+
FX_BOOL CPDF_RenderStatus::ProcessPath(const CPDF_PathObject* pPathObj,
const CFX_Matrix* pObj2Device) {
int FillType = pPathObj->m_FillType;
@@ -500,10 +501,11 @@ FX_BOOL CPDF_RenderStatus::ProcessPath(const CPDF_PathObject* pPathObj,
if (m_Options.m_Flags & RENDER_THINLINE) {
graphState.m_LineWidth = 0;
}
- return m_pDevice->DrawPath(pPathObj->m_Path, &path_matrix, &graphState,
- fill_argb, stroke_argb, FillType, 0, NULL,
- m_curBlend);
+ return m_pDevice->DrawPathWithBlend(pPathObj->m_Path, &path_matrix,
+ &graphState, fill_argb, stroke_argb,
+ FillType, m_curBlend);
}
+
CPDF_TransferFunc* CPDF_RenderStatus::GetTransferFunc(CPDF_Object* pObj) const {
ASSERT(pObj);
CPDF_DocRenderData* pDocCache = m_pContext->GetDocument()->GetRenderData();
diff --git a/core/fpdfapi/fpdf_render/fpdf_render_image.cpp b/core/fpdfapi/fpdf_render/fpdf_render_image.cpp
index d84c0037fd..f7e57c0fa6 100644
--- a/core/fpdfapi/fpdf_render/fpdf_render_image.cpp
+++ b/core/fpdfapi/fpdf_render/fpdf_render_image.cpp
@@ -76,7 +76,7 @@ void CPDF_RenderStatus::CompositeDIBitmap(CFX_DIBitmap* pDIBitmap,
if (pDIBitmap->IsAlphaMask()) {
return;
}
- m_pDevice->SetDIBits(pDIBitmap, left, top, blend_mode);
+ m_pDevice->SetDIBitsWithBlend(pDIBitmap, left, top, blend_mode);
} else {
FX_RECT rect(left, top, left + pDIBitmap->GetWidth(),
top + pDIBitmap->GetHeight());
@@ -106,7 +106,8 @@ void CPDF_RenderStatus::CompositeDIBitmap(CFX_DIBitmap* pDIBitmap,
if (pDIBitmap->IsAlphaMask()) {
return;
}
- m_pDevice->SetDIBits(pDIBitmap, rect.left, rect.top, blend_mode);
+ m_pDevice->SetDIBitsWithBlend(pDIBitmap, rect.left, rect.top,
+ blend_mode);
}
if (bClone) {
delete pClone;
@@ -600,8 +601,8 @@ FX_BOOL CPDF_ImageRenderer::DrawPatternImage(const CFX_Matrix* pObj2Device) {
bitmap_device1.GetBitmap()->MultiplyAlpha(bitmap_device2.GetBitmap());
bitmap_device1.GetBitmap()->MultiplyAlpha(255);
}
- m_pRenderStatus->m_pDevice->SetDIBits(bitmap_device1.GetBitmap(), rect.left,
- rect.top, m_BlendType);
+ m_pRenderStatus->m_pDevice->SetDIBitsWithBlend(
+ bitmap_device1.GetBitmap(), rect.left, rect.top, m_BlendType);
return FALSE;
}
FX_BOOL CPDF_ImageRenderer::DrawMaskedImage() {
@@ -695,8 +696,8 @@ FX_BOOL CPDF_ImageRenderer::DrawMaskedImage() {
bitmap_device1.GetBitmap()->MultiplyAlpha(m_BitmapAlpha);
}
}
- m_pRenderStatus->m_pDevice->SetDIBits(bitmap_device1.GetBitmap(), rect.left,
- rect.top, m_BlendType);
+ m_pRenderStatus->m_pDevice->SetDIBitsWithBlend(
+ bitmap_device1.GetBitmap(), rect.left, rect.top, m_BlendType);
return FALSE;
}
@@ -709,9 +710,9 @@ FX_BOOL CPDF_ImageRenderer::StartDIBSource() {
m_Flags |= RENDER_FORCE_DOWNSAMPLE;
}
}
- if (m_pRenderStatus->m_pDevice->StartDIBits(
+ if (m_pRenderStatus->m_pDevice->StartDIBitsWithBlend(
m_pDIBSource, m_BitmapAlpha, m_FillArgb, &m_ImageMatrix, m_Flags,
- m_DeviceHandle, 0, nullptr, m_BlendType)) {
+ m_DeviceHandle, m_BlendType)) {
if (m_DeviceHandle) {
m_Status = 3;
return TRUE;
@@ -746,16 +747,16 @@ FX_BOOL CPDF_ImageRenderer::StartDIBSource() {
int dest_left = dest_width > 0 ? image_rect.left : image_rect.right;
int dest_top = dest_height > 0 ? image_rect.top : image_rect.bottom;
if (m_pDIBSource->IsOpaqueImage() && m_BitmapAlpha == 255) {
- if (m_pRenderStatus->m_pDevice->StretchDIBits(
+ if (m_pRenderStatus->m_pDevice->StretchDIBitsWithFlagsAndBlend(
m_pDIBSource, dest_left, dest_top, dest_width, dest_height, m_Flags,
- nullptr, m_BlendType)) {
+ m_BlendType)) {
return FALSE;
}
}
if (m_pDIBSource->IsAlphaMask()) {
if (m_BitmapAlpha != 255)
m_FillArgb = FXARGB_MUL_ALPHA(m_FillArgb, m_BitmapAlpha);
- if (m_pRenderStatus->m_pDevice->StretchBitMask(
+ if (m_pRenderStatus->m_pDevice->StretchBitMaskWithFlags(
m_pDIBSource, dest_left, dest_top, dest_width, dest_height,
m_FillArgb, m_Flags)) {
return FALSE;
@@ -845,7 +846,7 @@ FX_BOOL CPDF_ImageRenderer::Continue(IFX_Pause* pPause) {
} else {
if (m_BitmapAlpha != 255)
pBitmap->MultiplyAlpha(m_BitmapAlpha);
- m_Result = m_pRenderStatus->m_pDevice->SetDIBits(
+ m_Result = m_pRenderStatus->m_pDevice->SetDIBitsWithBlend(
pBitmap.get(), m_pTransformer->result().left,
m_pTransformer->result().top, m_BlendType);
}
diff --git a/core/fpdfapi/fpdf_render/fpdf_render_text.cpp b/core/fpdfapi/fpdf_render/fpdf_render_text.cpp
index 5bd7c35059..7c2fec7c78 100644
--- a/core/fpdfapi/fpdf_render/fpdf_render_text.cpp
+++ b/core/fpdfapi/fpdf_render/fpdf_render_text.cpp
@@ -589,6 +589,7 @@ void CPDF_CharPosList::Load(int nChars,
}
}
}
+
FX_BOOL CPDF_TextRenderer::DrawTextPath(CFX_RenderDevice* pDevice,
int nChars,
uint32_t* pCharCodes,
@@ -604,14 +605,15 @@ FX_BOOL CPDF_TextRenderer::DrawTextPath(CFX_RenderDevice* pDevice,
int nFlag) {
CFX_FontCache* pCache =
pFont->m_pDocument ? pFont->m_pDocument->GetRenderData()->GetFontCache()
- : NULL;
+ : nullptr;
CPDF_CharPosList CharPosList;
CharPosList.Load(nChars, pCharCodes, pCharPos, pFont, font_size);
- return pDevice->DrawTextPath(CharPosList.m_nChars, CharPosList.m_pCharPos,
- &pFont->m_Font, pCache, font_size, pText2User,
- pUser2Device, pGraphState, fill_argb,
- stroke_argb, pClippingPath, nFlag);
+ return pDevice->DrawTextPathWithFlags(
+ CharPosList.m_nChars, CharPosList.m_pCharPos, &pFont->m_Font, pCache,
+ font_size, pText2User, pUser2Device, pGraphState, fill_argb, stroke_argb,
+ pClippingPath, nFlag);
}
+
void CPDF_TextRenderer::DrawTextString(CFX_RenderDevice* pDevice,
int left,
int top,