summaryrefslogtreecommitdiff
path: root/core/src/fpdfapi/fpdf_render
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2016-01-26 13:20:26 -0800
committerTom Sepez <tsepez@chromium.org>2016-01-26 13:20:26 -0800
commit8e5cd19d174f259bfda5f7a9699b08fdc4289b56 (patch)
tree6c2382c4cfe0475ecbfafc1af981dcaa0a801c35 /core/src/fpdfapi/fpdf_render
parentd834d55f902ccd18cba85f93ecf51e30c5e7e47b (diff)
downloadpdfium-8e5cd19d174f259bfda5f7a9699b08fdc4289b56.tar.xz
Merge to XFA: War on #defines, part 1.
Contains additional XFA-specific changes. Original Review URL: https://codereview.chromium.org/1632143002 . (cherry picked from commit 66a9dc9dd65ed2b9c7ede448d046b770140f16d5) R=thestig@chromium.org Review URL: https://codereview.chromium.org/1636503006 .
Diffstat (limited to 'core/src/fpdfapi/fpdf_render')
-rw-r--r--core/src/fpdfapi/fpdf_render/fpdf_render.cpp40
-rw-r--r--core/src/fpdfapi/fpdf_render/fpdf_render_pattern.cpp8
-rw-r--r--core/src/fpdfapi/fpdf_render/fpdf_render_text.cpp2
3 files changed, 26 insertions, 24 deletions
diff --git a/core/src/fpdfapi/fpdf_render/fpdf_render.cpp b/core/src/fpdfapi/fpdf_render/fpdf_render.cpp
index 583b19f7ab..28a5fe1eef 100644
--- a/core/src/fpdfapi/fpdf_render/fpdf_render.cpp
+++ b/core/src/fpdfapi/fpdf_render/fpdf_render.cpp
@@ -312,7 +312,7 @@ FX_BOOL CPDF_RenderStatus::ContinueSingleObject(const CPDF_PageObject* pObj,
if (ProcessTransparency(pObj, pObj2Device))
return FALSE;
- if (pObj->m_Type == PDFPAGE_IMAGE) {
+ if (pObj->m_Type == CPDF_PageObject::IMAGE) {
m_pObjectRenderer.reset(IPDF_ObjectRenderer::Create(pObj->m_Type));
if (!m_pObjectRenderer->Start(this, pObj, pObj2Device, FALSE)) {
if (!m_pObjectRenderer->m_Result)
@@ -328,7 +328,7 @@ FX_BOOL CPDF_RenderStatus::ContinueSingleObject(const CPDF_PageObject* pObj,
}
IPDF_ObjectRenderer* IPDF_ObjectRenderer::Create(int type) {
- if (type != PDFPAGE_IMAGE) {
+ if (type != CPDF_PageObject::IMAGE) {
return NULL;
}
return new CPDF_ImageRenderer;
@@ -381,19 +381,19 @@ void CPDF_RenderStatus::ProcessObjectNoClip(const CPDF_PageObject* pObj,
const CFX_Matrix* pObj2Device) {
FX_BOOL bRet = FALSE;
switch (pObj->m_Type) {
- case PDFPAGE_TEXT:
+ case CPDF_PageObject::TEXT:
bRet = ProcessText((CPDF_TextObject*)pObj, pObj2Device, NULL);
break;
- case PDFPAGE_PATH:
+ case CPDF_PageObject::PATH:
bRet = ProcessPath((CPDF_PathObject*)pObj, pObj2Device);
break;
- case PDFPAGE_IMAGE:
+ case CPDF_PageObject::IMAGE:
bRet = ProcessImage((CPDF_ImageObject*)pObj, pObj2Device);
break;
- case PDFPAGE_SHADING:
+ case CPDF_PageObject::SHADING:
bRet = ProcessShading((CPDF_ShadingObject*)pObj, pObj2Device);
break;
- case PDFPAGE_FORM:
+ case CPDF_PageObject::FORM:
bRet = ProcessForm((CPDF_FormObject*)pObj, pObj2Device);
break;
}
@@ -405,15 +405,17 @@ FX_BOOL CPDF_RenderStatus::DrawObjWithBlend(const CPDF_PageObject* pObj,
const CFX_Matrix* pObj2Device) {
FX_BOOL bRet = FALSE;
switch (pObj->m_Type) {
- case PDFPAGE_PATH:
+ case CPDF_PageObject::PATH:
bRet = ProcessPath((CPDF_PathObject*)pObj, pObj2Device);
break;
- case PDFPAGE_IMAGE:
+ case CPDF_PageObject::IMAGE:
bRet = ProcessImage((CPDF_ImageObject*)pObj, pObj2Device);
break;
- case PDFPAGE_FORM:
+ case CPDF_PageObject::FORM:
bRet = ProcessForm((CPDF_FormObject*)pObj, pObj2Device);
break;
+ default:
+ break;
}
return bRet;
}
@@ -429,7 +431,7 @@ void CPDF_RenderStatus::DrawObjWithBackground(const CPDF_PageObject* pObj,
return;
}
int res = 300;
- if (pObj->m_Type == PDFPAGE_IMAGE &&
+ if (pObj->m_Type == CPDF_PageObject::IMAGE &&
m_pDevice->GetDeviceCaps(FXDC_DEVICE_CLASS) == FXDC_PRINTER) {
res = 0;
}
@@ -441,7 +443,7 @@ void CPDF_RenderStatus::DrawObjWithBackground(const CPDF_PageObject* pObj,
matrix.Concat(*buffer.GetMatrix());
GetScaledMatrix(matrix);
CPDF_Dictionary* pFormResource = NULL;
- if (pObj->m_Type == PDFPAGE_FORM) {
+ if (pObj->m_Type == CPDF_PageObject::FORM) {
CPDF_FormObject* pFormObj = (CPDF_FormObject*)pObj;
if (pFormObj->m_pForm && pFormObj->m_pForm->m_pFormDict) {
pFormResource = pFormObj->m_pForm->m_pFormDict->GetDict("Resources");
@@ -725,7 +727,7 @@ FX_BOOL CPDF_RenderStatus::ProcessTransparency(const CPDF_PageObject* pPageObj,
CPDF_Dictionary* pSMaskDict =
pGeneralState ? ToDictionary(pGeneralState->m_pSoftMask) : NULL;
if (pSMaskDict) {
- if (pPageObj->m_Type == PDFPAGE_IMAGE &&
+ if (pPageObj->m_Type == CPDF_PageObject::IMAGE &&
((CPDF_ImageObject*)pPageObj)->m_pImage->GetDict()->KeyExist("SMask")) {
pSMaskDict = NULL;
}
@@ -734,7 +736,7 @@ FX_BOOL CPDF_RenderStatus::ProcessTransparency(const CPDF_PageObject* pPageObj,
FX_FLOAT group_alpha = 1.0f;
int Transparency = m_Transparency;
FX_BOOL bGroupTransparent = FALSE;
- if (pPageObj->m_Type == PDFPAGE_FORM) {
+ if (pPageObj->m_Type == CPDF_PageObject::FORM) {
CPDF_FormObject* pFormObj = (CPDF_FormObject*)pPageObj;
const CPDF_GeneralStateData* pStateData =
pFormObj->m_GeneralState.GetObject();
@@ -754,7 +756,7 @@ FX_BOOL CPDF_RenderStatus::ProcessTransparency(const CPDF_PageObject* pPageObj,
bTextClip = TRUE;
}
if ((m_Options.m_Flags & RENDER_OVERPRINT) &&
- pPageObj->m_Type == PDFPAGE_IMAGE && pGeneralState &&
+ pPageObj->m_Type == CPDF_PageObject::IMAGE && pGeneralState &&
pGeneralState->m_FillOP && pGeneralState->m_StrokeOP) {
CPDF_Document* pDocument = NULL;
CPDF_Page* pPage = NULL;
@@ -874,7 +876,7 @@ FX_BOOL CPDF_RenderStatus::ProcessTransparency(const CPDF_PageObject* pPageObj,
bitmap->MultiplyAlpha((int32_t)(group_alpha * 255));
}
Transparency = m_Transparency;
- if (pPageObj->m_Type == PDFPAGE_FORM) {
+ if (pPageObj->m_Type == CPDF_PageObject::FORM) {
Transparency |= PDFTRANS_GROUP;
}
CompositeDIBitmap(bitmap, rect.left, rect.top, 0, 255, blend_type,
@@ -1118,13 +1120,13 @@ void CPDF_ProgressiveRenderer::Continue(IFX_Pause* pPause) {
pPause)) {
return;
}
- if (pCurObj->m_Type == PDFPAGE_IMAGE &&
+ if (pCurObj->m_Type == CPDF_PageObject::IMAGE &&
m_pRenderStatus->m_Options.m_Flags & RENDER_LIMITEDIMAGECACHE) {
m_pContext->GetPageCache()->CacheOptimization(
m_pRenderStatus->m_Options.m_dwLimitCacheSize);
}
- if (pCurObj->m_Type == PDFPAGE_FORM ||
- pCurObj->m_Type == PDFPAGE_SHADING) {
+ if (pCurObj->m_Type == CPDF_PageObject::FORM ||
+ pCurObj->m_Type == CPDF_PageObject::SHADING) {
objs_to_go = 0;
} else {
objs_to_go--;
diff --git a/core/src/fpdfapi/fpdf_render/fpdf_render_pattern.cpp b/core/src/fpdfapi/fpdf_render/fpdf_render_pattern.cpp
index c1bb6f6813..6aeed548a3 100644
--- a/core/src/fpdfapi/fpdf_render/fpdf_render_pattern.cpp
+++ b/core/src/fpdfapi/fpdf_render/fpdf_render_pattern.cpp
@@ -919,12 +919,12 @@ void CPDF_RenderStatus::DrawShadingPattern(CPDF_ShadingPattern* pattern,
return;
}
m_pDevice->SaveState();
- if (pPageObj->m_Type == PDFPAGE_PATH) {
+ if (pPageObj->m_Type == CPDF_PageObject::PATH) {
if (!SelectClipPath((CPDF_PathObject*)pPageObj, pObj2Device, bStroke)) {
m_pDevice->RestoreState();
return;
}
- } else if (pPageObj->m_Type == PDFPAGE_IMAGE) {
+ } else if (pPageObj->m_Type == CPDF_PageObject::IMAGE) {
FX_RECT rect = pPageObj->GetBBox(pObj2Device);
m_pDevice->SetClip_Rect(&rect);
} else {
@@ -1001,12 +1001,12 @@ void CPDF_RenderStatus::DrawTilingPattern(CPDF_TilingPattern* pPattern,
return;
}
m_pDevice->SaveState();
- if (pPageObj->m_Type == PDFPAGE_PATH) {
+ if (pPageObj->m_Type == CPDF_PageObject::PATH) {
if (!SelectClipPath((CPDF_PathObject*)pPageObj, pObj2Device, bStroke)) {
m_pDevice->RestoreState();
return;
}
- } else if (pPageObj->m_Type == PDFPAGE_IMAGE) {
+ } else if (pPageObj->m_Type == CPDF_PageObject::IMAGE) {
FX_RECT rect = pPageObj->GetBBox(pObj2Device);
m_pDevice->SetClip_Rect(&rect);
} else {
diff --git a/core/src/fpdfapi/fpdf_render/fpdf_render_text.cpp b/core/src/fpdfapi/fpdf_render/fpdf_render_text.cpp
index 05a5e040e3..a40284a1f8 100644
--- a/core/src/fpdfapi/fpdf_render/fpdf_render_text.cpp
+++ b/core/src/fpdfapi/fpdf_render/fpdf_render_text.cpp
@@ -319,7 +319,7 @@ FX_BOOL CPDF_Type3Char::LoadBitmap(CPDF_RenderContext* pContext) {
if (m_pForm->CountObjects() == 1 && !m_bColored) {
CPDF_PageObject* pPageObj =
m_pForm->GetObjectAt(m_pForm->GetFirstObjectPosition());
- if (pPageObj->m_Type == PDFPAGE_IMAGE) {
+ if (pPageObj->m_Type == CPDF_PageObject::IMAGE) {
CPDF_ImageObject* pImage = (CPDF_ImageObject*)pPageObj;
m_ImageMatrix = pImage->m_Matrix;
const CFX_DIBSource* pSource = pImage->m_pImage->LoadDIBSource();