summaryrefslogtreecommitdiff
path: root/core/fpdfapi/fpdf_render
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2016-08-26 14:56:39 -0700
committerCommit bot <commit-bot@chromium.org>2016-08-26 14:56:39 -0700
commit83d2351fd64128156c9abfb70266133d58a5e525 (patch)
treeb975e59ff6a31fbe86b289294fe65f9150e18fb6 /core/fpdfapi/fpdf_render
parent0ee35908e906922a423fb18d7085ef80d0d8d8c8 (diff)
downloadpdfium-83d2351fd64128156c9abfb70266133d58a5e525.tar.xz
Remove CFX_CountRef::IsNull in favor of operator bool
Review-Url: https://codereview.chromium.org/2285513002
Diffstat (limited to 'core/fpdfapi/fpdf_render')
-rw-r--r--core/fpdfapi/fpdf_render/fpdf_render.cpp22
1 files changed, 10 insertions, 12 deletions
diff --git a/core/fpdfapi/fpdf_render/fpdf_render.cpp b/core/fpdfapi/fpdf_render/fpdf_render.cpp
index 576be6a8d4..f24a66857d 100644
--- a/core/fpdfapi/fpdf_render/fpdf_render.cpp
+++ b/core/fpdfapi/fpdf_render/fpdf_render.cpp
@@ -260,7 +260,7 @@ void CPDF_RenderStatus::RenderSingleObject(const CPDF_PageObject* pObj,
return;
}
m_pCurObj = pObj;
- if (m_Options.m_pOCContext && pObj->m_ContentMark.NotNull()) {
+ if (m_Options.m_pOCContext && pObj->m_ContentMark) {
if (!m_Options.m_pOCContext->CheckObjectVisible(pObj)) {
return;
}
@@ -289,7 +289,7 @@ FX_BOOL CPDF_RenderStatus::ContinueSingleObject(const CPDF_PageObject* pObj,
}
m_pCurObj = pObj;
- if (m_Options.m_pOCContext && pObj->m_ContentMark.NotNull() &&
+ if (m_Options.m_pOCContext && pObj->m_ContentMark &&
!m_Options.m_pOCContext->CheckObjectVisible(pObj)) {
return FALSE;
}
@@ -574,8 +574,8 @@ FX_ARGB CPDF_RenderStatus::GetStrokeArgb(const CPDF_PageObject* pObj) const {
}
void CPDF_RenderStatus::ProcessClipPath(CPDF_ClipPath ClipPath,
const CFX_Matrix* pObj2Device) {
- if (ClipPath.IsNull()) {
- if (!m_LastClipPath.IsNull()) {
+ if (!ClipPath) {
+ if (m_LastClipPath) {
m_pDevice->RestoreState(true);
m_LastClipPath.SetNull();
}
@@ -634,9 +634,9 @@ void CPDF_RenderStatus::ProcessClipPath(CPDF_ClipPath ClipPath,
void CPDF_RenderStatus::DrawClipPath(CPDF_ClipPath ClipPath,
const CFX_Matrix* pObj2Device) {
- if (ClipPath.IsNull()) {
+ if (!ClipPath)
return;
- }
+
int fill_mode = 0;
if (m_Options.m_Flags & RENDER_NOPATHSMOOTH) {
fill_mode |= FXFILL_NOPATHSMOOTH;
@@ -713,12 +713,10 @@ FX_BOOL CPDF_RenderStatus::ProcessTransparency(const CPDF_PageObject* pPageObj,
pFormResource = pFormObj->m_pForm->m_pFormDict->GetDictBy("Resources");
}
}
- FX_BOOL bTextClip = FALSE;
- if (pPageObj->m_ClipPath.NotNull() && pPageObj->m_ClipPath.GetTextCount() &&
- m_pDevice->GetDeviceClass() == FXDC_DISPLAY &&
- !(m_pDevice->GetDeviceCaps(FXDC_RENDER_CAPS) & FXRC_SOFT_CLIP)) {
- bTextClip = TRUE;
- }
+ bool bTextClip =
+ (pPageObj->m_ClipPath && pPageObj->m_ClipPath.GetTextCount() &&
+ m_pDevice->GetDeviceClass() == FXDC_DISPLAY &&
+ !(m_pDevice->GetDeviceCaps(FXDC_RENDER_CAPS) & FXRC_SOFT_CLIP));
if ((m_Options.m_Flags & RENDER_OVERPRINT) && pPageObj->IsImage() &&
pGeneralState && pGeneralState->m_FillOP && pGeneralState->m_StrokeOP) {
CPDF_Document* pDocument = nullptr;