diff options
author | Tom Sepez <tsepez@chromium.org> | 2015-07-23 13:26:26 -0700 |
---|---|---|
committer | Tom Sepez <tsepez@chromium.org> | 2015-07-23 13:26:26 -0700 |
commit | 320b2313d19869333ed453af546e61a9fc2b81c9 (patch) | |
tree | 25f2eb8a0991ac485ca6354f0d3caf7fd775e732 /core/src/fpdfapi/fpdf_render | |
parent | 065e9321b84fc0490f3da9099e8840c65e06868d (diff) | |
download | pdfium-320b2313d19869333ed453af546e61a9fc2b81c9.tar.xz |
FX_BOOL considered harmful, part 2.
Fully automatic change, execpt for cleanup in fx_system.h
R=thestig@chromium.org
Review URL: https://codereview.chromium.org/1254703002 .
Diffstat (limited to 'core/src/fpdfapi/fpdf_render')
-rw-r--r-- | core/src/fpdfapi/fpdf_render/fpdf_render.cpp | 164 | ||||
-rw-r--r-- | core/src/fpdfapi/fpdf_render/fpdf_render_cache.cpp | 38 | ||||
-rw-r--r-- | core/src/fpdfapi/fpdf_render/fpdf_render_image.cpp | 186 | ||||
-rw-r--r-- | core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp | 180 | ||||
-rw-r--r-- | core/src/fpdfapi/fpdf_render/fpdf_render_pattern.cpp | 64 | ||||
-rw-r--r-- | core/src/fpdfapi/fpdf_render/fpdf_render_text.cpp | 110 | ||||
-rw-r--r-- | core/src/fpdfapi/fpdf_render/render_int.h | 162 |
7 files changed, 452 insertions, 452 deletions
diff --git a/core/src/fpdfapi/fpdf_render/fpdf_render.cpp b/core/src/fpdfapi/fpdf_render/fpdf_render.cpp index f8b59913e4..a70f5bfdf9 100644 --- a/core/src/fpdfapi/fpdf_render/fpdf_render.cpp +++ b/core/src/fpdfapi/fpdf_render/fpdf_render.cpp @@ -18,10 +18,10 @@ CPDF_DocRenderData::CPDF_DocRenderData(CPDF_Document* pPDFDoc) CPDF_DocRenderData::~CPDF_DocRenderData() { - Clear(TRUE); + Clear(true); } -void CPDF_DocRenderData::Clear(FX_BOOL bRelease) +void CPDF_DocRenderData::Clear(bool bRelease) { for (auto it = m_Type3FaceMap.begin(); it != m_Type3FaceMap.end();) { auto curr_it = it++; @@ -48,7 +48,7 @@ void CPDF_DocRenderData::Clear(FX_BOOL bRelease) delete m_pFontCache; m_pFontCache = NULL; } else { - m_pFontCache->FreeCache(FALSE); + m_pFontCache->FreeCache(false); } } } @@ -118,7 +118,7 @@ void CPDF_RenderModule::DestroyDocData(CPDF_DocRenderData* pDocData) void CPDF_RenderModule::ClearDocData(CPDF_DocRenderData* p) { if (p) { - p->Clear(FALSE); + p->Clear(false); } } void CPDF_RenderModule::DestroyPageCache(CPDF_PageRenderCache* pCache) @@ -180,19 +180,19 @@ int CPDF_RenderStatus::s_CurrentRecursionDepth = 0; CPDF_RenderStatus::CPDF_RenderStatus() { m_pContext = NULL; - m_bStopped = FALSE; + m_bStopped = false; m_pDevice = NULL; m_pCurObj = NULL; m_pStopObj = NULL; m_HalftoneLimit = 0; m_pObjectRenderer = NULL; - m_bPrint = FALSE; + m_bPrint = false; m_Transparency = 0; m_DitherBits = 0; - m_bDropObjects = FALSE; - m_bStdCS = FALSE; + m_bDropObjects = false; + m_bStdCS = false; m_GroupFamily = 0; - m_bLoadMask = FALSE; + m_bLoadMask = false; m_pType3Char = NULL; m_T3FillColor = 0; m_pFormResource = NULL; @@ -205,13 +205,13 @@ CPDF_RenderStatus::~CPDF_RenderStatus() delete m_pObjectRenderer; } -FX_BOOL CPDF_RenderStatus::Initialize(CPDF_RenderContext* pContext, CFX_RenderDevice* pDevice, +bool CPDF_RenderStatus::Initialize(CPDF_RenderContext* pContext, CFX_RenderDevice* pDevice, const CFX_AffineMatrix* pDeviceMatrix, const CPDF_PageObject* pStopObj, const CPDF_RenderStatus* pParentState, const CPDF_GraphicStates* pInitialStates, - const CPDF_RenderOptions* pOptions, int transparency, FX_BOOL bDropObjects, - CPDF_Dictionary* pFormResource, FX_BOOL bStdCS, CPDF_Type3Char* pType3Char, + const CPDF_RenderOptions* pOptions, int transparency, bool bDropObjects, + CPDF_Dictionary* pFormResource, bool bStdCS, CPDF_Type3Char* pType3Char, FX_ARGB fill_color, FX_DWORD GroupFamily, - FX_BOOL bLoadMask) + bool bLoadMask) { m_pContext = pContext; m_pDevice = pDevice; @@ -253,7 +253,7 @@ FX_BOOL CPDF_RenderStatus::Initialize(CPDF_RenderContext* pContext, CFX_RenderDe } m_pObjectRenderer = NULL; m_Transparency = transparency; - return TRUE; + return true; } void CPDF_RenderStatus::RenderObjectList(const CPDF_PageObjects* pObjs, const CFX_AffineMatrix* pObj2Device) { @@ -267,7 +267,7 @@ void CPDF_RenderStatus::RenderObjectList(const CPDF_PageObjects* pObjs, const CF index ++; CPDF_PageObject* pCurObj = pObjs->GetNextObject(pos); if (pCurObj == m_pStopObj) { - m_bStopped = TRUE; + m_bStopped = true; return; } if (!pCurObj) { @@ -301,42 +301,42 @@ void CPDF_RenderStatus::RenderSingleObject(const CPDF_PageObject* pObj, const CF } ProcessObjectNoClip(pObj, pObj2Device); } -FX_BOOL CPDF_RenderStatus::ContinueSingleObject(const CPDF_PageObject* pObj, const CFX_AffineMatrix* pObj2Device, IFX_Pause* pPause) +bool CPDF_RenderStatus::ContinueSingleObject(const CPDF_PageObject* pObj, const CFX_AffineMatrix* pObj2Device, IFX_Pause* pPause) { if (m_pObjectRenderer) { if (m_pObjectRenderer->Continue(pPause)) { - return TRUE; + return true; } if (!m_pObjectRenderer->m_Result) { DrawObjWithBackground(pObj, pObj2Device); } delete m_pObjectRenderer; m_pObjectRenderer = NULL; - return FALSE; + return false; } m_pCurObj = pObj; if (m_Options.m_pOCContext && pObj->m_ContentMark.NotNull()) if (!m_Options.m_pOCContext->CheckObjectVisible(pObj)) { - return FALSE; + return false; } ProcessClipPath(pObj->m_ClipPath, pObj2Device); if (ProcessTransparency(pObj, pObj2Device)) { - return FALSE; + return false; } if (pObj->m_Type == PDFPAGE_IMAGE) { m_pObjectRenderer = IPDF_ObjectRenderer::Create(pObj->m_Type); - if (!m_pObjectRenderer->Start(this, pObj, pObj2Device, FALSE)) { + if (!m_pObjectRenderer->Start(this, pObj, pObj2Device, false)) { if (!m_pObjectRenderer->m_Result) { DrawObjWithBackground(pObj, pObj2Device); } delete m_pObjectRenderer; m_pObjectRenderer = NULL; - return FALSE; + return false; } return ContinueSingleObject(pObj, pObj2Device, pPause); } ProcessObjectNoClip(pObj, pObj2Device); - return FALSE; + return false; } IPDF_ObjectRenderer* IPDF_ObjectRenderer::Create(int type) { @@ -345,7 +345,7 @@ IPDF_ObjectRenderer* IPDF_ObjectRenderer::Create(int type) } return new CPDF_ImageRenderer; } -FX_BOOL CPDF_RenderStatus::GetObjectClippedRect(const CPDF_PageObject* pObj, const CFX_AffineMatrix* pObj2Device, FX_BOOL bLogical, FX_RECT &rect) const +bool CPDF_RenderStatus::GetObjectClippedRect(const CPDF_PageObject* pObj, const CFX_AffineMatrix* pObj2Device, bool bLogical, FX_RECT &rect) const { rect = pObj->GetBBox(pObj2Device); FX_RECT rtClip = m_pDevice->GetClipBox(); @@ -370,7 +370,7 @@ void CPDF_RenderStatus::DitherObjectArea(const CPDF_PageObject* pObj, const CFX_ return; } FX_RECT rect; - if (GetObjectClippedRect(pObj, pObj2Device, FALSE, rect)) { + if (GetObjectClippedRect(pObj, pObj2Device, false, rect)) { return; } if (m_DitherBits == 2) { @@ -386,7 +386,7 @@ void CPDF_RenderStatus::DitherObjectArea(const CPDF_PageObject* pObj, const CFX_ } void CPDF_RenderStatus::ProcessObjectNoClip(const CPDF_PageObject* pObj, const CFX_AffineMatrix* pObj2Device) { - FX_BOOL bRet = FALSE; + bool bRet = false; switch (pObj->m_Type) { case PDFPAGE_TEXT: bRet = ProcessText((CPDF_TextObject*)pObj, pObj2Device, NULL); @@ -408,9 +408,9 @@ void CPDF_RenderStatus::ProcessObjectNoClip(const CPDF_PageObject* pObj, const C DrawObjWithBackground(pObj, pObj2Device); } } -FX_BOOL CPDF_RenderStatus::DrawObjWithBlend(const CPDF_PageObject* pObj, const CFX_AffineMatrix* pObj2Device) +bool CPDF_RenderStatus::DrawObjWithBlend(const CPDF_PageObject* pObj, const CFX_AffineMatrix* pObj2Device) { - FX_BOOL bRet = FALSE; + bool bRet = false; switch (pObj->m_Type) { case PDFPAGE_PATH: bRet = ProcessPath((CPDF_PathObject*)pObj, pObj2Device); @@ -433,7 +433,7 @@ void CPDF_RenderStatus::GetScaledMatrix(CFX_Matrix &matrix) const void CPDF_RenderStatus::DrawObjWithBackground(const CPDF_PageObject* pObj, const CFX_AffineMatrix* pObj2Device) { FX_RECT rect; - if (GetObjectClippedRect(pObj, pObj2Device, FALSE, rect)) { + if (GetObjectClippedRect(pObj, pObj2Device, false, rect)) { return; } int res = 300; @@ -459,11 +459,11 @@ void CPDF_RenderStatus::DrawObjWithBackground(const CPDF_PageObject* pObj, const status.RenderSingleObject(pObj, &matrix); buffer.OutputToDevice(); } -FX_BOOL CPDF_RenderStatus::ProcessForm(CPDF_FormObject* pFormObj, const CFX_AffineMatrix* pObj2Device) +bool CPDF_RenderStatus::ProcessForm(CPDF_FormObject* pFormObj, const CFX_AffineMatrix* pObj2Device) { CPDF_Dictionary* pOC = pFormObj->m_pForm->m_pFormDict->GetDict(FX_BSTRC("OC")); if (pOC && m_Options.m_pOCContext && !m_Options.m_pOCContext->CheckOCGVisible(pOC)) { - return TRUE; + return true; } CFX_AffineMatrix matrix = pFormObj->m_FormMatrix; matrix.Concat(*pObj2Device); @@ -473,15 +473,15 @@ FX_BOOL CPDF_RenderStatus::ProcessForm(CPDF_FormObject* pFormObj, const CFX_Affi } CPDF_RenderStatus status; status.Initialize(m_pContext, m_pDevice, NULL, m_pStopObj, - this, pFormObj, &m_Options, m_Transparency, m_bDropObjects, pResources, FALSE); + this, pFormObj, &m_Options, m_Transparency, m_bDropObjects, pResources, false); status.m_curBlend = m_curBlend; m_pDevice->SaveState(); status.RenderObjectList(pFormObj->m_pForm, &matrix); m_bStopped = status.m_bStopped; m_pDevice->RestoreState(); - return TRUE; + return true; } -FX_BOOL IsAvailableMatrix(const CFX_AffineMatrix& matrix) +bool IsAvailableMatrix(const CFX_AffineMatrix& matrix) { if (matrix.a == 0 || matrix.d == 0) { return matrix.b != 0 && matrix.c != 0; @@ -489,15 +489,15 @@ FX_BOOL IsAvailableMatrix(const CFX_AffineMatrix& matrix) if (matrix.b == 0 || matrix.c == 0) { return matrix.a != 0 && matrix.d != 0; } - return TRUE; + return true; } -FX_BOOL CPDF_RenderStatus::ProcessPath(CPDF_PathObject* pPathObj, const CFX_AffineMatrix* pObj2Device) +bool CPDF_RenderStatus::ProcessPath(CPDF_PathObject* pPathObj, const CFX_AffineMatrix* pObj2Device) { int FillType = pPathObj->m_FillType; - FX_BOOL bStroke = pPathObj->m_bStroke; + bool bStroke = pPathObj->m_bStroke; ProcessPathPattern(pPathObj, pObj2Device, FillType, bStroke); if (FillType == 0 && !bStroke) { - return TRUE; + return true; } FX_DWORD fill_argb = 0; if (FillType) { @@ -510,7 +510,7 @@ FX_BOOL CPDF_RenderStatus::ProcessPath(CPDF_PathObject* pPathObj, const CFX_Affi CFX_AffineMatrix path_matrix = pPathObj->m_Matrix; path_matrix.Concat(*pObj2Device); if (!IsAvailableMatrix(path_matrix)) { - return TRUE; + return true; } if (FillType && (m_Options.m_Flags & RENDER_RECT_AA)) { FillType |= FXFILL_RECT_AA; @@ -546,7 +546,7 @@ CPDF_TransferFunc* CPDF_RenderStatus::GetTransferFunc(CPDF_Object* pObj) const } return pDocCache->GetTransferFunc(pObj); } -FX_ARGB CPDF_RenderStatus::GetFillArgb(const CPDF_PageObject* pObj, FX_BOOL bType3) const +FX_ARGB CPDF_RenderStatus::GetFillArgb(const CPDF_PageObject* pObj, bool bType3) const { CPDF_ColorStateData* pColorData = (CPDF_ColorStateData*)(const CPDF_ColorStateData*)pObj->m_ColorState; if (m_pType3Char && !bType3 && (!m_pType3Char->m_bColored || (m_pType3Char->m_bColored && (!pColorData || pColorData->m_FillColor.IsNull())))) { @@ -612,7 +612,7 @@ void CPDF_RenderStatus::ProcessClipPath(CPDF_ClipPath ClipPath, const CFX_Affine if (m_LastClipPath.IsNull()) { return; } - m_pDevice->RestoreState(TRUE); + m_pDevice->RestoreState(true); m_LastClipPath.SetNull(); return; } @@ -620,7 +620,7 @@ void CPDF_RenderStatus::ProcessClipPath(CPDF_ClipPath ClipPath, const CFX_Affine return; } m_LastClipPath = ClipPath; - m_pDevice->RestoreState(TRUE); + m_pDevice->RestoreState(true); int nClipPath = ClipPath.GetPathCount(); int i; for (i = 0; i < nClipPath; i++) { @@ -690,7 +690,7 @@ void CPDF_RenderStatus::DrawClipPath(CPDF_ClipPath ClipPath, const CFX_AffineMat m_pDevice->DrawPath(pPathData, pObj2Device, &stroke_state, 0, 0xffff0000, fill_mode); } } -FX_BOOL CPDF_RenderStatus::SelectClipPath(CPDF_PathObject* pPathObj, const CFX_AffineMatrix* pObj2Device, FX_BOOL bStroke) +bool CPDF_RenderStatus::SelectClipPath(CPDF_PathObject* pPathObj, const CFX_AffineMatrix* pObj2Device, bool bStroke) { CFX_AffineMatrix path_matrix = pPathObj->m_Matrix; path_matrix.Concat(*pObj2Device); @@ -707,12 +707,12 @@ FX_BOOL CPDF_RenderStatus::SelectClipPath(CPDF_PathObject* pPathObj, const CFX_A } return m_pDevice->SetClip_PathFill(pPathObj->m_Path, &path_matrix, fill_mode); } -FX_BOOL CPDF_RenderStatus::ProcessTransparency(const CPDF_PageObject* pPageObj, const CFX_AffineMatrix* pObj2Device) +bool CPDF_RenderStatus::ProcessTransparency(const CPDF_PageObject* pPageObj, const CFX_AffineMatrix* pObj2Device) { const CPDF_GeneralStateData* pGeneralState = pPageObj->m_GeneralState; int blend_type = pGeneralState ? pGeneralState->m_BlendType : FXDIB_BLEND_NORMAL; if (blend_type == FXDIB_BLEND_UNSUPPORTED) { - return TRUE; + return true; } CPDF_Dictionary* pSMaskDict = pGeneralState ? (CPDF_Dictionary*)pGeneralState->m_pSoftMask : NULL; if (pSMaskDict) { @@ -724,7 +724,7 @@ FX_BOOL CPDF_RenderStatus::ProcessTransparency(const CPDF_PageObject* pPageObj, CPDF_Dictionary* pFormResource = NULL; FX_FLOAT group_alpha = 1.0f; int Transparency = m_Transparency; - FX_BOOL bGroupTransparent = FALSE; + bool bGroupTransparent = false; if (pPageObj->m_Type == PDFPAGE_FORM) { CPDF_FormObject* pFormObj = (CPDF_FormObject*)pPageObj; const CPDF_GeneralStateData *pStateData = pFormObj->m_GeneralState.GetObject(); @@ -732,15 +732,15 @@ FX_BOOL CPDF_RenderStatus::ProcessTransparency(const CPDF_PageObject* pPageObj, group_alpha = pStateData->m_FillAlpha; } Transparency = pFormObj->m_pForm->m_Transparency; - bGroupTransparent = Transparency & PDFTRANS_ISOLATED ? TRUE : FALSE; + bGroupTransparent = Transparency & PDFTRANS_ISOLATED ? true : false; if (pFormObj->m_pForm->m_pFormDict) { pFormResource = pFormObj->m_pForm->m_pFormDict->GetDict("Resources"); } } - FX_BOOL bTextClip = FALSE; + 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; + bTextClip = true; } if ((m_Options.m_Flags & RENDER_OVERPRINT) && pPageObj->m_Type == PDFPAGE_IMAGE && pGeneralState && pGeneralState->m_FillOP && pGeneralState->m_StrokeOP) { CPDF_Document* pDocument = NULL; @@ -763,11 +763,11 @@ FX_BOOL CPDF_RenderStatus::ProcessTransparency(const CPDF_PageObject* pPageObj, } } if (pSMaskDict == NULL && group_alpha == 1.0f && blend_type == FXDIB_BLEND_NORMAL && !bTextClip && !bGroupTransparent) { - return FALSE; + return false; } - FX_BOOL isolated = Transparency & PDFTRANS_ISOLATED; + bool isolated = Transparency & PDFTRANS_ISOLATED; if (m_bPrint) { - FX_BOOL bRet = FALSE; + bool bRet = false; int rendCaps = m_pDevice->GetRenderCaps(); if (!((Transparency & PDFTRANS_ISOLATED) || pSMaskDict || bTextClip) && (rendCaps & FXRC_BLEND_MODE)) { int oldBlend = m_curBlend; @@ -778,12 +778,12 @@ FX_BOOL CPDF_RenderStatus::ProcessTransparency(const CPDF_PageObject* pPageObj, if (!bRet) { DrawObjWithBackground(pPageObj, pObj2Device); } - return TRUE; + return true; } FX_RECT rect = pPageObj->GetBBox(pObj2Device); rect.Intersect(m_pDevice->GetClipBox()); if (rect.IsEmpty()) { - return TRUE; + return true; } CFX_Matrix deviceCTM = m_pDevice->GetCTM(); FX_FLOAT scaleX = FXSYS_fabs(deviceCTM.a); @@ -795,12 +795,12 @@ FX_BOOL CPDF_RenderStatus::ProcessTransparency(const CPDF_PageObject* pPageObj, if (!isolated && (m_pDevice->GetRenderCaps() & FXRC_GET_BITS)) { oriDevice = new CFX_DIBitmap; if (!m_pDevice->CreateCompatibleBitmap(oriDevice, width, height)) { - return TRUE; + return true; } m_pDevice->GetDIBits(oriDevice, rect.left, rect.top); } if (!bitmap_device.Create(width, height, FXDIB_Argb, 0, oriDevice)) { - return TRUE; + return true; } CFX_DIBitmap* bitmap = bitmap_device.GetBitmap(); bitmap->Clear(0); @@ -812,7 +812,7 @@ FX_BOOL CPDF_RenderStatus::ProcessTransparency(const CPDF_PageObject* pPageObj, pTextMask = new CFX_DIBitmap; if (!pTextMask->Create(width, height, FXDIB_8bppMask)) { delete pTextMask; - return TRUE; + return true; } pTextMask->Clear(0); CFX_FxgeDevice text_device; @@ -831,7 +831,7 @@ FX_BOOL CPDF_RenderStatus::ProcessTransparency(const CPDF_PageObject* pPageObj, } CPDF_RenderStatus bitmap_render; bitmap_render.Initialize(m_pContext, &bitmap_device, NULL, - m_pStopObj, NULL, NULL, &m_Options, 0, m_bDropObjects, pFormResource, TRUE); + m_pStopObj, NULL, NULL, &m_Options, 0, m_bDropObjects, pFormResource, true); bitmap_render.ProcessObjectNoClip(pPageObj, &new_matrix); m_bStopped = bitmap_render.m_bStopped; if (pSMaskDict) { @@ -858,10 +858,10 @@ FX_BOOL CPDF_RenderStatus::ProcessTransparency(const CPDF_PageObject* pPageObj, } CompositeDIBitmap(bitmap, rect.left, rect.top, 0, 255, blend_type, Transparency); delete oriDevice; - return TRUE; + return true; } CFX_DIBitmap* CPDF_RenderStatus::GetBackdrop(const CPDF_PageObject* pObj, const FX_RECT& rect, int& left, int& top, - FX_BOOL bBackAlphaRequired) + bool bBackAlphaRequired) { FX_RECT bbox = rect; bbox.Intersect(m_pDevice->GetClipBox()); @@ -882,7 +882,7 @@ CFX_DIBitmap* CPDF_RenderStatus::GetBackdrop(const CPDF_PageObject* pObj, const delete pBackdrop; return NULL; } - FX_BOOL bNeedDraw; + bool bNeedDraw; if (pBackdrop->HasAlpha()) { bNeedDraw = !(m_pDevice->GetRenderCaps() & FXRC_ALPHA_OUTPUT); } else { @@ -911,7 +911,7 @@ void CPDF_RenderContext::GetBackground(CFX_DIBitmap* pBuffer, const CPDF_PageObj device.FillRect(&rect, 0xffffffff); Render(&device, pObj, pOptions, pFinalMatrix); } -CPDF_GraphicStates* CPDF_RenderStatus::CloneObjStates(const CPDF_GraphicStates* pSrcStates, FX_BOOL bStroke) +CPDF_GraphicStates* CPDF_RenderStatus::CloneObjStates(const CPDF_GraphicStates* pSrcStates, bool bStroke) { if (!pSrcStates) { return NULL; @@ -932,14 +932,14 @@ CPDF_RenderContext::CPDF_RenderContext() { } void CPDF_RenderContext::Create(CPDF_Document* pDoc, CPDF_PageRenderCache* pPageCache, - CPDF_Dictionary* pPageResources, FX_BOOL bFirstLayer) + CPDF_Dictionary* pPageResources, bool bFirstLayer) { m_pDocument = pDoc; m_pPageResources = pPageResources; m_pPageCache = pPageCache; m_bFirstLayer = bFirstLayer; } -void CPDF_RenderContext::Create(CPDF_Page* pPage, FX_BOOL bFirstLayer) +void CPDF_RenderContext::Create(CPDF_Page* pPage, bool bFirstLayer) { m_pDocument = pPage->m_pDocument; m_pPageResources = pPage->m_pPageResources; @@ -954,7 +954,7 @@ void CPDF_RenderContext::Clear() m_pDocument = NULL; m_pPageResources = NULL; m_pPageCache = NULL; - m_bFirstLayer = TRUE; + m_bFirstLayer = true; m_ContentList.RemoveAll(); } void CPDF_RenderContext::AppendObjectList(CPDF_PageObjects* pObjs, const CFX_AffineMatrix* pObject2Device) @@ -984,7 +984,7 @@ void CPDF_RenderContext::Render(CFX_RenderDevice* pDevice, const CPDF_PageObject FinalMatrix.Concat(*pLastMatrix); CPDF_RenderStatus status; status.Initialize(this, pDevice, pLastMatrix, pStopObj, NULL, NULL, pOptions, - pItem->m_pObjectList->m_Transparency, FALSE, NULL); + pItem->m_pObjectList->m_Transparency, false, NULL); status.RenderObjectList(pItem->m_pObjectList, &FinalMatrix); if (status.m_Options.m_Flags & RENDER_LIMITEDIMAGECACHE) { m_pPageCache->CacheOptimization(status.m_Options.m_dwLimitCacheSize); @@ -996,7 +996,7 @@ void CPDF_RenderContext::Render(CFX_RenderDevice* pDevice, const CPDF_PageObject } else { CPDF_RenderStatus status; status.Initialize(this, pDevice, NULL, pStopObj, NULL, NULL, pOptions, - pItem->m_pObjectList->m_Transparency, FALSE, NULL); + pItem->m_pObjectList->m_Transparency, false, NULL); status.RenderObjectList(pItem->m_pObjectList, &pItem->m_Matrix); if (status.m_Options.m_Flags & RENDER_LIMITEDIMAGECACHE) { m_pPageCache->CacheOptimization(status.m_Options.m_dwLimitCacheSize); @@ -1090,7 +1090,7 @@ void CPDF_ProgressiveRenderer::Continue(IFX_Pause* pPause) m_pRenderStatus.reset(new CPDF_RenderStatus()); m_pRenderStatus->Initialize( m_pContext, m_pDevice, NULL, NULL, NULL, NULL, m_pOptions, - pItem->m_pObjectList->m_Transparency, FALSE, NULL); + pItem->m_pObjectList->m_Transparency, false, NULL); m_pDevice->SaveState(); m_ClipRect = m_pDevice->GetClipBox(); CFX_AffineMatrix device2object; @@ -1171,10 +1171,10 @@ CPDF_TransferFunc* CPDF_DocRenderData::GetTransferFunc(CPDF_Object* pObj) } CPDF_Function* pFuncs[3] = { nullptr, nullptr, nullptr }; - FX_BOOL bUniTransfer = TRUE; - FX_BOOL bIdentity = TRUE; + bool bUniTransfer = true; + bool bIdentity = true; if (pObj->GetType() == PDFOBJ_ARRAY) { - bUniTransfer = FALSE; + bUniTransfer = false; CPDF_Array* pArray = (CPDF_Array*)pObj; if (pArray->GetCount() < 3) return nullptr; @@ -1208,7 +1208,7 @@ CPDF_TransferFunc* CPDF_DocRenderData::GetTransferFunc(CPDF_Object* pObj) pFuncs[0]->Call(&input, 1, output, noutput); int o = FXSYS_round(output[0] * 255); if (o != v) - bIdentity = FALSE; + bIdentity = false; for (int i = 0; i < 3; ++i) { pTransfer->m_Samples[i * 256 + v] = o; } @@ -1218,7 +1218,7 @@ CPDF_TransferFunc* CPDF_DocRenderData::GetTransferFunc(CPDF_Object* pObj) pFuncs[i]->Call(&input, 1, output, noutput); int o = FXSYS_round(output[0] * 255); if (o != v) - bIdentity = FALSE; + bIdentity = false; pTransfer->m_Samples[i * 256 + v] = o; } else { pTransfer->m_Samples[i * 256 + v] = v; @@ -1258,7 +1258,7 @@ CPDF_DeviceBuffer::~CPDF_DeviceBuffer() { delete m_pBitmap; } -FX_BOOL CPDF_DeviceBuffer::Initialize(CPDF_RenderContext* pContext, CFX_RenderDevice* pDevice, FX_RECT* pRect, +bool CPDF_DeviceBuffer::Initialize(CPDF_RenderContext* pContext, CFX_RenderDevice* pDevice, FX_RECT* pRect, const CPDF_PageObject* pObj, int max_dpi) { m_pDevice = pDevice; @@ -1289,7 +1289,7 @@ FX_BOOL CPDF_DeviceBuffer::Initialize(CPDF_RenderContext* pContext, CFX_RenderDe FX_RECT bitmap_rect = rect.GetOutterRect(); m_pBitmap = new CFX_DIBitmap; m_pBitmap->Create(bitmap_rect.Width(), bitmap_rect.Height(), FXDIB_Argb); - return TRUE; + return true; } void CPDF_DeviceBuffer::OutputToDevice() { @@ -1316,13 +1316,13 @@ CPDF_ScaledRenderBuffer::~CPDF_ScaledRenderBuffer() delete m_pBitmapDevice; } #define _FPDFAPI_IMAGESIZE_LIMIT_ (30 * 1024 * 1024) -FX_BOOL CPDF_ScaledRenderBuffer::Initialize(CPDF_RenderContext* pContext, CFX_RenderDevice* pDevice, FX_RECT* pRect, +bool CPDF_ScaledRenderBuffer::Initialize(CPDF_RenderContext* pContext, CFX_RenderDevice* pDevice, FX_RECT* pRect, const CPDF_PageObject* pObj, const CPDF_RenderOptions *pOptions, int max_dpi) { FXSYS_assert(pRect != NULL); m_pDevice = pDevice; if (m_pDevice->GetDeviceCaps(FXDC_RENDER_CAPS) & FXRC_GET_BITS) { - return TRUE; + return true; } m_pContext = pContext; m_Rect = *pRect; @@ -1357,7 +1357,7 @@ FX_BOOL CPDF_ScaledRenderBuffer::Initialize(CPDF_RenderContext* pContext, CFX_Re iHeight = bitmap_rect.Height(); iPitch = (iWidth * bpp + 31) / 32 * 4; if (iWidth * iHeight < 1) { - return FALSE; + return false; } if (iPitch * iHeight <= _FPDFAPI_IMAGESIZE_LIMIT_ && m_pBitmapDevice->Create(iWidth, iHeight, dibFormat)) { @@ -1366,7 +1366,7 @@ FX_BOOL CPDF_ScaledRenderBuffer::Initialize(CPDF_RenderContext* pContext, CFX_Re m_Matrix.Scale(0.5f, 0.5f); } m_pContext->GetBackground(m_pBitmapDevice->GetBitmap(), m_pObject, pOptions, &m_Matrix); - return TRUE; + return true; } void CPDF_ScaledRenderBuffer::OutputToDevice() { @@ -1374,7 +1374,7 @@ void CPDF_ScaledRenderBuffer::OutputToDevice() m_pDevice->StretchDIBits(m_pBitmapDevice->GetBitmap(), m_Rect.left, m_Rect.top, m_Rect.Width(), m_Rect.Height()); } } -FX_BOOL IPDF_OCContext::CheckObjectVisible(const CPDF_PageObject* pObj) +bool IPDF_OCContext::CheckObjectVisible(const CPDF_PageObject* pObj) { const CPDF_ContentMarkData* pData = pObj->m_ContentMark; int nItems = pData->CountItems(); @@ -1383,9 +1383,9 @@ FX_BOOL IPDF_OCContext::CheckObjectVisible(const CPDF_PageObject* pObj) if (item.GetName() == FX_BSTRC("OC") && item.GetParamType() == CPDF_ContentMarkItem::PropertiesDict) { CPDF_Dictionary* pOCG = (CPDF_Dictionary*)item.GetParam(); if (!CheckOCGVisible(pOCG)) { - return FALSE; + return false; } } } - return TRUE; + return true; } diff --git a/core/src/fpdfapi/fpdf_render/fpdf_render_cache.cpp b/core/src/fpdfapi/fpdf_render/fpdf_render_cache.cpp index cdbecd65ea..d9767b4817 100644 --- a/core/src/fpdfapi/fpdf_render/fpdf_render_cache.cpp +++ b/core/src/fpdfapi/fpdf_render/fpdf_render_cache.cpp @@ -108,16 +108,16 @@ FX_DWORD CPDF_PageRenderCache::GetCachedSize(CPDF_Stream* pStream) const return pImageCache->EstimateSize(); } void CPDF_PageRenderCache::GetCachedBitmap(CPDF_Stream* pStream, CFX_DIBSource*& pBitmap, CFX_DIBSource*& pMask, FX_DWORD& MatteColor, - FX_BOOL bStdCS, FX_DWORD GroupFamily, FX_BOOL bLoadMask, CPDF_RenderStatus* pRenderStatus, + bool bStdCS, FX_DWORD GroupFamily, bool bLoadMask, CPDF_RenderStatus* pRenderStatus, int32_t downsampleWidth, int32_t downsampleHeight) { CPDF_ImageCache* pImageCache; - FX_BOOL bFind = m_ImageCaches.Lookup(pStream, (void*&)pImageCache); + bool bFind = m_ImageCaches.Lookup(pStream, (void*&)pImageCache); if (!bFind) { pImageCache = new CPDF_ImageCache(m_pPage->m_pDocument, pStream); } m_nTimeCount ++; - FX_BOOL bCached = pImageCache->GetCachedBitmap(pBitmap, pMask, MatteColor, m_pPage->m_pPageResources, bStdCS, GroupFamily, bLoadMask, pRenderStatus, downsampleWidth, downsampleHeight); + bool bCached = pImageCache->GetCachedBitmap(pBitmap, pMask, MatteColor, m_pPage->m_pPageResources, bStdCS, GroupFamily, bLoadMask, pRenderStatus, downsampleWidth, downsampleHeight); if (!bFind) { m_ImageCaches.SetAt(pStream, pImageCache); } @@ -125,7 +125,7 @@ void CPDF_PageRenderCache::GetCachedBitmap(CPDF_Stream* pStream, CFX_DIBSource*& m_nCacheSize += pImageCache->EstimateSize(); } } -FX_BOOL CPDF_PageRenderCache::StartGetCachedBitmap(CPDF_Stream* pStream, FX_BOOL bStdCS, FX_DWORD GroupFamily, FX_BOOL bLoadMask, CPDF_RenderStatus* pRenderStatus, int32_t downsampleWidth, int32_t downsampleHeight) +bool CPDF_PageRenderCache::StartGetCachedBitmap(CPDF_Stream* pStream, bool bStdCS, FX_DWORD GroupFamily, bool bLoadMask, CPDF_RenderStatus* pRenderStatus, int32_t downsampleWidth, int32_t downsampleHeight) { m_bCurFindCache = m_ImageCaches.Lookup(pStream, (void*&)m_pCurImageCache); if (!m_bCurFindCache) { @@ -133,7 +133,7 @@ FX_BOOL CPDF_PageRenderCache::StartGetCachedBitmap(CPDF_Stream* pStream, FX_BOOL } int ret = m_pCurImageCache->StartGetCachedBitmap(pRenderStatus->m_pFormResource, m_pPage->m_pPageResources, bStdCS, GroupFamily, bLoadMask, pRenderStatus, downsampleWidth, downsampleHeight); if (ret == 2) { - return TRUE; + return true; } m_nTimeCount ++; if (!m_bCurFindCache) { @@ -142,13 +142,13 @@ FX_BOOL CPDF_PageRenderCache::StartGetCachedBitmap(CPDF_Stream* pStream, FX_BOOL if (!ret) { m_nCacheSize += m_pCurImageCache->EstimateSize(); } - return FALSE; + return false; } -FX_BOOL CPDF_PageRenderCache::Continue(IFX_Pause* pPause) +bool CPDF_PageRenderCache::Continue(IFX_Pause* pPause) { int ret = m_pCurImageCache->Continue(pPause); if (ret == 2) { - return TRUE; + return true; } m_nTimeCount ++; if (!m_bCurFindCache) { @@ -157,7 +157,7 @@ FX_BOOL CPDF_PageRenderCache::Continue(IFX_Pause* pPause) if (!ret) { m_nCacheSize += m_pCurImageCache->EstimateSize(); } - return FALSE; + return false; } void CPDF_PageRenderCache::ResetBitmap(CPDF_Stream* pStream, const CFX_DIBitmap* pBitmap) { @@ -222,18 +222,18 @@ static FX_DWORD FPDF_ImageCache_EstimateImageSize(const CFX_DIBSource* pDIB) { return pDIB && pDIB->GetBuffer() ? (FX_DWORD)pDIB->GetHeight() * pDIB->GetPitch() + (FX_DWORD)pDIB->GetPaletteSize() * 4 : 0; } -FX_BOOL CPDF_ImageCache::GetCachedBitmap(CFX_DIBSource*& pBitmap, CFX_DIBSource*& pMask, FX_DWORD& MatteColor, CPDF_Dictionary* pPageResources, - FX_BOOL bStdCS, FX_DWORD GroupFamily, FX_BOOL bLoadMask, CPDF_RenderStatus* pRenderStatus, +bool CPDF_ImageCache::GetCachedBitmap(CFX_DIBSource*& pBitmap, CFX_DIBSource*& pMask, FX_DWORD& MatteColor, CPDF_Dictionary* pPageResources, + bool bStdCS, FX_DWORD GroupFamily, bool bLoadMask, CPDF_RenderStatus* pRenderStatus, int32_t downsampleWidth, int32_t downsampleHeight) { if (m_pCachedBitmap) { pBitmap = m_pCachedBitmap; pMask = m_pCachedMask; MatteColor = m_MatteColor; - return TRUE; + return true; } if (!pRenderStatus) { - return FALSE; + return false; } CPDF_RenderContext*pContext = pRenderStatus->GetContext(); CPDF_PageRenderCache* pPageRenderCache = pContext->m_pPageCache; @@ -243,7 +243,7 @@ FX_BOOL CPDF_ImageCache::GetCachedBitmap(CFX_DIBSource*& pBitmap, CFX_DIBSource* if (!pSrc->Load(m_pDocument, m_pStream, &pMaskSrc, &MatteColor, pRenderStatus->m_pFormResource, pPageResources, bStdCS, GroupFamily, bLoadMask)) { delete pSrc; pBitmap = NULL; - return FALSE; + return false; } m_MatteColor = MatteColor; if (pSrc->GetPitch() * pSrc->GetHeight() < FPDF_HUGE_IMAGE_SIZE) { @@ -260,7 +260,7 @@ FX_BOOL CPDF_ImageCache::GetCachedBitmap(CFX_DIBSource*& pBitmap, CFX_DIBSource* pBitmap = m_pCachedBitmap; pMask = m_pCachedMask; CalcSize(); - return FALSE; + return false; } CFX_DIBSource* CPDF_ImageCache::DetachBitmap() { @@ -274,8 +274,8 @@ CFX_DIBSource* CPDF_ImageCache::DetachMask() m_pCurMask = NULL; return pDIBSource; } -int CPDF_ImageCache::StartGetCachedBitmap(CPDF_Dictionary* pFormResources, CPDF_Dictionary* pPageResources, FX_BOOL bStdCS, - FX_DWORD GroupFamily, FX_BOOL bLoadMask, CPDF_RenderStatus* pRenderStatus, +int CPDF_ImageCache::StartGetCachedBitmap(CPDF_Dictionary* pFormResources, CPDF_Dictionary* pPageResources, bool bStdCS, + FX_DWORD GroupFamily, bool bLoadMask, CPDF_RenderStatus* pRenderStatus, int32_t downsampleWidth, int32_t downsampleHeight) { if (m_pCachedBitmap) { @@ -288,7 +288,7 @@ int CPDF_ImageCache::StartGetCachedBitmap(CPDF_Dictionary* pFormResources, CPDF_ } m_pRenderStatus = pRenderStatus; m_pCurBitmap = new CPDF_DIBSource; - int ret = ((CPDF_DIBSource*)m_pCurBitmap)->StartLoadDIBSource(m_pDocument, m_pStream, TRUE, pFormResources, pPageResources, bStdCS, GroupFamily, bLoadMask); + int ret = ((CPDF_DIBSource*)m_pCurBitmap)->StartLoadDIBSource(m_pDocument, m_pStream, true, pFormResources, pPageResources, bStdCS, GroupFamily, bLoadMask); if (ret == 2) { return ret; } @@ -347,7 +347,7 @@ void CPDF_Document::ClearRenderFont() if (m_pDocRender) { CFX_FontCache* pCache = m_pDocRender->GetFontCache(); if (pCache) { - pCache->FreeCache(FALSE); + pCache->FreeCache(false); } } } diff --git a/core/src/fpdfapi/fpdf_render/fpdf_render_image.cpp b/core/src/fpdfapi/fpdf_render/fpdf_render_image.cpp index fa9325a4d2..258ad111fa 100644 --- a/core/src/fpdfapi/fpdf_render/fpdf_render_image.cpp +++ b/core/src/fpdfapi/fpdf_render/fpdf_render_image.cpp @@ -13,7 +13,7 @@ #include "../fpdf_page/pageint.h" #include "render_int.h" -FX_BOOL CPDF_RenderStatus::ProcessImage(CPDF_ImageObject* pImageObj, const CFX_AffineMatrix* pObj2Device) +bool CPDF_RenderStatus::ProcessImage(CPDF_ImageObject* pImageObj, const CFX_AffineMatrix* pObj2Device) { CPDF_ImageRenderer render; if (render.Start(this, pImageObj, pObj2Device, m_bStdCS, m_curBlend)) { @@ -27,8 +27,8 @@ void CPDF_RenderStatus::CompositeDIBitmap(CFX_DIBitmap* pDIBitmap, int left, int if (pDIBitmap == NULL) { return; } - FX_BOOL bIsolated = Transparency & PDFTRANS_ISOLATED; - FX_BOOL bGroup = Transparency & PDFTRANS_GROUP; + bool bIsolated = Transparency & PDFTRANS_ISOLATED; + bool bGroup = Transparency & PDFTRANS_GROUP; if (blend_mode == FXDIB_BLEND_NORMAL) { if (!pDIBitmap->IsAlphaMask()) { if (bitmap_alpha < 255) { @@ -47,8 +47,8 @@ void CPDF_RenderStatus::CompositeDIBitmap(CFX_DIBitmap* pDIBitmap, int left, int } } } - FX_BOOL bBackAlphaRequired = blend_mode && bIsolated && !m_bDropObjects; - FX_BOOL bGetBackGround = ((m_pDevice->GetRenderCaps() & FXRC_ALPHA_OUTPUT)) || + bool bBackAlphaRequired = blend_mode && bIsolated && !m_bDropObjects; + bool bGetBackGround = ((m_pDevice->GetRenderCaps() & FXRC_ALPHA_OUTPUT)) || (!(m_pDevice->GetRenderCaps() & FXRC_ALPHA_OUTPUT) && (m_pDevice->GetRenderCaps() & FXRC_GET_BITS) && !bBackAlphaRequired); if (bGetBackGround) { @@ -61,9 +61,9 @@ void CPDF_RenderStatus::CompositeDIBitmap(CFX_DIBitmap* pDIBitmap, int left, int FX_RECT rect(left, top, left + pDIBitmap->GetWidth(), top + pDIBitmap->GetHeight()); rect.Intersect(m_pDevice->GetClipBox()); CFX_DIBitmap* pClone = NULL; - FX_BOOL bClone = FALSE; + bool bClone = false; if (m_pDevice->GetBackDrop() && m_pDevice->GetBitmap()) { - bClone = TRUE; + bClone = true; pClone = m_pDevice->GetBackDrop()->Clone(&rect); CFX_DIBitmap *pForeBitmap = m_pDevice->GetBitmap(); pClone->CompositeBitmap(0, 0, pClone->GetWidth(), pClone->GetHeight(), pForeBitmap, rect.left, rect.top); @@ -118,7 +118,7 @@ FX_COLORREF CPDF_TransferFunc::TranslateColor(FX_COLORREF rgb) return FXSYS_RGB(m_Samples[FXSYS_GetRValue(rgb)], m_Samples[256 + FXSYS_GetGValue(rgb)], m_Samples[512 + FXSYS_GetBValue(rgb)]); } -CFX_DIBSource* CPDF_TransferFunc::TranslateImage(const CFX_DIBSource* pSrc, FX_BOOL bAutoDropSrc) +CFX_DIBSource* CPDF_TransferFunc::TranslateImage(const CFX_DIBSource* pSrc, bool bAutoDropSrc) { CPDF_DIBTransferFunc* pDest = new CPDF_DIBTransferFunc(this); pDest->LoadSrc(pSrc, bAutoDropSrc); @@ -144,7 +144,7 @@ CPDF_DIBTransferFunc::CPDF_DIBTransferFunc(const CPDF_TransferFunc* pTransferFun void CPDF_DIBTransferFunc::TranslateScanline(uint8_t* dest_buf, const uint8_t* src_buf) const { int i; - FX_BOOL bSkip = FALSE; + bool bSkip = false; switch (m_pSrc->GetFormat()) { case FXDIB_1bppRgb: { int r0 = m_RampR[0], g0 = m_RampG[0], b0 = m_RampB[0]; @@ -213,7 +213,7 @@ void CPDF_DIBTransferFunc::TranslateScanline(uint8_t* dest_buf, const uint8_t* s } break; case FXDIB_Rgb32: - bSkip = TRUE; + bSkip = true; case FXDIB_Argb: for (i = 0; i < m_Width; i ++) { *dest_buf++ = m_RampB[*(src_buf++)]; @@ -266,31 +266,31 @@ void CPDF_DIBTransferFunc::TranslateDownSamples(uint8_t* dest_buf, const uint8_t } } } -static FX_BOOL _IsSupported(CPDF_ColorSpace* pCS) +static bool _IsSupported(CPDF_ColorSpace* pCS) { if (pCS->GetFamily() == PDFCS_DEVICERGB || pCS->GetFamily() == PDFCS_DEVICEGRAY || pCS->GetFamily() == PDFCS_DEVICECMYK || pCS->GetFamily() == PDFCS_CALGRAY || pCS->GetFamily() == PDFCS_CALRGB) { - return TRUE; + return true; } if (pCS->GetFamily() == PDFCS_INDEXED && _IsSupported(pCS->GetBaseCS())) { - return TRUE; + return true; } - return FALSE; + return false; } CPDF_ImageRenderer::CPDF_ImageRenderer() { m_pRenderStatus = NULL; m_pImageObject = NULL; - m_Result = TRUE; + m_Result = true; m_Status = 0; m_pQuickStretcher = NULL; m_pTransformer = NULL; m_DeviceHandle = NULL; m_LoadHandle = NULL; m_pClone = NULL; - m_bStdCS = FALSE; - m_bPatternColor = FALSE; + m_bStdCS = false; + m_bPatternColor = false; m_BlendType = FXDIB_BLEND_NORMAL; m_pPattern = NULL; m_pObj2Device = NULL; @@ -305,7 +305,7 @@ CPDF_ImageRenderer::~CPDF_ImageRenderer() delete (CPDF_ProgressiveImageLoaderHandle*)m_LoadHandle; delete m_pClone; } -FX_BOOL CPDF_ImageRenderer::StartLoadDIBSource() +bool CPDF_ImageRenderer::StartLoadDIBSource() { CFX_FloatRect image_rect_f = m_ImageMatrix.GetUnitRect(); FX_RECT image_rect = image_rect_f.GetOutterRect(); @@ -321,16 +321,16 @@ FX_BOOL CPDF_ImageRenderer::StartLoadDIBSource() m_pRenderStatus->m_GroupFamily, m_pRenderStatus->m_bLoadMask, m_pRenderStatus, dest_width, dest_height)) { if (m_LoadHandle != NULL) { m_Status = 4; - return TRUE; + return true; } - return FALSE; + return false; } - return FALSE; + return false; } -FX_BOOL CPDF_ImageRenderer::StartRenderDIBSource() +bool CPDF_ImageRenderer::StartRenderDIBSource() { if (m_Loader.m_pBitmap == NULL) { - return FALSE; + return false; } m_BitmapAlpha = 255; const CPDF_GeneralStateData* pGeneralState = m_pImageObject->m_GeneralState; @@ -350,18 +350,18 @@ FX_BOOL CPDF_ImageRenderer::StartRenderDIBSource() if (m_Loader.m_bCached && m_Loader.m_pMask) { m_Loader.m_pMask = m_Loader.m_pMask->Clone(); } - m_Loader.m_bCached = FALSE; + m_Loader.m_bCached = false; } } m_FillArgb = 0; - m_bPatternColor = FALSE; + m_bPatternColor = false; m_pPattern = NULL; if (m_pDIBSource->IsAlphaMask()) { CPDF_Color* pColor = m_pImageObject->m_ColorState.GetFillColor(); if (pColor && pColor->IsPattern()) { m_pPattern = pColor->GetPattern(); if (m_pPattern != NULL) { - m_bPatternColor = TRUE; + m_bPatternColor = true; } } m_FillArgb = m_pRenderStatus->GetFillArgb(m_pImageObject); @@ -430,7 +430,7 @@ FX_BOOL CPDF_ImageRenderer::StartRenderDIBSource() } return StartDIBSource(); } -FX_BOOL CPDF_ImageRenderer::Start(CPDF_RenderStatus* pStatus, const CPDF_PageObject* pObj, const CFX_AffineMatrix* pObj2Device, FX_BOOL bStdCS, int blendType) +bool CPDF_ImageRenderer::Start(CPDF_RenderStatus* pStatus, const CPDF_PageObject* pObj, const CFX_AffineMatrix* pObj2Device, bool bStdCS, int blendType) { m_pRenderStatus = pStatus; m_bStdCS = bStdCS; @@ -439,17 +439,17 @@ FX_BOOL CPDF_ImageRenderer::Start(CPDF_RenderStatus* pStatus, const CPDF_PageObj m_pObj2Device = pObj2Device; CPDF_Dictionary* pOC = m_pImageObject->m_pImage->GetOC(); if (pOC && m_pRenderStatus->m_Options.m_pOCContext && !m_pRenderStatus->m_Options.m_pOCContext->CheckOCGVisible(pOC)) { - return FALSE; + return false; } m_ImageMatrix = m_pImageObject->m_Matrix; m_ImageMatrix.Concat(*pObj2Device); if (StartLoadDIBSource()) { - return TRUE; + return true; } return StartRenderDIBSource(); } -FX_BOOL CPDF_ImageRenderer::Start(CPDF_RenderStatus* pStatus, const CFX_DIBSource* pDIBSource, FX_ARGB bitmap_argb, - int bitmap_alpha, const CFX_AffineMatrix* pImage2Device, FX_DWORD flags, FX_BOOL bStdCS, int blendType) +bool CPDF_ImageRenderer::Start(CPDF_RenderStatus* pStatus, const CFX_DIBSource* pDIBSource, FX_ARGB bitmap_argb, + int bitmap_alpha, const CFX_AffineMatrix* pImage2Device, FX_DWORD flags, bool bStdCS, int blendType) { m_pRenderStatus = pStatus; m_pDIBSource = pDIBSource; @@ -461,16 +461,16 @@ FX_BOOL CPDF_ImageRenderer::Start(CPDF_RenderStatus* pStatus, const CFX_DIBSourc m_BlendType = blendType; return StartDIBSource(); } -FX_BOOL CPDF_ImageRenderer::DrawPatternImage(const CFX_Matrix* pObj2Device) +bool CPDF_ImageRenderer::DrawPatternImage(const CFX_Matrix* pObj2Device) { if (m_pRenderStatus->m_bPrint && !(m_pRenderStatus->m_pDevice->GetRenderCaps() & FXRC_BLEND_MODE)) { - m_Result = FALSE; - return FALSE; + m_Result = false; + return false; } FX_RECT rect = m_ImageMatrix.GetUnitRect().GetOutterRect(); rect.Intersect(m_pRenderStatus->m_pDevice->GetClipBox()); if (rect.IsEmpty()) { - return FALSE; + return false; } CFX_AffineMatrix new_matrix = m_ImageMatrix; new_matrix.TranslateI(-rect.left, -rect.top); @@ -478,32 +478,32 @@ FX_BOOL CPDF_ImageRenderer::DrawPatternImage(const CFX_Matrix* pObj2Device) int height = rect.Height(); CFX_FxgeDevice bitmap_device1; if (!bitmap_device1.Create(rect.Width(), rect.Height(), FXDIB_Rgb32)) { - return TRUE; + return true; } bitmap_device1.GetBitmap()->Clear(0xffffff); { CPDF_RenderStatus bitmap_render; bitmap_render.Initialize(m_pRenderStatus->m_pContext, &bitmap_device1, NULL, NULL, - NULL, NULL, &m_pRenderStatus->m_Options, 0, m_pRenderStatus->m_bDropObjects, NULL, TRUE); + NULL, NULL, &m_pRenderStatus->m_Options, 0, m_pRenderStatus->m_bDropObjects, NULL, true); CFX_Matrix patternDevice = *pObj2Device; patternDevice.Translate((FX_FLOAT) - rect.left, (FX_FLOAT) - rect.top); if(m_pPattern->m_PatternType == PATTERN_TILING) { - bitmap_render.DrawTilingPattern((CPDF_TilingPattern*)m_pPattern, m_pImageObject, &patternDevice, FALSE); + bitmap_render.DrawTilingPattern((CPDF_TilingPattern*)m_pPattern, m_pImageObject, &patternDevice, false); } else { - bitmap_render.DrawShadingPattern((CPDF_ShadingPattern*)m_pPattern, m_pImageObject, &patternDevice, FALSE); + bitmap_render.DrawShadingPattern((CPDF_ShadingPattern*)m_pPattern, m_pImageObject, &patternDevice, false); } } { CFX_FxgeDevice bitmap_device2; if (!bitmap_device2.Create(rect.Width(), rect.Height(), FXDIB_8bppRgb)) { - return TRUE; + return true; } bitmap_device2.GetBitmap()->Clear(0); CPDF_RenderStatus bitmap_render; bitmap_render.Initialize(m_pRenderStatus->m_pContext, &bitmap_device2, NULL, NULL, - NULL, NULL, NULL, 0, m_pRenderStatus->m_bDropObjects, NULL, TRUE); + NULL, NULL, NULL, 0, m_pRenderStatus->m_bDropObjects, NULL, true); CPDF_ImageRenderer image_render; - if (image_render.Start(&bitmap_render, m_pDIBSource, 0xffffffff, 255, &new_matrix, m_Flags, TRUE)) { + if (image_render.Start(&bitmap_render, m_pDIBSource, 0xffffffff, 255, &new_matrix, m_Flags, true)) { image_render.Continue(NULL); } if (m_Loader.m_MatteColor != 0xffffffff) { @@ -549,18 +549,18 @@ FX_BOOL CPDF_ImageRenderer::DrawPatternImage(const CFX_Matrix* pObj2Device) bitmap_device1.GetBitmap()->MultiplyAlpha(255); } m_pRenderStatus->m_pDevice->SetDIBits(bitmap_device1.GetBitmap(), rect.left, rect.top, m_BlendType); - return FALSE; + return false; } -FX_BOOL CPDF_ImageRenderer::DrawMaskedImage() +bool CPDF_ImageRenderer::DrawMaskedImage() { if (m_pRenderStatus->m_bPrint && !(m_pRenderStatus->m_pDevice->GetRenderCaps() & FXRC_BLEND_MODE)) { - m_Result = FALSE; - return FALSE; + m_Result = false; + return false; } FX_RECT rect = m_ImageMatrix.GetUnitRect().GetOutterRect(); rect.Intersect(m_pRenderStatus->m_pDevice->GetClipBox()); if (rect.IsEmpty()) { - return FALSE; + return false; } CFX_AffineMatrix new_matrix = m_ImageMatrix; new_matrix.TranslateI(-rect.left, -rect.top); @@ -568,29 +568,29 @@ FX_BOOL CPDF_ImageRenderer::DrawMaskedImage() int height = rect.Height(); CFX_FxgeDevice bitmap_device1; if (!bitmap_device1.Create(width, height, FXDIB_Rgb32)) { - return TRUE; + return true; } bitmap_device1.GetBitmap()->Clear(0xffffff); { CPDF_RenderStatus bitmap_render; bitmap_render.Initialize(m_pRenderStatus->m_pContext, &bitmap_device1, NULL, NULL, - NULL, NULL, NULL, 0, m_pRenderStatus->m_bDropObjects, NULL, TRUE); + NULL, NULL, NULL, 0, m_pRenderStatus->m_bDropObjects, NULL, true); CPDF_ImageRenderer image_render; - if (image_render.Start(&bitmap_render, m_pDIBSource, 0, 255, &new_matrix, m_Flags, TRUE)) { + if (image_render.Start(&bitmap_render, m_pDIBSource, 0, 255, &new_matrix, m_Flags, true)) { image_render.Continue(NULL); } } { CFX_FxgeDevice bitmap_device2; if (!bitmap_device2.Create(width, height, FXDIB_8bppRgb)) { - return TRUE; + return true; } bitmap_device2.GetBitmap()->Clear(0); CPDF_RenderStatus bitmap_render; bitmap_render.Initialize(m_pRenderStatus->m_pContext, &bitmap_device2, NULL, NULL, - NULL, NULL, NULL, 0, m_pRenderStatus->m_bDropObjects, NULL, TRUE); + NULL, NULL, NULL, 0, m_pRenderStatus->m_bDropObjects, NULL, true); CPDF_ImageRenderer image_render; - if (image_render.Start(&bitmap_render, m_Loader.m_pMask, 0xffffffff, 255, &new_matrix, m_Flags, TRUE)) { + if (image_render.Start(&bitmap_render, m_Loader.m_pMask, 0xffffffff, 255, &new_matrix, m_Flags, true)) { image_render.Continue(NULL); } if (m_Loader.m_MatteColor != 0xffffffff) { @@ -638,9 +638,9 @@ FX_BOOL CPDF_ImageRenderer::DrawMaskedImage() } } m_pRenderStatus->m_pDevice->SetDIBits(bitmap_device1.GetBitmap(), rect.left, rect.top, m_BlendType); - return FALSE; + return false; } -FX_BOOL CPDF_ImageRenderer::StartDIBSource() +bool CPDF_ImageRenderer::StartDIBSource() { if (!(m_Flags & RENDER_FORCE_DOWNSAMPLE) && m_pDIBSource->GetBPP() > 1) { int image_size = m_pDIBSource->GetBPP() / 8 * m_pDIBSource->GetWidth() * m_pDIBSource->GetHeight(); @@ -652,9 +652,9 @@ FX_BOOL CPDF_ImageRenderer::StartDIBSource() &m_ImageMatrix, m_Flags, m_DeviceHandle, 0, NULL, m_BlendType)) { if (m_DeviceHandle != NULL) { m_Status = 3; - return TRUE; + return true; } - return FALSE; + return false; } CFX_FloatRect image_rect_f = m_ImageMatrix.GetUnitRect(); FX_RECT image_rect = image_rect_f.GetOutterRect(); @@ -663,15 +663,15 @@ FX_BOOL CPDF_ImageRenderer::StartDIBSource() if ((FXSYS_fabs(m_ImageMatrix.b) >= 0.5f || m_ImageMatrix.a == 0) || (FXSYS_fabs(m_ImageMatrix.c) >= 0.5f || m_ImageMatrix.d == 0) ) { if (m_pRenderStatus->m_bPrint && !(m_pRenderStatus->m_pDevice->GetRenderCaps() & FXRC_BLEND_MODE)) { - m_Result = FALSE; - return FALSE; + m_Result = false; + return false; } FX_RECT clip_box = m_pRenderStatus->m_pDevice->GetClipBox(); clip_box.Intersect(image_rect); m_Status = 2; m_pTransformer = new CFX_ImageTransformer; m_pTransformer->Start(m_pDIBSource, &m_ImageMatrix, m_Flags, &clip_box); - return TRUE; + return true; } if (m_ImageMatrix.a < 0) { dest_width = -dest_width; @@ -685,7 +685,7 @@ FX_BOOL CPDF_ImageRenderer::StartDIBSource() if (m_pDIBSource->IsOpaqueImage() && m_BitmapAlpha == 255) { if (m_pRenderStatus->m_pDevice->StretchDIBits(m_pDIBSource, dest_left, dest_top, dest_width, dest_height, m_Flags, NULL, m_BlendType)) { - return FALSE; + return false; } } if (m_pDIBSource->IsAlphaMask()) { @@ -693,12 +693,12 @@ FX_BOOL CPDF_ImageRenderer::StartDIBSource() m_FillArgb = FXARGB_MUL_ALPHA(m_FillArgb, m_BitmapAlpha); } if (m_pRenderStatus->m_pDevice->StretchBitMask(m_pDIBSource, dest_left, dest_top, dest_width, dest_height, m_FillArgb, m_Flags)) { - return FALSE; + return false; } } if (m_pRenderStatus->m_bPrint && !(m_pRenderStatus->m_pDevice->GetRenderCaps() & FXRC_BLEND_MODE)) { - m_Result = FALSE; - return TRUE; + m_Result = false; + return true; } FX_RECT clip_box = m_pRenderStatus->m_pDevice->GetClipBox(); FX_RECT dest_rect = clip_box; @@ -708,13 +708,13 @@ FX_BOOL CPDF_ImageRenderer::StartDIBSource() CFX_DIBitmap* pStretched = m_pDIBSource->StretchTo(dest_width, dest_height, m_Flags, &dest_clip); if (pStretched) { m_pRenderStatus->CompositeDIBitmap(pStretched, dest_rect.left, dest_rect.top, m_FillArgb, - m_BitmapAlpha, m_BlendType, FALSE); + m_BitmapAlpha, m_BlendType, false); delete pStretched; pStretched = NULL; } - return FALSE; + return false; } -FX_BOOL CPDF_ImageRenderer::StartBitmapAlpha() +bool CPDF_ImageRenderer::StartBitmapAlpha() { if (m_pDIBSource->IsOpaqueImage()) { CFX_PathData path; @@ -728,7 +728,7 @@ FX_BOOL CPDF_ImageRenderer::StartBitmapAlpha() int left, top; CFX_DIBitmap* pTransformed = pAlphaMask->TransformTo(&m_ImageMatrix, left, top); if (pTransformed == NULL) { - return TRUE; + return true; } m_pRenderStatus->m_pDevice->SetBitMask(pTransformed, left, top, ArgbEncode(0xff, m_BitmapAlpha, m_BitmapAlpha, m_BitmapAlpha)); delete pTransformed; @@ -746,13 +746,13 @@ FX_BOOL CPDF_ImageRenderer::StartBitmapAlpha() delete pAlphaMask; } } - return FALSE; + return false; } -FX_BOOL CPDF_ImageRenderer::Continue(IFX_Pause* pPause) +bool CPDF_ImageRenderer::Continue(IFX_Pause* pPause) { if (m_Status == 1) { if (m_pQuickStretcher->Continue(pPause)) { - return TRUE; + return true; } if (m_pQuickStretcher->m_pBitmap->IsAlphaMask()) m_pRenderStatus->m_pDevice->SetBitMask(m_pQuickStretcher->m_pBitmap, m_pQuickStretcher->m_ResultLeft, @@ -760,15 +760,15 @@ FX_BOOL CPDF_ImageRenderer::Continue(IFX_Pause* pPause) else m_pRenderStatus->m_pDevice->SetDIBits(m_pQuickStretcher->m_pBitmap, m_pQuickStretcher->m_ResultLeft, m_pQuickStretcher->m_ResultTop, m_BlendType); - return FALSE; + return false; } if (m_Status == 2) { if (m_pTransformer->Continue(pPause)) { - return TRUE; + return true; } CFX_DIBitmap* pBitmap = m_pTransformer->m_Storer.Detach(); if (pBitmap == NULL) { - return FALSE; + return false; } if (pBitmap->IsAlphaMask()) { if (m_BitmapAlpha != 255) { @@ -784,20 +784,20 @@ FX_BOOL CPDF_ImageRenderer::Continue(IFX_Pause* pPause) m_pTransformer->m_ResultLeft, m_pTransformer->m_ResultTop, m_BlendType); } delete pBitmap; - return FALSE; + return false; } if (m_Status == 3) { return m_pRenderStatus->m_pDevice->ContinueDIBits(m_DeviceHandle, pPause); } if (m_Status == 4) { if (m_Loader.Continue(m_LoadHandle, pPause)) { - return TRUE; + return true; } if (StartRenderDIBSource()) { return Continue(pPause); } } - return FALSE; + return false; } CPDF_QuickStretcher::CPDF_QuickStretcher() { @@ -815,10 +815,10 @@ CPDF_QuickStretcher::~CPDF_QuickStretcher() } ICodec_ScanlineDecoder* FPDFAPI_CreateFlateDecoder(const uint8_t* src_buf, FX_DWORD src_size, int width, int height, int nComps, int bpc, const CPDF_Dictionary* pParams); -FX_BOOL CPDF_QuickStretcher::Start(CPDF_ImageObject* pImageObj, CFX_AffineMatrix* pImage2Device, const FX_RECT* pClipBox) +bool CPDF_QuickStretcher::Start(CPDF_ImageObject* pImageObj, CFX_AffineMatrix* pImage2Device, const FX_RECT* pClipBox) { if (FXSYS_fabs(pImage2Device->a) < FXSYS_fabs(pImage2Device->b) * 10 && FXSYS_fabs(pImage2Device->d) < FXSYS_fabs(pImage2Device->c) * 10) { - return FALSE; + return false; } CFX_FloatRect image_rect_f = pImage2Device->GetUnitRect(); FX_RECT image_rect = image_rect_f.GetOutterRect(); @@ -829,7 +829,7 @@ FX_BOOL CPDF_QuickStretcher::Start(CPDF_ImageObject* pImageObj, CFX_AffineMatrix FX_RECT result_rect = *pClipBox; result_rect.Intersect(image_rect); if (result_rect.IsEmpty()) { - return FALSE; + return false; } m_ResultWidth = result_rect.Width(); m_ResultHeight = result_rect.Height(); @@ -839,10 +839,10 @@ FX_BOOL CPDF_QuickStretcher::Start(CPDF_ImageObject* pImageObj, CFX_AffineMatrix m_ClipTop = result_rect.top - image_rect.top; CPDF_Dictionary* pDict = pImageObj->m_pImage->GetDict(); if (pDict->GetInteger(FX_BSTRC("BitsPerComponent")) != 8) { - return FALSE; + return false; } if (pDict->KeyExist(FX_BSTRC("SMask")) || pDict->KeyExist(FX_BSTRC("Mask"))) { - return FALSE; + return false; } m_SrcWidth = pDict->GetInteger(FX_BSTRC("Width")); m_SrcHeight = pDict->GetInteger(FX_BSTRC("Height")); @@ -850,14 +850,14 @@ FX_BOOL CPDF_QuickStretcher::Start(CPDF_ImageObject* pImageObj, CFX_AffineMatrix m_Bpp = 3; CPDF_Object* pCSObj = pDict->GetElementValue(FX_BSTRC("ColorSpace")); if (pCSObj == NULL) { - return FALSE; + return false; } m_pCS = CPDF_ColorSpace::Load(pImageObj->m_pImage->GetDocument(), pCSObj); if (m_pCS == NULL) { - return FALSE; + return false; } if (!_IsSupported(m_pCS)) { - return FALSE; + return false; } m_Bpp = m_pCS->CountComponents(); if (m_pCS->sRGB()) { @@ -865,7 +865,7 @@ FX_BOOL CPDF_QuickStretcher::Start(CPDF_ImageObject* pImageObj, CFX_AffineMatrix m_pCS = NULL; } CPDF_Stream* pStream = pImageObj->m_pImage->GetStream(); - m_StreamAcc.LoadAllData(pStream, FALSE, m_SrcWidth * m_SrcHeight * m_Bpp, TRUE); + m_StreamAcc.LoadAllData(pStream, false, m_SrcWidth * m_SrcHeight * m_Bpp, true); m_pDecoder = NULL; if (!m_StreamAcc.GetImageDecoder().IsEmpty()) { if (m_StreamAcc.GetImageDecoder() == FX_BSTRC("DCTDecode")) { @@ -878,7 +878,7 @@ FX_BOOL CPDF_QuickStretcher::Start(CPDF_ImageObject* pImageObj, CFX_AffineMatrix m_StreamAcc.GetData(), m_StreamAcc.GetSize(), m_SrcWidth, m_SrcHeight, m_Bpp, 8, m_StreamAcc.GetImageParam()); } else { - return FALSE; + return false; } m_pDecoder->DownScale(m_DestWidth, m_DestHeight); } @@ -889,9 +889,9 @@ FX_BOOL CPDF_QuickStretcher::Start(CPDF_ImageObject* pImageObj, CFX_AffineMatrix m_pBitmap->Create(m_ResultWidth, m_ResultHeight, FXDIB_Rgb); #endif m_LineIndex = 0; - return TRUE; + return true; } -FX_BOOL CPDF_QuickStretcher::Continue(IFX_Pause* pPause) +bool CPDF_QuickStretcher::Continue(IFX_Pause* pPause) { uint8_t* result_buf = m_pBitmap->GetBuffer(); int src_width = m_pDecoder ? m_pDecoder->GetWidth() : m_SrcWidth; @@ -945,10 +945,10 @@ FX_BOOL CPDF_QuickStretcher::Continue(IFX_Pause* pPause) } m_LineIndex ++; if (pPause && pPause->NeedToPauseNow()) { - return TRUE; + return true; } } - return FALSE; + return false; } CFX_DIBitmap* CPDF_RenderStatus::LoadSMask(CPDF_Dictionary* pSMaskDict, FX_RECT* pClipRect, const CFX_AffineMatrix* pMatrix) @@ -959,7 +959,7 @@ CFX_DIBitmap* CPDF_RenderStatus::LoadSMask(CPDF_Dictionary* pSMaskDict, CFX_DIBitmap* pMask = NULL; int width = pClipRect->right - pClipRect->left; int height = pClipRect->bottom - pClipRect->top; - FX_BOOL bLuminosity = FALSE; + bool bLuminosity = false; bLuminosity = pSMaskDict->GetConstString(FX_BSTRC("S")) != FX_BSTRC("Alpha"); CPDF_Stream* pGroup = pSMaskDict->GetStream(FX_BSTRC("G")); if (pGroup == NULL) { @@ -1032,7 +1032,7 @@ CFX_DIBitmap* CPDF_RenderStatus::LoadSMask(CPDF_Dictionary* pSMaskDict, options.m_ColorMode = bLuminosity ? RENDER_COLOR_NORMAL : RENDER_COLOR_ALPHA; CPDF_RenderStatus status; status.Initialize(m_pContext, &bitmap_device, NULL, NULL, NULL, NULL, - &options, 0, m_bDropObjects, pFormResource, TRUE, NULL, 0, pCS ? pCS->GetFamily() : 0, bLuminosity); + &options, 0, m_bDropObjects, pFormResource, true, NULL, 0, pCS ? pCS->GetFamily() : 0, bLuminosity); status.RenderObjectList(&form, &matrix); pMask = new CFX_DIBitmap; if (!pMask->Create(width, height, FXDIB_8bppMask)) { diff --git a/core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp b/core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp index 7d17e78e24..0861048eb7 100644 --- a/core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp +++ b/core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp @@ -105,7 +105,7 @@ class JpxBitMapContext } // namespace -CFX_DIBSource* CPDF_Image::LoadDIBSource(CFX_DIBSource** ppMask, FX_DWORD* pMatteColor, FX_BOOL bStdCS, FX_DWORD GroupFamily, FX_BOOL bLoadMask) const +CFX_DIBSource* CPDF_Image::LoadDIBSource(CFX_DIBSource** ppMask, FX_DWORD* pMatteColor, bool bStdCS, FX_DWORD GroupFamily, bool bLoadMask) const { CPDF_DIBSource* pSource = new CPDF_DIBSource; if (pSource->Load(m_pDocument, m_pStream, (CPDF_DIBSource**)ppMask, pMatteColor, NULL, NULL, bStdCS, GroupFamily, bLoadMask)) { @@ -126,36 +126,36 @@ CFX_DIBSource* CPDF_Image::DetachMask() m_pMask = NULL; return pBitmap; } -FX_BOOL CPDF_Image::StartLoadDIBSource(CPDF_Dictionary* pFormResource, CPDF_Dictionary* pPageResource, FX_BOOL bStdCS, FX_DWORD GroupFamily, FX_BOOL bLoadMask) +bool CPDF_Image::StartLoadDIBSource(CPDF_Dictionary* pFormResource, CPDF_Dictionary* pPageResource, bool bStdCS, FX_DWORD GroupFamily, bool bLoadMask) { m_pDIBSource = new CPDF_DIBSource; - int ret = ((CPDF_DIBSource*)m_pDIBSource)->StartLoadDIBSource(m_pDocument, m_pStream, TRUE, pFormResource, pPageResource, bStdCS, GroupFamily, bLoadMask); + int ret = ((CPDF_DIBSource*)m_pDIBSource)->StartLoadDIBSource(m_pDocument, m_pStream, true, pFormResource, pPageResource, bStdCS, GroupFamily, bLoadMask); if (ret == 2) { - return TRUE; + return true; } if (!ret) { delete m_pDIBSource; m_pDIBSource = NULL; - return FALSE; + return false; } m_pMask = ((CPDF_DIBSource*)m_pDIBSource)->DetachMask(); m_MatteColor = ((CPDF_DIBSource*)m_pDIBSource)->m_MatteColor; - return FALSE; + return false; } -FX_BOOL CPDF_Image::Continue(IFX_Pause* pPause) +bool CPDF_Image::Continue(IFX_Pause* pPause) { int ret = ((CPDF_DIBSource*)m_pDIBSource)->ContinueLoadDIBSource(pPause); if (ret == 2) { - return TRUE; + return true; } if (!ret) { delete m_pDIBSource; m_pDIBSource = NULL; - return FALSE; + return false; } m_pMask = ((CPDF_DIBSource*)m_pDIBSource)->DetachMask(); m_MatteColor = ((CPDF_DIBSource*)m_pDIBSource)->m_MatteColor; - return FALSE; + return false; } CPDF_DIBSource::CPDF_DIBSource() { @@ -165,26 +165,26 @@ CPDF_DIBSource::CPDF_DIBSource() m_bpp = 0; m_Width = m_Height = 0; m_pColorSpace = NULL; - m_bDefaultDecode = TRUE; - m_bImageMask = FALSE; - m_bDoBpcCheck = TRUE; + m_bDefaultDecode = true; + m_bImageMask = false; + m_bDoBpcCheck = true; m_pPalette = NULL; m_pCompData = NULL; - m_bColorKey = FALSE; + m_bColorKey = false; m_pMaskedLine = m_pLineBuf = NULL; m_pDecoder = NULL; m_nComponents = 0; m_bpc = 0; - m_bLoadMask = FALSE; + m_bLoadMask = false; m_Family = 0; m_pMask = NULL; m_MatteColor = 0; m_pJbig2Context = NULL; m_pGlobalStream = NULL; - m_bStdCS = FALSE; + m_bStdCS = false; m_pMaskStream = NULL; m_Status = 0; - m_bHasMask = FALSE; + m_bHasMask = false; } CPDF_DIBSource::~CPDF_DIBSource() { @@ -220,43 +220,43 @@ void CPDF_DIBSource::ReleaseBitmap(CFX_DIBitmap* pBitmap) const delete pBitmap; } } -FX_BOOL CPDF_DIBSource::Load(CPDF_Document* pDoc, const CPDF_Stream* pStream, CPDF_DIBSource** ppMask, - FX_DWORD* pMatteColor, CPDF_Dictionary* pFormResources, CPDF_Dictionary* pPageResources, FX_BOOL bStdCS, FX_DWORD GroupFamily, FX_BOOL bLoadMask) +bool CPDF_DIBSource::Load(CPDF_Document* pDoc, const CPDF_Stream* pStream, CPDF_DIBSource** ppMask, + FX_DWORD* pMatteColor, CPDF_Dictionary* pFormResources, CPDF_Dictionary* pPageResources, bool bStdCS, FX_DWORD GroupFamily, bool bLoadMask) { if (pStream == NULL) { - return FALSE; + return false; } m_pDocument = pDoc; m_pDict = pStream->GetDict(); if (m_pDict == NULL) { - return FALSE; + return false; } m_pStream = pStream; m_Width = m_pDict->GetInteger(FX_BSTRC("Width")); m_Height = m_pDict->GetInteger(FX_BSTRC("Height")); if (m_Width <= 0 || m_Height <= 0 || m_Width > 0x01ffff || m_Height > 0x01ffff) { - return FALSE; + return false; } m_GroupFamily = GroupFamily; m_bLoadMask = bLoadMask; if (!LoadColorInfo(m_pStream->GetObjNum() != 0 ? NULL : pFormResources, pPageResources)) { - return FALSE; + return false; } if (m_bDoBpcCheck && (m_bpc == 0 || m_nComponents == 0)) { - return FALSE; + return false; } FX_SAFE_DWORD src_pitch = CalculatePitch8(m_bpc, m_nComponents, m_Width, m_Height); if (!src_pitch.IsValid()) { - return FALSE; + return false; } m_pStreamAcc = new CPDF_StreamAcc; - m_pStreamAcc->LoadAllData(pStream, FALSE, src_pitch.ValueOrDie(), TRUE); + m_pStreamAcc->LoadAllData(pStream, false, src_pitch.ValueOrDie(), true); if (m_pStreamAcc->GetSize() == 0 || m_pStreamAcc->GetData() == NULL) { - return FALSE; + return false; } if (!CreateDecoder()) { - return FALSE; + return false; } if (m_bImageMask) { m_bpp = 1; @@ -272,11 +272,11 @@ FX_BOOL CPDF_DIBSource::Load(CPDF_Document* pDoc, const CPDF_Stream* pStream, CP } FX_SAFE_DWORD pitch = CalculatePitch32(m_bpp, m_Width); if (!pitch.IsValid()) { - return FALSE; + return false; } m_pLineBuf = FX_Alloc(uint8_t, pitch.ValueOrDie()); if (m_pColorSpace && bStdCS) { - m_pColorSpace->EnableStdConversion(TRUE); + m_pColorSpace->EnableStdConversion(true); } LoadPalette(); if (m_bColorKey) { @@ -284,7 +284,7 @@ FX_BOOL CPDF_DIBSource::Load(CPDF_Document* pDoc, const CPDF_Stream* pStream, CP m_AlphaFlag = 2; pitch = CalculatePitch32(m_bpp, m_Width); if (!pitch.IsValid()) { - return FALSE; + return false; } m_pMaskedLine = FX_Alloc(uint8_t, pitch.ValueOrDie()); } @@ -293,9 +293,9 @@ FX_BOOL CPDF_DIBSource::Load(CPDF_Document* pDoc, const CPDF_Stream* pStream, CP *ppMask = LoadMask(*pMatteColor); } if (m_pColorSpace && bStdCS) { - m_pColorSpace->EnableStdConversion(FALSE); + m_pColorSpace->EnableStdConversion(false); } - return TRUE; + return true; } int CPDF_DIBSource::ContinueToLoadMask() { @@ -320,7 +320,7 @@ int CPDF_DIBSource::ContinueToLoadMask() } m_pLineBuf = FX_Alloc(uint8_t, pitch.ValueOrDie()); if (m_pColorSpace && m_bStdCS) { - m_pColorSpace->EnableStdConversion(TRUE); + m_pColorSpace->EnableStdConversion(true); } LoadPalette(); if (m_bColorKey) { @@ -335,9 +335,9 @@ int CPDF_DIBSource::ContinueToLoadMask() m_Pitch = pitch.ValueOrDie(); return 1; } -int CPDF_DIBSource::StartLoadDIBSource(CPDF_Document* pDoc, const CPDF_Stream* pStream, FX_BOOL bHasMask, +int CPDF_DIBSource::StartLoadDIBSource(CPDF_Document* pDoc, const CPDF_Stream* pStream, bool bHasMask, CPDF_Dictionary* pFormResources, CPDF_Dictionary* pPageResources, - FX_BOOL bStdCS, FX_DWORD GroupFamily, FX_BOOL bLoadMask) + bool bStdCS, FX_DWORD GroupFamily, bool bLoadMask) { if (pStream == NULL) { return 0; @@ -366,7 +366,7 @@ int CPDF_DIBSource::StartLoadDIBSource(CPDF_Document* pDoc, const CPDF_Stream* p return 0; } m_pStreamAcc = new CPDF_StreamAcc; - m_pStreamAcc->LoadAllData(pStream, FALSE, src_pitch.ValueOrDie(), TRUE); + m_pStreamAcc->LoadAllData(pStream, false, src_pitch.ValueOrDie(), true); if (m_pStreamAcc->GetSize() == 0 || m_pStreamAcc->GetData() == NULL) { return 0; } @@ -393,7 +393,7 @@ int CPDF_DIBSource::StartLoadDIBSource(CPDF_Document* pDoc, const CPDF_Stream* p return ret; } if (m_pColorSpace && m_bStdCS) { - m_pColorSpace->EnableStdConversion(FALSE); + m_pColorSpace->EnableStdConversion(false); } return ret; } @@ -412,7 +412,7 @@ int CPDF_DIBSource::ContinueLoadDIBSource(IFX_Pause* pPause) CPDF_Stream* pGlobals = m_pStreamAcc->GetImageParam()->GetStream(FX_BSTRC("JBIG2Globals")); if (pGlobals) { m_pGlobalStream = new CPDF_StreamAcc; - m_pGlobalStream->LoadAllData(pGlobals, FALSE); + m_pGlobalStream->LoadAllData(pGlobals, false); } } ret = pJbig2Module->StartDecode(m_pJbig2Context, m_Width, m_Height, m_pStreamAcc->GetData(), m_pStreamAcc->GetSize(), @@ -438,7 +438,7 @@ int CPDF_DIBSource::ContinueLoadDIBSource(IFX_Pause* pPause) return ret1; } if (m_pColorSpace && m_bStdCS) { - m_pColorSpace->EnableStdConversion(FALSE); + m_pColorSpace->EnableStdConversion(false); } return ret1; } @@ -463,7 +463,7 @@ int CPDF_DIBSource::ContinueLoadDIBSource(IFX_Pause* pPause) return ret1; } if (m_pColorSpace && m_bStdCS) { - m_pColorSpace->EnableStdConversion(FALSE); + m_pColorSpace->EnableStdConversion(false); } return ret1; } @@ -472,11 +472,11 @@ int CPDF_DIBSource::ContinueLoadDIBSource(IFX_Pause* pPause) } return 0; } -FX_BOOL CPDF_DIBSource::LoadColorInfo(CPDF_Dictionary* pFormResources, CPDF_Dictionary* pPageResources) +bool CPDF_DIBSource::LoadColorInfo(CPDF_Dictionary* pFormResources, CPDF_Dictionary* pPageResources) { m_bpc_orig = m_pDict->GetInteger(FX_BSTRC("BitsPerComponent")); if (m_pDict->GetInteger("ImageMask")) { - m_bImageMask = TRUE; + m_bImageMask = true; } if (m_bImageMask || !m_pDict->KeyExist(FX_BSTRC("ColorSpace"))) { if (!m_bImageMask) { @@ -486,27 +486,27 @@ FX_BOOL CPDF_DIBSource::LoadColorInfo(CPDF_Dictionary* pFormResources, CPDF_Dict if (pFilter->GetType() == PDFOBJ_NAME) { filter = pFilter->GetString(); if (filter == FX_BSTRC("JPXDecode")) { - m_bDoBpcCheck = FALSE; - return TRUE; + m_bDoBpcCheck = false; + return true; } } else if (pFilter->GetType() == PDFOBJ_ARRAY) { CPDF_Array* pArray = (CPDF_Array*)pFilter; if (pArray->GetString(pArray->GetCount() - 1) == FX_BSTRC("JPXDecode")) { - m_bDoBpcCheck = FALSE; - return TRUE; + m_bDoBpcCheck = false; + return true; } } } } - m_bImageMask = TRUE; + m_bImageMask = true; m_bpc = m_nComponents = 1; CPDF_Array* pDecode = m_pDict->GetArray(FX_BSTRC("Decode")); m_bDefaultDecode = pDecode == NULL || pDecode->GetInteger(0) == 0; - return TRUE; + return true; } CPDF_Object* pCSObj = m_pDict->GetElementValue(FX_BSTRC("ColorSpace")); if (pCSObj == NULL) { - return FALSE; + return false; } CPDF_DocPageData* pDocPageData = m_pDocument->GetPageData(); if (pFormResources) { @@ -516,7 +516,7 @@ FX_BOOL CPDF_DIBSource::LoadColorInfo(CPDF_Dictionary* pFormResources, CPDF_Dict m_pColorSpace = pDocPageData->GetColorSpace(pCSObj, pPageResources); } if (m_pColorSpace == NULL) { - return FALSE; + return false; } m_Family = m_pColorSpace->GetFamily(); m_nComponents = m_pColorSpace->CountComponents(); @@ -533,11 +533,11 @@ FX_BOOL CPDF_DIBSource::LoadColorInfo(CPDF_Dictionary* pFormResources, CPDF_Dict ValidateDictParam(); m_pCompData = GetDecodeAndMaskArray(m_bDefaultDecode, m_bColorKey); if (m_pCompData == NULL) { - return FALSE; + return false; } - return TRUE; + return true; } -DIB_COMP_DATA* CPDF_DIBSource::GetDecodeAndMaskArray(FX_BOOL& bDefaultDecode, FX_BOOL& bColorKey) +DIB_COMP_DATA* CPDF_DIBSource::GetDecodeAndMaskArray(bool& bDefaultDecode, bool& bColorKey) { if (m_pColorSpace == NULL) { return NULL; @@ -556,7 +556,7 @@ DIB_COMP_DATA* CPDF_DIBSource::GetDecodeAndMaskArray(FX_BOOL& bDefaultDecode, FX def_max = (FX_FLOAT)max_data; } if (def_min != pCompData[i].m_DecodeMin || def_max != max) { - bDefaultDecode = FALSE; + bDefaultDecode = false; } } } else { @@ -584,7 +584,7 @@ DIB_COMP_DATA* CPDF_DIBSource::GetDecodeAndMaskArray(FX_BOOL& bDefaultDecode, FX pCompData[i].m_ColorKeyMax = FX_MIN(max_num, max_data); } } - bColorKey = TRUE; + bColorKey = true; } } return pCompData; @@ -612,7 +612,7 @@ int CPDF_DIBSource::CreateDecoder() src_data, src_size, m_Width, m_Height, m_nComponents, pParams ? pParams->GetInteger("ColorTransform", 1) : 1); if (!m_pDecoder) { - FX_BOOL bTransform = FALSE; + bool bTransform = false; int comps, bpc; ICodec_JpegModule* pJpegModule = CPDF_ModuleMgr::Get()->GetJpegModule(); if (pJpegModule->LoadInfo(src_data, src_size, m_Width, m_Height, comps, bpc, bTransform)) { @@ -693,29 +693,29 @@ void CPDF_DIBSource::LoadJpxBitmap() return; int output_nComps; - FX_BOOL bTranslateColor; - FX_BOOL bSwapRGB = FALSE; + bool bTranslateColor; + bool bSwapRGB = false; if (m_pColorSpace) { if (codestream_nComps != (FX_DWORD)m_pColorSpace->CountComponents()) return; output_nComps = codestream_nComps; - bTranslateColor = FALSE; + bTranslateColor = false; if (m_pColorSpace == CPDF_ColorSpace::GetStockCS(PDFCS_DEVICERGB)) { - bSwapRGB = TRUE; + bSwapRGB = true; m_pColorSpace = nullptr; } } else { - bTranslateColor = TRUE; + bTranslateColor = true; if (image_nComps) { output_nComps = image_nComps; } else { output_nComps = codestream_nComps; } if (output_nComps == 3) { - bSwapRGB = TRUE; + bSwapRGB = true; } else if (output_nComps == 4) { m_pColorSpace = CPDF_ColorSpace::GetStockCS(PDFCS_DEVICECMYK); - bTranslateColor = FALSE; + bTranslateColor = false; } m_nComponents = output_nComps; } @@ -829,7 +829,7 @@ int CPDF_DIBSource::ContinueLoadMaskDIB(IFX_Pause* pPause) return ret; } if (m_pColorSpace && m_bStdCS) { - m_pColorSpace->EnableStdConversion(FALSE); + m_pColorSpace->EnableStdConversion(false); } if (!ret) { delete m_pMask; @@ -847,7 +847,7 @@ CPDF_DIBSource* CPDF_DIBSource::DetachMask() CPDF_DIBSource* CPDF_DIBSource::LoadMaskDIB(CPDF_Stream* pMask) { CPDF_DIBSource* pMaskSource = new CPDF_DIBSource; - if (!pMaskSource->Load(m_pDocument, pMask, NULL, NULL, NULL, NULL, TRUE)) { + if (!pMaskSource->Load(m_pDocument, pMask, NULL, NULL, NULL, NULL, true)) { delete pMaskSource; return NULL; } @@ -856,7 +856,7 @@ CPDF_DIBSource* CPDF_DIBSource::LoadMaskDIB(CPDF_Stream* pMask) int CPDF_DIBSource::StartLoadMaskDIB() { m_pMask = new CPDF_DIBSource; - int ret = m_pMask->StartLoadDIBSource(m_pDocument, (CPDF_Stream*)m_pMaskStream, FALSE, NULL, NULL, TRUE); + int ret = m_pMask->StartLoadDIBSource(m_pDocument, (CPDF_Stream*)m_pMaskStream, false, NULL, NULL, true); if (ret == 2) { if (m_Status == 0) { m_Status = 2; @@ -1209,15 +1209,15 @@ const uint8_t* CPDF_DIBSource::GetScanline(int line) const } return pSrcLine; } -FX_BOOL CPDF_DIBSource::SkipToScanline(int line, IFX_Pause* pPause) const +bool CPDF_DIBSource::SkipToScanline(int line, IFX_Pause* pPause) const { if (m_pDecoder) { return m_pDecoder->SkipToScanline(line, pPause); } - return FALSE; + return false; } void CPDF_DIBSource::DownSampleScanline(int line, uint8_t* dest_scan, int dest_bpp, - int dest_width, FX_BOOL bFlipX, int clip_left, int clip_width) const + int dest_width, bool bFlipX, int clip_left, int clip_width) const { if (line < 0 || dest_scan == NULL || dest_bpp <= 0 || dest_width <= 0 || clip_left < 0 || clip_width <= 0) { @@ -1480,26 +1480,26 @@ CPDF_ProgressiveImageLoaderHandle::CPDF_ProgressiveImageLoaderHandle() CPDF_ProgressiveImageLoaderHandle::~CPDF_ProgressiveImageLoaderHandle() { } -FX_BOOL CPDF_ProgressiveImageLoaderHandle::Start(CPDF_ImageLoader* pImageLoader, const CPDF_ImageObject* pImage, CPDF_PageRenderCache* pCache, FX_BOOL bStdCS, FX_DWORD GroupFamily, FX_BOOL bLoadMask, CPDF_RenderStatus* pRenderStatus, int32_t nDownsampleWidth, int32_t nDownsampleHeight) +bool CPDF_ProgressiveImageLoaderHandle::Start(CPDF_ImageLoader* pImageLoader, const CPDF_ImageObject* pImage, CPDF_PageRenderCache* pCache, bool bStdCS, FX_DWORD GroupFamily, bool bLoadMask, CPDF_RenderStatus* pRenderStatus, int32_t nDownsampleWidth, int32_t nDownsampleHeight) { m_pImageLoader = pImageLoader; m_pCache = pCache; m_pImage = (CPDF_ImageObject*)pImage; m_nDownsampleWidth = nDownsampleWidth; m_nDownsampleHeight = nDownsampleHeight; - FX_BOOL ret; + bool ret; if (pCache) { ret = pCache->StartGetCachedBitmap(pImage->m_pImage->GetStream(), bStdCS, GroupFamily, bLoadMask, pRenderStatus, m_nDownsampleWidth, m_nDownsampleHeight); - if (ret == FALSE) { - m_pImageLoader->m_bCached = TRUE; + if (ret == false) { + m_pImageLoader->m_bCached = true; m_pImageLoader->m_pBitmap = pCache->m_pCurImageCache->DetachBitmap(); m_pImageLoader->m_pMask = pCache->m_pCurImageCache->DetachMask(); m_pImageLoader->m_MatteColor = pCache->m_pCurImageCache->m_MatteColor; } } else { ret = pImage->m_pImage->StartLoadDIBSource(pRenderStatus->m_pFormResource, pRenderStatus->m_pPageResource, bStdCS, GroupFamily, bLoadMask); - if (ret == FALSE) { - m_pImageLoader->m_bCached = FALSE; + if (ret == false) { + m_pImageLoader->m_bCached = false; m_pImageLoader->m_pBitmap = m_pImage->m_pImage->DetachBitmap(); m_pImageLoader->m_pMask = m_pImage->m_pImage->DetachMask(); m_pImageLoader->m_MatteColor = m_pImage->m_pImage->m_MatteColor; @@ -1507,21 +1507,21 @@ FX_BOOL CPDF_ProgressiveImageLoaderHandle::Start(CPDF_ImageLoader* pImageLoader, } return ret; } -FX_BOOL CPDF_ProgressiveImageLoaderHandle::Continue(IFX_Pause* pPause) +bool CPDF_ProgressiveImageLoaderHandle::Continue(IFX_Pause* pPause) { - FX_BOOL ret; + bool ret; if (m_pCache) { ret = m_pCache->Continue(pPause); - if (ret == FALSE) { - m_pImageLoader->m_bCached = TRUE; + if (ret == false) { + m_pImageLoader->m_bCached = true; m_pImageLoader->m_pBitmap = m_pCache->m_pCurImageCache->DetachBitmap(); m_pImageLoader->m_pMask = m_pCache->m_pCurImageCache->DetachMask(); m_pImageLoader->m_MatteColor = m_pCache->m_pCurImageCache->m_MatteColor; } } else { ret = m_pImage->m_pImage->Continue(pPause); - if (ret == FALSE) { - m_pImageLoader->m_bCached = FALSE; + if (ret == false) { + m_pImageLoader->m_bCached = false; m_pImageLoader->m_pBitmap = m_pImage->m_pImage->DetachBitmap(); m_pImageLoader->m_pMask = m_pImage->m_pImage->DetachMask(); m_pImageLoader->m_MatteColor = m_pImage->m_pImage->m_MatteColor; @@ -1529,30 +1529,30 @@ FX_BOOL CPDF_ProgressiveImageLoaderHandle::Continue(IFX_Pause* pPause) } return ret; } -FX_BOOL CPDF_ImageLoader::Load(const CPDF_ImageObject* pImage, CPDF_PageRenderCache* pCache, FX_BOOL bStdCS, FX_DWORD GroupFamily, FX_BOOL bLoadMask, CPDF_RenderStatus* pRenderStatus) +bool CPDF_ImageLoader::Load(const CPDF_ImageObject* pImage, CPDF_PageRenderCache* pCache, bool bStdCS, FX_DWORD GroupFamily, bool bLoadMask, CPDF_RenderStatus* pRenderStatus) { if (pImage == NULL) { - return FALSE; + return false; } if (pCache) { pCache->GetCachedBitmap(pImage->m_pImage->GetStream(), m_pBitmap, m_pMask, m_MatteColor, bStdCS, GroupFamily, bLoadMask, pRenderStatus, m_nDownsampleWidth, m_nDownsampleHeight); - m_bCached = TRUE; + m_bCached = true; } else { m_pBitmap = pImage->m_pImage->LoadDIBSource(&m_pMask, &m_MatteColor, bStdCS, GroupFamily, bLoadMask); - m_bCached = FALSE; + m_bCached = false; } - return FALSE; + return false; } -FX_BOOL CPDF_ImageLoader::StartLoadImage(const CPDF_ImageObject* pImage, CPDF_PageRenderCache* pCache, void*& LoadHandle, FX_BOOL bStdCS, FX_DWORD GroupFamily, FX_BOOL bLoadMask, CPDF_RenderStatus* pRenderStatus, int32_t nDownsampleWidth, int32_t nDownsampleHeight) +bool CPDF_ImageLoader::StartLoadImage(const CPDF_ImageObject* pImage, CPDF_PageRenderCache* pCache, void*& LoadHandle, bool bStdCS, FX_DWORD GroupFamily, bool bLoadMask, CPDF_RenderStatus* pRenderStatus, int32_t nDownsampleWidth, int32_t nDownsampleHeight) { m_nDownsampleWidth = nDownsampleWidth; m_nDownsampleHeight = nDownsampleHeight; CPDF_ProgressiveImageLoaderHandle* pLoaderHandle = new CPDF_ProgressiveImageLoaderHandle; - FX_BOOL ret = pLoaderHandle->Start(this, pImage, pCache, bStdCS, GroupFamily, bLoadMask, pRenderStatus, m_nDownsampleWidth, m_nDownsampleHeight); + bool ret = pLoaderHandle->Start(this, pImage, pCache, bStdCS, GroupFamily, bLoadMask, pRenderStatus, m_nDownsampleWidth, m_nDownsampleHeight); LoadHandle = pLoaderHandle; return ret; } -FX_BOOL CPDF_ImageLoader::Continue(void* LoadHandle, IFX_Pause* pPause) +bool CPDF_ImageLoader::Continue(void* LoadHandle, IFX_Pause* pPause) { return ((CPDF_ProgressiveImageLoaderHandle*)LoadHandle)->Continue(pPause); } diff --git a/core/src/fpdfapi/fpdf_render/fpdf_render_pattern.cpp b/core/src/fpdfapi/fpdf_render/fpdf_render_pattern.cpp index 3ee2222d8b..e08649062c 100644 --- a/core/src/fpdfapi/fpdf_render/fpdf_render_pattern.cpp +++ b/core/src/fpdfapi/fpdf_render/fpdf_render_pattern.cpp @@ -29,7 +29,7 @@ static void _DrawAxialShading(CFX_DIBitmap* pBitmap, CFX_AffineMatrix* pObject2B t_min = pArray->GetNumber(0); t_max = pArray->GetNumber(1); } - FX_BOOL bStartExtend = FALSE, bEndExtend = FALSE; + bool bStartExtend = false, bEndExtend = false; pArray = pDict->GetArray(FX_BSTRC("Extend")); if (pArray) { bStartExtend = pArray->GetInteger(0); @@ -116,7 +116,7 @@ static void _DrawRadialShading(CFX_DIBitmap* pBitmap, CFX_AffineMatrix* pObject2 t_min = pArray->GetNumber(0); t_max = pArray->GetNumber(1); } - FX_BOOL bStartExtend = FALSE, bEndExtend = FALSE; + bool bStartExtend = false, bEndExtend = false; pArray = pDict->GetArray(FX_BSTRC("Extend")); if (pArray) { bStartExtend = pArray->GetInteger(0); @@ -155,11 +155,11 @@ static void _DrawRadialShading(CFX_DIBitmap* pBitmap, CFX_AffineMatrix* pObject2 int width = pBitmap->GetWidth(); int height = pBitmap->GetHeight(); int pitch = pBitmap->GetPitch(); - FX_BOOL bDecreasing = FALSE; + bool bDecreasing = false; if (start_r > end_r) { int length = (int)FXSYS_sqrt((FXSYS_Mul(start_x - end_x, start_x - end_x) + FXSYS_Mul(start_y - end_y, start_y - end_y))); if (length < start_r - end_r) { - bDecreasing = TRUE; + bDecreasing = true; } } for (int row = 0; row < height; row ++) { @@ -281,22 +281,22 @@ static void _DrawFuncShading(CFX_DIBitmap* pBitmap, CFX_AffineMatrix* pObject2Bi } } } -FX_BOOL _GetScanlineIntersect(int y, FX_FLOAT x1, FX_FLOAT y1, FX_FLOAT x2, FX_FLOAT y2, FX_FLOAT& x) +bool _GetScanlineIntersect(int y, FX_FLOAT x1, FX_FLOAT y1, FX_FLOAT x2, FX_FLOAT y2, FX_FLOAT& x) { if (y1 == y2) { - return FALSE; + return false; } if (y1 < y2) { if (y < y1 || y > y2) { - return FALSE; + return false; } } else { if (y < y2 || y > y1) { - return FALSE; + return false; } } x = x1 + FXSYS_MulDiv(x2 - x1, y - y1, y2 - y1); - return TRUE; + return true; } static void _DrawGouraud(CFX_DIBitmap* pBitmap, int alpha, CPDF_MeshVertex triangle[3]) { @@ -325,7 +325,7 @@ static void _DrawGouraud(CFX_DIBitmap* pBitmap, int alpha, CPDF_MeshVertex trian for (int i = 0; i < 3; i ++) { CPDF_MeshVertex& vertex1 = triangle[i]; CPDF_MeshVertex& vertex2 = triangle[(i + 1) % 3]; - FX_BOOL bIntersect = _GetScanlineIntersect(y, vertex1.x, vertex1.y, + bool bIntersect = _GetScanlineIntersect(y, vertex1.x, vertex1.y, vertex2.x, vertex2.y, inter_x[nIntersects]); if (!bIntersect) { continue; @@ -601,7 +601,7 @@ struct CPDF_PatchDrawer { int alpha; void Draw(int x_scale, int y_scale, int left, int bottom, Coon_Bezier C1, Coon_Bezier C2, Coon_Bezier D1, Coon_Bezier D2) { - FX_BOOL bSmall = C1.Distance() < 2 && C2.Distance() < 2 && D1.Distance() < 2 && D2.Distance() < 2; + bool bSmall = C1.Distance() < 2 && C2.Distance() < 2 && D1.Distance() < 2 && D2.Distance() < 2; Coon_Color div_colors[4]; int d_bottom, d_left, d_top, d_right; div_colors[0].BiInterpol(patch_colors, left, bottom, x_scale, y_scale); @@ -663,9 +663,9 @@ struct CPDF_PatchDrawer { } }; -FX_BOOL _CheckCoonTensorPara(const CPDF_MeshStream &stream) +bool _CheckCoonTensorPara(const CPDF_MeshStream &stream) { - FX_BOOL bCoorBits = ( stream.m_nCoordBits== 1 || + bool bCoorBits = ( stream.m_nCoordBits== 1 || stream.m_nCoordBits == 2 || stream.m_nCoordBits == 4 || stream.m_nCoordBits == 8 || @@ -674,21 +674,21 @@ FX_BOOL _CheckCoonTensorPara(const CPDF_MeshStream &stream) stream.m_nCoordBits == 24 || stream.m_nCoordBits == 32 ); - FX_BOOL bCompBits = ( stream.m_nCompBits == 1 || + bool bCompBits = ( stream.m_nCompBits == 1 || stream.m_nCompBits == 2 || stream.m_nCompBits == 4 || stream.m_nCompBits == 8 || stream.m_nCompBits == 12 || stream.m_nCompBits == 16 ); - FX_BOOL bFlagBits = ( stream.m_nFlagBits == 2 || + bool bFlagBits = ( stream.m_nFlagBits == 2 || stream.m_nFlagBits == 4 || stream.m_nFlagBits == 8 ); return bCoorBits && bCompBits && bFlagBits; } -static void _DrawCoonPatchMeshes(FX_BOOL bTensor, CFX_DIBitmap* pBitmap, CFX_AffineMatrix* pObject2Bitmap, +static void _DrawCoonPatchMeshes(bool bTensor, CFX_DIBitmap* pBitmap, CFX_AffineMatrix* pObject2Bitmap, CPDF_Stream* pShadingStream, CPDF_Function** pFuncs, int nFuncs, CPDF_ColorSpace* pCS, int fill_mode, int alpha) { @@ -768,7 +768,7 @@ static void _DrawCoonPatchMeshes(FX_BOOL bTensor, CFX_DIBitmap* pBitmap, CFX_Aff } } void CPDF_RenderStatus::DrawShading(CPDF_ShadingPattern* pPattern, CFX_AffineMatrix* pMatrix, - FX_RECT& clip_rect, int alpha, FX_BOOL bAlphaMode) + FX_RECT& clip_rect, int alpha, bool bAlphaMode) { CPDF_Function** pFuncs = pPattern->m_pFunctions; int nFuncs = pPattern->m_nFuncs; @@ -840,7 +840,7 @@ void CPDF_RenderStatus::DrawShading(CPDF_ShadingPattern* pPattern, CFX_AffineMat } buffer.OutputToDevice(); } -void CPDF_RenderStatus::DrawShadingPattern(CPDF_ShadingPattern* pattern, CPDF_PageObject* pPageObj, const CFX_AffineMatrix* pObj2Device, FX_BOOL bStroke) +void CPDF_RenderStatus::DrawShadingPattern(CPDF_ShadingPattern* pattern, CPDF_PageObject* pPageObj, const CFX_AffineMatrix* pObj2Device, bool bStroke) { if (!pattern->Load()) { return; @@ -858,7 +858,7 @@ void CPDF_RenderStatus::DrawShadingPattern(CPDF_ShadingPattern* pattern, CPDF_Pa return; } FX_RECT rect; - if (GetObjectClippedRect(pPageObj, pObj2Device, FALSE, rect)) { + if (GetObjectClippedRect(pPageObj, pObj2Device, false, rect)) { m_pDevice->RestoreState(); return; } @@ -869,19 +869,19 @@ void CPDF_RenderStatus::DrawShadingPattern(CPDF_ShadingPattern* pattern, CPDF_Pa DrawShading(pattern, &matrix, rect, alpha, m_Options.m_ColorMode == RENDER_COLOR_ALPHA); m_pDevice->RestoreState(); } -FX_BOOL CPDF_RenderStatus::ProcessShading(CPDF_ShadingObject* pShadingObj, const CFX_AffineMatrix* pObj2Device) +bool CPDF_RenderStatus::ProcessShading(CPDF_ShadingObject* pShadingObj, const CFX_AffineMatrix* pObj2Device) { FX_RECT rect = pShadingObj->GetBBox(pObj2Device); FX_RECT clip_box = m_pDevice->GetClipBox(); rect.Intersect(clip_box); if (rect.IsEmpty()) { - return TRUE; + return true; } CFX_AffineMatrix matrix = pShadingObj->m_Matrix; matrix.Concat(*pObj2Device); - DrawShading(pShadingObj->m_pShading, &matrix, rect, pShadingObj->m_GeneralState.GetAlpha(FALSE), + DrawShading(pShadingObj->m_pShading, &matrix, rect, pShadingObj->m_GeneralState.GetAlpha(false), m_Options.m_ColorMode == RENDER_COLOR_ALPHA); - return TRUE; + return true; } static CFX_DIBitmap* DrawPatternBitmap(CPDF_Document* pDoc, CPDF_PageRenderCache* pCache, CPDF_TilingPattern* pPattern, const CFX_AffineMatrix* pObject2Device, @@ -914,7 +914,7 @@ static CFX_DIBitmap* DrawPatternBitmap(CPDF_Document* pDoc, CPDF_PageRenderCache context.DrawObjectList(&bitmap_device, pPattern->m_pForm, &mtPattern2Bitmap, &options); return pBitmap; } -void CPDF_RenderStatus::DrawTilingPattern(CPDF_TilingPattern* pPattern, CPDF_PageObject* pPageObj, const CFX_AffineMatrix* pObj2Device, FX_BOOL bStroke) +void CPDF_RenderStatus::DrawTilingPattern(CPDF_TilingPattern* pPattern, CPDF_PageObject* pPageObj, const CFX_AffineMatrix* pObj2Device, bool bStroke) { if (!pPattern->Load()) { return; @@ -944,11 +944,11 @@ void CPDF_RenderStatus::DrawTilingPattern(CPDF_TilingPattern* pPattern, CPDF_Pag CFX_AffineMatrix mtPattern2Device = pPattern->m_Pattern2Form; mtPattern2Device.Concat(*pObj2Device); GetScaledMatrix(mtPattern2Device); - FX_BOOL bAligned = FALSE; + bool bAligned = false; if (pPattern->m_BBox.left == 0 && pPattern->m_BBox.bottom == 0 && pPattern->m_BBox.right == pPattern->m_XStep && pPattern->m_BBox.top == pPattern->m_YStep && (mtPattern2Device.IsScaled() || mtPattern2Device.Is90Rotated())) { - bAligned = TRUE; + bAligned = true; } CFX_FloatRect cell_bbox = pPattern->m_BBox; mtPattern2Device.TransformRect(cell_bbox); @@ -1075,11 +1075,11 @@ void CPDF_RenderStatus::DrawTilingPattern(CPDF_TilingPattern* pPattern, CPDF_Pag } } } - CompositeDIBitmap(&screen, clip_box.left, clip_box.top, 0, 255, FXDIB_BLEND_NORMAL, FALSE); + CompositeDIBitmap(&screen, clip_box.left, clip_box.top, 0, 255, FXDIB_BLEND_NORMAL, false); m_pDevice->RestoreState(); delete pPatternBitmap; } -void CPDF_RenderStatus::DrawPathWithPattern(CPDF_PathObject* pPathObj, const CFX_AffineMatrix* pObj2Device, CPDF_Color* pColor, FX_BOOL bStroke) +void CPDF_RenderStatus::DrawPathWithPattern(CPDF_PathObject* pPathObj, const CFX_AffineMatrix* pObj2Device, CPDF_Color* pColor, bool bStroke) { CPDF_Pattern* pattern = pColor->GetPattern(); if (pattern == NULL) { @@ -1091,20 +1091,20 @@ void CPDF_RenderStatus::DrawPathWithPattern(CPDF_PathObject* pPathObj, const CFX DrawShadingPattern((CPDF_ShadingPattern*)pattern, pPathObj, pObj2Device, bStroke); } } -void CPDF_RenderStatus::ProcessPathPattern(CPDF_PathObject* pPathObj, const CFX_AffineMatrix* pObj2Device, int& filltype, FX_BOOL& bStroke) +void CPDF_RenderStatus::ProcessPathPattern(CPDF_PathObject* pPathObj, const CFX_AffineMatrix* pObj2Device, int& filltype, bool& bStroke) { if(filltype) { CPDF_Color& FillColor = *pPathObj->m_ColorState.GetFillColor(); if(FillColor.m_pCS && FillColor.m_pCS->GetFamily() == PDFCS_PATTERN) { - DrawPathWithPattern(pPathObj, pObj2Device, &FillColor, FALSE); + DrawPathWithPattern(pPathObj, pObj2Device, &FillColor, false); filltype = 0; } } if(bStroke) { CPDF_Color& StrokeColor = *pPathObj->m_ColorState.GetStrokeColor(); if(StrokeColor.m_pCS && StrokeColor.m_pCS->GetFamily() == PDFCS_PATTERN) { - DrawPathWithPattern(pPathObj, pObj2Device, &StrokeColor, TRUE); - bStroke = FALSE; + DrawPathWithPattern(pPathObj, pObj2Device, &StrokeColor, true); + bStroke = false; } } } diff --git a/core/src/fpdfapi/fpdf_render/fpdf_render_text.cpp b/core/src/fpdfapi/fpdf_render/fpdf_render_text.cpp index ad5dc58a1c..26138a9fbf 100644 --- a/core/src/fpdfapi/fpdf_render/fpdf_render_text.cpp +++ b/core/src/fpdfapi/fpdf_render/fpdf_render_text.cpp @@ -9,7 +9,7 @@ #include "../../../include/fpdfapi/fpdf_pageobj.h" #include "../fpdf_page/pageint.h" #include "render_int.h" -extern FX_BOOL IsAvailableMatrix(const CFX_AffineMatrix& matrix); +extern bool IsAvailableMatrix(const CFX_AffineMatrix& matrix); CPDF_Type3Cache::~CPDF_Type3Cache() { FX_POSITION pos = m_SizeMap.GetStartPosition(); @@ -76,28 +76,28 @@ void CPDF_Type3Glyphs::AdjustBlue(FX_FLOAT top, FX_FLOAT bottom, int& top_line, top_line = _AdjustBlue(top, m_TopBlueCount, m_TopBlue); bottom_line = _AdjustBlue(bottom, m_BottomBlueCount, m_BottomBlue); } -static FX_BOOL _IsScanLine1bpp(uint8_t* pBuf, int width) +static bool _IsScanLine1bpp(uint8_t* pBuf, int width) { int size = width / 8; for (int i = 0; i < size; i ++) if (pBuf[i]) { - return TRUE; + return true; } if (width % 8) if (pBuf[width / 8] & (0xff << (8 - width % 8))) { - return TRUE; + return true; } - return FALSE; + return false; } -static FX_BOOL _IsScanLine8bpp(uint8_t* pBuf, int width) +static bool _IsScanLine8bpp(uint8_t* pBuf, int width) { for (int i = 0; i < width; i ++) if (pBuf[i] > 0x40) { - return TRUE; + return true; } - return FALSE; + return false; } -static int _DetectFirstLastScan(const CFX_DIBitmap* pBitmap, FX_BOOL bFirst) +static int _DetectFirstLastScan(const CFX_DIBitmap* pBitmap, bool bFirst) { int height = pBitmap->GetHeight(), pitch = pBitmap->GetPitch(), width = pBitmap->GetWidth(); int bpp = pBitmap->GetBPP(); @@ -137,12 +137,12 @@ CFX_GlyphBitmap* CPDF_Type3Cache::RenderGlyph(CPDF_Type3Glyphs* pSize, FX_DWORD int left, top; if (FXSYS_fabs(image_matrix.b) < FXSYS_fabs(image_matrix.a) / 100 && FXSYS_fabs(image_matrix.c) < FXSYS_fabs(image_matrix.d) / 100) { int top_line, bottom_line; - top_line = _DetectFirstLastScan(pBitmap, TRUE); - bottom_line = _DetectFirstLastScan(pBitmap, FALSE); + top_line = _DetectFirstLastScan(pBitmap, true); + bottom_line = _DetectFirstLastScan(pBitmap, false); if (top_line == 0 && bottom_line == pBitmap->GetHeight() - 1) { FX_FLOAT top_y = image_matrix.d + image_matrix.f; FX_FLOAT bottom_y = image_matrix.f; - FX_BOOL bFlipped = top_y > bottom_y; + bool bFlipped = top_y > bottom_y; if (bFlipped) { FX_FLOAT temp = top_y; top_y = bottom_y; @@ -185,76 +185,76 @@ void _CPDF_UniqueKeyGen::Generate(int count, ...) va_end(argList); m_KeyLen = count * sizeof(FX_DWORD); } -FX_BOOL CPDF_RenderStatus::ProcessText(const CPDF_TextObject* textobj, const CFX_AffineMatrix* pObj2Device, CFX_PathData* pClippingPath) +bool CPDF_RenderStatus::ProcessText(const CPDF_TextObject* textobj, const CFX_AffineMatrix* pObj2Device, CFX_PathData* pClippingPath) { if(textobj->m_nChars == 0) { - return TRUE; + return true; } int text_render_mode = textobj->m_TextState.GetObject()->m_TextMode; if (text_render_mode == 3) { - return TRUE; + return true; } CPDF_Font* pFont = textobj->m_TextState.GetFont(); if (pFont->GetFontType() == PDFFONT_TYPE3) { return ProcessType3Text(textobj, pObj2Device); } - FX_BOOL bFill = FALSE, bStroke = FALSE, bClip = FALSE; + bool bFill = false, bStroke = false, bClip = false; if (pClippingPath) { - bClip = TRUE; + bClip = true; } else { switch (text_render_mode) { case 0: case 4: - bFill = TRUE; + bFill = true; break; case 1: case 5: if (pFont->GetFace() == NULL && !(pFont->GetSubstFont()->m_SubstFlags & FXFONT_SUBST_GLYPHPATH)) { - bFill = TRUE; + bFill = true; } else { - bStroke = TRUE; + bStroke = true; } break; case 2: case 6: if (pFont->GetFace() == NULL && !(pFont->GetSubstFont()->m_SubstFlags & FXFONT_SUBST_GLYPHPATH)) { - bFill = TRUE; + bFill = true; } else { - bFill = bStroke = TRUE; + bFill = bStroke = true; } break; case 3: case 7: - return TRUE; + return true; default: - bFill = TRUE; + bFill = true; } } FX_ARGB stroke_argb = 0, fill_argb = 0; - FX_BOOL bPattern = FALSE; + bool bPattern = false; if (bStroke) { if (textobj->m_ColorState.GetStrokeColor()->IsPattern()) { - bPattern = TRUE; + bPattern = true; } else { stroke_argb = GetStrokeArgb(textobj); } } if (bFill) { if (textobj->m_ColorState.GetFillColor()->IsPattern()) { - bPattern = TRUE; + bPattern = true; } else { fill_argb = GetFillArgb(textobj); } } CFX_AffineMatrix text_matrix; textobj->GetTextMatrix(&text_matrix); - if(IsAvailableMatrix(text_matrix) == FALSE) { - return TRUE; + if(IsAvailableMatrix(text_matrix) == false) { + return true; } FX_FLOAT font_size = textobj->m_TextState.GetFontSize(); if (bPattern) { DrawTextPathWithPattern(textobj, pObj2Device, pFont, font_size, &text_matrix, bFill, bStroke); - return TRUE; + return true; } if (bClip || bStroke) { const CFX_AffineMatrix* pDeviceMatrix = pObj2Device; @@ -293,7 +293,7 @@ CPDF_Type3Cache* CPDF_RenderStatus::GetCachedType3(CPDF_Type3Font* pFont) if (pFont->m_pDocument == NULL) { return NULL; } - pFont->m_pDocument->GetPageData()->GetFont(pFont->GetFontDict(), FALSE); + pFont->m_pDocument->GetPageData()->GetFont(pFont->GetFontDict(), false); return pFont->m_pDocument->GetRenderData()->GetCachedType3(pFont); } static void ReleaseCachedType3(CPDF_Type3Font* pFont) @@ -304,10 +304,10 @@ static void ReleaseCachedType3(CPDF_Type3Font* pFont) pFont->m_pDocument->GetRenderData()->ReleaseCachedType3(pFont); pFont->m_pDocument->GetPageData()->ReleaseFont(pFont->GetFontDict()); } -FX_BOOL CPDF_Type3Char::LoadBitmap(CPDF_RenderContext* pContext) +bool CPDF_Type3Char::LoadBitmap(CPDF_RenderContext* pContext) { if (m_pBitmap != NULL || m_pForm == NULL) { - return TRUE; + return true; } if (m_pForm->CountObjects() == 1 && !m_bColored) { CPDF_PageObject *pPageObj = m_pForm->GetObjectAt(m_pForm->GetFirstObjectPosition()); @@ -321,10 +321,10 @@ FX_BOOL CPDF_Type3Char::LoadBitmap(CPDF_RenderContext* pContext) } delete m_pForm; m_pForm = NULL; - return TRUE; + return true; } } - return FALSE; + return false; } class CPDF_RefType3Cache { @@ -343,12 +343,12 @@ public: FX_DWORD m_dwCount; CPDF_Type3Font* m_pType3Font; }; -FX_BOOL CPDF_RenderStatus::ProcessType3Text(const CPDF_TextObject* textobj, const CFX_AffineMatrix* pObj2Device) +bool CPDF_RenderStatus::ProcessType3Text(const CPDF_TextObject* textobj, const CFX_AffineMatrix* pObj2Device) { CPDF_Type3Font* pType3Font = textobj->m_TextState.GetFont()->GetType3Font(); for (int j = 0; j < m_Type3FontCache.GetSize(); j++) if ((CPDF_Type3Font*)m_Type3FontCache.GetAt(j) == pType3Font) { - return TRUE; + return true; } CFX_Matrix dCTM = m_pDevice->GetCTM(); FX_FLOAT sa = FXSYS_fabs(dCTM.a); @@ -358,14 +358,14 @@ FX_BOOL CPDF_RenderStatus::ProcessType3Text(const CPDF_TextObject* textobj, cons CFX_AffineMatrix char_matrix = pType3Font->GetFontMatrix(); FX_FLOAT font_size = textobj->m_TextState.GetFontSize(); char_matrix.Scale(font_size, font_size); - FX_ARGB fill_argb = GetFillArgb(textobj, TRUE); + FX_ARGB fill_argb = GetFillArgb(textobj, true); int fill_alpha = FXARGB_A(fill_argb); int device_class = m_pDevice->GetDeviceClass(); FXTEXT_GLYPHPOS* pGlyphAndPos = NULL; if (device_class == FXDC_DISPLAY) { pGlyphAndPos = FX_Alloc(FXTEXT_GLYPHPOS, textobj->m_nChars); } else if (fill_alpha < 255) { - return FALSE; + return false; } CPDF_RefType3Cache refTypeCache(pType3Font); FX_DWORD *pChars = textobj->m_pCharCodes; @@ -399,7 +399,7 @@ FX_BOOL CPDF_RenderStatus::ProcessType3Text(const CPDF_TextObject* textobj, cons FX_Free(pGlyphAndPos); pGlyphAndPos = NULL; } - CPDF_GraphicStates* pStates = CloneObjStates(textobj, FALSE); + CPDF_GraphicStates* pStates = CloneObjStates(textobj, false); CPDF_RenderOptions Options = m_Options; Options.m_Flags |= RENDER_FORCE_HALFTONE | RENDER_RECT_AA; Options.m_Flags &= ~RENDER_FORCE_DOWNSAMPLE; @@ -410,7 +410,7 @@ FX_BOOL CPDF_RenderStatus::ProcessType3Text(const CPDF_TextObject* textobj, cons if (fill_alpha == 255) { CPDF_RenderStatus status; status.Initialize(m_pContext, m_pDevice, NULL, NULL, this, pStates, &Options, - pType3Char->m_pForm->m_Transparency, m_bDropObjects, pFormResource, FALSE, pType3Char, fill_argb); + pType3Char->m_pForm->m_Transparency, m_bDropObjects, pFormResource, false, pType3Char, fill_argb); status.m_Type3FontCache.Append(m_Type3FontCache); status.m_Type3FontCache.Add(pType3Font); m_pDevice->SaveState(); @@ -422,12 +422,12 @@ FX_BOOL CPDF_RenderStatus::ProcessType3Text(const CPDF_TextObject* textobj, cons FX_RECT rect = rect_f.GetOutterRect(); CFX_FxgeDevice bitmap_device; if (!bitmap_device.Create((int)(rect.Width() * sa), (int)(rect.Height() * sd), FXDIB_Argb)) { - return TRUE; + return true; } bitmap_device.GetBitmap()->Clear(0); CPDF_RenderStatus status; status.Initialize(m_pContext, &bitmap_device, NULL, NULL, this, pStates, &Options, - pType3Char->m_pForm->m_Transparency, m_bDropObjects, pFormResource, FALSE, pType3Char, fill_argb); + pType3Char->m_pForm->m_Transparency, m_bDropObjects, pFormResource, false, pType3Char, fill_argb); status.m_Type3FontCache.Append(m_Type3FontCache); status.m_Type3FontCache.Add(pType3Font); matrix.TranslateI(-rect.left, -rect.top); @@ -457,11 +457,11 @@ FX_BOOL CPDF_RenderStatus::ProcessType3Text(const CPDF_TextObject* textobj, cons CFX_AffineMatrix image_matrix = pType3Char->m_ImageMatrix; image_matrix.Concat(matrix); CPDF_ImageRenderer renderer; - if (renderer.Start(this, pType3Char->m_pBitmap, fill_argb, 255, &image_matrix, 0, FALSE)) { + if (renderer.Start(this, pType3Char->m_pBitmap, fill_argb, 255, &image_matrix, 0, false)) { renderer.Continue(NULL); } if (!renderer.m_Result) { - return FALSE; + return false; } } } @@ -471,7 +471,7 @@ FX_BOOL CPDF_RenderStatus::ProcessType3Text(const CPDF_TextObject* textobj, cons CFX_DIBitmap bitmap; if (!bitmap.Create((int)(rect.Width() * sa), (int)(rect.Height() * sd), FXDIB_8bppMask)) { FX_Free(pGlyphAndPos); - return TRUE; + return true; } bitmap.Clear(0); for (int iChar = 0; iChar < textobj->m_nChars; iChar ++) { @@ -487,7 +487,7 @@ FX_BOOL CPDF_RenderStatus::ProcessType3Text(const CPDF_TextObject* textobj, cons m_pDevice->SetBitMask(&bitmap, rect.left, rect.top, fill_argb); FX_Free(pGlyphAndPos); } - return TRUE; + return true; } class CPDF_CharPosList { @@ -515,13 +515,13 @@ void CPDF_CharPosList::Load(int nChars, FX_DWORD* pCharCodes, FX_FLOAT* pCharPos m_pCharPos = FX_Alloc(FXTEXT_CHARPOS, nChars); m_nChars = 0; CPDF_CIDFont* pCIDFont = pFont->GetCIDFont(); - FX_BOOL bVertWriting = pCIDFont && pCIDFont->IsVertWriting(); + bool bVertWriting = pCIDFont && pCIDFont->IsVertWriting(); for (int iChar = 0; iChar < nChars; iChar ++) { FX_DWORD CharCode = nChars == 1 ? (FX_DWORD)(uintptr_t)pCharCodes : pCharCodes[iChar]; if (CharCode == (FX_DWORD) - 1) { continue; } - FX_BOOL bVert = FALSE; + bool bVert = false; FXTEXT_CHARPOS& charpos = m_pCharPos[m_nChars++]; if (pCIDFont) { charpos.m_bFontStyle = pCIDFont->IsFontStyleFromCharCode(CharCode); @@ -537,7 +537,7 @@ void CPDF_CharPosList::Load(int nChars, FX_DWORD* pCharCodes, FX_FLOAT* pCharPos } charpos.m_OriginX = iChar ? pCharPos[iChar - 1] : 0; charpos.m_OriginY = 0; - charpos.m_bGlyphAdjust = FALSE; + charpos.m_bGlyphAdjust = false; if (pCIDFont == NULL) { continue; } @@ -558,11 +558,11 @@ void CPDF_CharPosList::Load(int nChars, FX_DWORD* pCharCodes, FX_FLOAT* pCharPos charpos.m_AdjustMatrix[3] = _CIDTransformToFloat(pTransform[3]); charpos.m_OriginX += _CIDTransformToFloat(pTransform[4]) * FontSize; charpos.m_OriginY += _CIDTransformToFloat(pTransform[5]) * FontSize; - charpos.m_bGlyphAdjust = TRUE; + charpos.m_bGlyphAdjust = true; } } } -FX_BOOL CPDF_TextRenderer::DrawTextPath(CFX_RenderDevice* pDevice, int nChars, FX_DWORD* pCharCodes, FX_FLOAT* pCharPos, +bool CPDF_TextRenderer::DrawTextPath(CFX_RenderDevice* pDevice, int nChars, FX_DWORD* pCharCodes, FX_FLOAT* pCharPos, CPDF_Font* pFont, FX_FLOAT font_size, const CFX_AffineMatrix* pText2User, const CFX_AffineMatrix* pUser2Device, const CFX_GraphStateData* pGraphState, @@ -632,7 +632,7 @@ void CPDF_TextRenderer::DrawTextString(CFX_RenderDevice* pDevice, FX_FLOAT origi FX_Free(pCharPos); } } -FX_BOOL CPDF_TextRenderer::DrawNormalText(CFX_RenderDevice* pDevice, int nChars, FX_DWORD* pCharCodes, FX_FLOAT* pCharPos, +bool CPDF_TextRenderer::DrawNormalText(CFX_RenderDevice* pDevice, int nChars, FX_DWORD* pCharCodes, FX_FLOAT* pCharPos, CPDF_Font* pFont, FX_FLOAT font_size, const CFX_AffineMatrix* pText2Device, FX_ARGB fill_argb, const CPDF_RenderOptions* pOptions) @@ -671,13 +671,13 @@ FX_BOOL CPDF_TextRenderer::DrawNormalText(CFX_RenderDevice* pDevice, int nChars, } void CPDF_RenderStatus::DrawTextPathWithPattern(const CPDF_TextObject* textobj, const CFX_AffineMatrix* pObj2Device, CPDF_Font* pFont, FX_FLOAT font_size, - const CFX_AffineMatrix* pTextMatrix, FX_BOOL bFill, FX_BOOL bStroke) + const CFX_AffineMatrix* pTextMatrix, bool bFill, bool bStroke) { if (!bStroke) { CPDF_PathObject path; CPDF_TextObject* pCopy = new CPDF_TextObject; pCopy->Copy(textobj); - path.m_bStroke = FALSE; + path.m_bStroke = false; path.m_FillType = FXFILL_WINDING; path.m_ClipPath.AppendTexts(&pCopy, 1); path.m_ColorState = textobj->m_ColorState; diff --git a/core/src/fpdfapi/fpdf_render/render_int.h b/core/src/fpdfapi/fpdf_render/render_int.h index e5fb831a63..c9c8944a0b 100644 --- a/core/src/fpdfapi/fpdf_render/render_int.h +++ b/core/src/fpdfapi/fpdf_render/render_int.h @@ -49,9 +49,9 @@ class CPDF_TransferFunc public: CPDF_Document* m_pPDFDoc; uint8_t m_Samples[256 * 3]; - FX_BOOL m_bIdentity; + bool m_bIdentity; - CFX_DIBSource* TranslateImage(const CFX_DIBSource* pSrc, FX_BOOL bAutoDropSrc); + CFX_DIBSource* TranslateImage(const CFX_DIBSource* pSrc, bool bAutoDropSrc); FX_COLORREF TranslateColor(FX_COLORREF src); }; @@ -66,7 +66,7 @@ public: { return m_pFontCache; } - void Clear(FX_BOOL bRelease = FALSE); + void Clear(bool bRelease = false); void ReleaseCachedType3(CPDF_Type3Font* pFont); void ReleaseTransferFunc(CPDF_Object* pObj); private: @@ -91,24 +91,24 @@ class IPDF_ObjectRenderer public: static IPDF_ObjectRenderer* Create(int type); virtual ~IPDF_ObjectRenderer() {} - virtual FX_BOOL Start(CPDF_RenderStatus* pRenderStatus, const CPDF_PageObject* pObj, const CFX_AffineMatrix* pObj2Device, FX_BOOL bStdCS, int blendType = FXDIB_BLEND_NORMAL) = 0; - virtual FX_BOOL Continue(IFX_Pause* pPause) = 0; - FX_BOOL m_Result; + virtual bool Start(CPDF_RenderStatus* pRenderStatus, const CPDF_PageObject* pObj, const CFX_AffineMatrix* pObj2Device, bool bStdCS, int blendType = FXDIB_BLEND_NORMAL) = 0; + virtual bool Continue(IFX_Pause* pPause) = 0; + bool m_Result; }; class CPDF_RenderStatus { public: CPDF_RenderStatus(); ~CPDF_RenderStatus(); - FX_BOOL Initialize(class CPDF_RenderContext* pContext, CFX_RenderDevice* pDevice, const CFX_AffineMatrix* pDeviceMatrix, + bool Initialize(class CPDF_RenderContext* pContext, CFX_RenderDevice* pDevice, const CFX_AffineMatrix* pDeviceMatrix, const CPDF_PageObject* pStopObj, const CPDF_RenderStatus* pParentStatus, const CPDF_GraphicStates* pInitialStates, const CPDF_RenderOptions* pOptions, - int transparency, FX_BOOL bDropObjects, CPDF_Dictionary* pFormResource = NULL, - FX_BOOL bStdCS = FALSE, CPDF_Type3Char* pType3Char = NULL, FX_ARGB fill_color = 0, - FX_DWORD GroupFamily = 0, FX_BOOL bLoadMask = FALSE); + int transparency, bool bDropObjects, CPDF_Dictionary* pFormResource = NULL, + bool bStdCS = false, CPDF_Type3Char* pType3Char = NULL, FX_ARGB fill_color = 0, + FX_DWORD GroupFamily = 0, bool bLoadMask = false); void RenderObjectList(const CPDF_PageObjects* pObjs, const CFX_AffineMatrix* pObj2Device); void RenderSingleObject(const CPDF_PageObject* pObj, const CFX_AffineMatrix* pObj2Device); - FX_BOOL ContinueSingleObject(const CPDF_PageObject* pObj, const CFX_AffineMatrix* pObj2Device, IFX_Pause* pPause); + bool ContinueSingleObject(const CPDF_PageObject* pObj, const CFX_AffineMatrix* pObj2Device, IFX_Pause* pPause); CPDF_RenderOptions m_Options; CPDF_Dictionary* m_pFormResource; CPDF_Dictionary* m_pPageResource; @@ -122,45 +122,45 @@ protected: friend class CPDF_RenderContext; void ProcessClipPath(CPDF_ClipPath ClipPath, const CFX_AffineMatrix* pObj2Device); void DrawClipPath(CPDF_ClipPath ClipPath, const CFX_AffineMatrix* pObj2Device); - FX_BOOL ProcessTransparency(const CPDF_PageObject* PageObj, const CFX_AffineMatrix* pObj2Device); + bool ProcessTransparency(const CPDF_PageObject* PageObj, const CFX_AffineMatrix* pObj2Device); void ProcessObjectNoClip(const CPDF_PageObject* PageObj, const CFX_AffineMatrix* pObj2Device); void DrawObjWithBackground(const CPDF_PageObject* pObj, const CFX_AffineMatrix* pObj2Device); - FX_BOOL DrawObjWithBlend(const CPDF_PageObject* pObj, const CFX_AffineMatrix* pObj2Device); - FX_BOOL ProcessPath(CPDF_PathObject* pPathObj, const CFX_AffineMatrix* pObj2Device); - void ProcessPathPattern(CPDF_PathObject* pPathObj, const CFX_AffineMatrix* pObj2Device, int& filltype, FX_BOOL& bStroke); - void DrawPathWithPattern(CPDF_PathObject* pPathObj, const CFX_AffineMatrix* pObj2Device, CPDF_Color* pColor, FX_BOOL bStroke); - void DrawTilingPattern(CPDF_TilingPattern* pPattern, CPDF_PageObject* pPageObj, const CFX_AffineMatrix* pObj2Device, FX_BOOL bStroke); - void DrawShadingPattern(CPDF_ShadingPattern* pPattern, CPDF_PageObject* pPageObj, const CFX_AffineMatrix* pObj2Device, FX_BOOL bStroke); - FX_BOOL SelectClipPath(CPDF_PathObject* pPathObj, const CFX_AffineMatrix* pObj2Device, FX_BOOL bStroke); - FX_BOOL ProcessImage(CPDF_ImageObject* pImageObj, const CFX_AffineMatrix* pObj2Device); - FX_BOOL OutputBitmapAlpha(CPDF_ImageObject* pImageObj, const CFX_AffineMatrix* pImage2Device); - FX_BOOL OutputImage(CPDF_ImageObject* pImageObj, const CFX_AffineMatrix* pImage2Device); - FX_BOOL OutputDIBSource(const CFX_DIBSource* pOutputBitmap, FX_ARGB fill_argb, int bitmap_alpha, + bool DrawObjWithBlend(const CPDF_PageObject* pObj, const CFX_AffineMatrix* pObj2Device); + bool ProcessPath(CPDF_PathObject* pPathObj, const CFX_AffineMatrix* pObj2Device); + void ProcessPathPattern(CPDF_PathObject* pPathObj, const CFX_AffineMatrix* pObj2Device, int& filltype, bool& bStroke); + void DrawPathWithPattern(CPDF_PathObject* pPathObj, const CFX_AffineMatrix* pObj2Device, CPDF_Color* pColor, bool bStroke); + void DrawTilingPattern(CPDF_TilingPattern* pPattern, CPDF_PageObject* pPageObj, const CFX_AffineMatrix* pObj2Device, bool bStroke); + void DrawShadingPattern(CPDF_ShadingPattern* pPattern, CPDF_PageObject* pPageObj, const CFX_AffineMatrix* pObj2Device, bool bStroke); + bool SelectClipPath(CPDF_PathObject* pPathObj, const CFX_AffineMatrix* pObj2Device, bool bStroke); + bool ProcessImage(CPDF_ImageObject* pImageObj, const CFX_AffineMatrix* pObj2Device); + bool OutputBitmapAlpha(CPDF_ImageObject* pImageObj, const CFX_AffineMatrix* pImage2Device); + bool OutputImage(CPDF_ImageObject* pImageObj, const CFX_AffineMatrix* pImage2Device); + bool OutputDIBSource(const CFX_DIBSource* pOutputBitmap, FX_ARGB fill_argb, int bitmap_alpha, const CFX_AffineMatrix* pImage2Device, CPDF_ImageCache* pImageCache, FX_DWORD flags); void CompositeDIBitmap(CFX_DIBitmap* pDIBitmap, int left, int top, FX_ARGB mask_argb, int bitmap_alpha, int blend_mode, int bIsolated); - FX_BOOL ProcessShading(CPDF_ShadingObject* pShadingObj, const CFX_AffineMatrix* pObj2Device); + bool ProcessShading(CPDF_ShadingObject* pShadingObj, const CFX_AffineMatrix* pObj2Device); void DrawShading(CPDF_ShadingPattern* pPattern, CFX_AffineMatrix* pMatrix, FX_RECT& clip_rect, - int alpha, FX_BOOL bAlphaMode); - FX_BOOL ProcessType3Text(const CPDF_TextObject* textobj, const CFX_AffineMatrix* pObj2Device); - FX_BOOL ProcessText(const CPDF_TextObject* textobj, const CFX_AffineMatrix* pObj2Device, CFX_PathData* pClippingPath); + int alpha, bool bAlphaMode); + bool ProcessType3Text(const CPDF_TextObject* textobj, const CFX_AffineMatrix* pObj2Device); + bool ProcessText(const CPDF_TextObject* textobj, const CFX_AffineMatrix* pObj2Device, CFX_PathData* pClippingPath); void DrawTextPathWithPattern(const CPDF_TextObject* textobj, const CFX_AffineMatrix* pObj2Device, CPDF_Font* pFont, FX_FLOAT font_size, - const CFX_AffineMatrix* pTextMatrix, FX_BOOL bFill, FX_BOOL bStroke); - FX_BOOL ProcessForm(CPDF_FormObject* pFormObj, const CFX_AffineMatrix* pObj2Device); + const CFX_AffineMatrix* pTextMatrix, bool bFill, bool bStroke); + bool ProcessForm(CPDF_FormObject* pFormObj, const CFX_AffineMatrix* pObj2Device); CFX_DIBitmap* GetBackdrop(const CPDF_PageObject* pObj, const FX_RECT& rect, int& left, int& top, - FX_BOOL bBackAlphaRequired); + bool bBackAlphaRequired); CFX_DIBitmap* LoadSMask(CPDF_Dictionary* pSMaskDict, FX_RECT* pClipRect, const CFX_AffineMatrix* pMatrix); void Init(CPDF_RenderContext* pParent); static class CPDF_Type3Cache* GetCachedType3(CPDF_Type3Font* pFont); - static CPDF_GraphicStates* CloneObjStates(const CPDF_GraphicStates* pPathObj, FX_BOOL bStroke); + static CPDF_GraphicStates* CloneObjStates(const CPDF_GraphicStates* pPathObj, bool bStroke); CPDF_TransferFunc* GetTransferFunc(CPDF_Object* pObject) const; - FX_ARGB GetFillArgb(const CPDF_PageObject* pObj, FX_BOOL bType3 = FALSE) const; + FX_ARGB GetFillArgb(const CPDF_PageObject* pObj, bool bType3 = false) const; FX_ARGB GetStrokeArgb(const CPDF_PageObject* pObj) const; CPDF_RenderContext* m_pContext; - FX_BOOL m_bStopped; + bool m_bStopped; void DitherObjectArea(const CPDF_PageObject* pObj, const CFX_AffineMatrix* pObj2Device); - FX_BOOL GetObjectClippedRect(const CPDF_PageObject* pObj, const CFX_AffineMatrix* pObj2Device, FX_BOOL bLogical, FX_RECT &rect) const; + bool GetObjectClippedRect(const CPDF_PageObject* pObj, const CFX_AffineMatrix* pObj2Device, bool bLogical, FX_RECT &rect) const; void GetScaledMatrix(CFX_Matrix &matrix) const; protected: @@ -175,13 +175,13 @@ protected: CPDF_GraphicStates m_InitialStates; int m_HalftoneLimit; IPDF_ObjectRenderer* m_pObjectRenderer; - FX_BOOL m_bPrint; + bool m_bPrint; int m_Transparency; int m_DitherBits; - FX_BOOL m_bDropObjects; - FX_BOOL m_bStdCS; + bool m_bDropObjects; + bool m_bStdCS; FX_DWORD m_GroupFamily; - FX_BOOL m_bLoadMask; + bool m_bLoadMask; CPDF_Type3Char * m_pType3Char; FX_ARGB m_T3FillColor; int m_curBlend; @@ -194,20 +194,20 @@ public: m_pBitmap = NULL; m_pMask = NULL; m_MatteColor = 0; - m_bCached = FALSE; + m_bCached = false; m_nDownsampleWidth = 0; m_nDownsampleHeight = 0; } - FX_BOOL Load(const CPDF_ImageObject* pImage, CPDF_PageRenderCache* pCache, FX_BOOL bStdCS = FALSE, FX_DWORD GroupFamily = 0, FX_BOOL bLoadMask = FALSE, CPDF_RenderStatus* pRenderStatus = NULL); + bool Load(const CPDF_ImageObject* pImage, CPDF_PageRenderCache* pCache, bool bStdCS = false, FX_DWORD GroupFamily = 0, bool bLoadMask = false, CPDF_RenderStatus* pRenderStatus = NULL); - FX_BOOL StartLoadImage(const CPDF_ImageObject* pImage, CPDF_PageRenderCache* pCache, void*& LoadHandle, FX_BOOL bStdCS = FALSE, FX_DWORD GroupFamily = 0, FX_BOOL bLoadMask = FALSE, CPDF_RenderStatus* pRenderStatus = NULL, int32_t nDownsampleWidth = 0, int32_t nDownsampleHeight = 0); - FX_BOOL Continue(void* LoadHandle, IFX_Pause* pPause); + bool StartLoadImage(const CPDF_ImageObject* pImage, CPDF_PageRenderCache* pCache, void*& LoadHandle, bool bStdCS = false, FX_DWORD GroupFamily = 0, bool bLoadMask = false, CPDF_RenderStatus* pRenderStatus = NULL, int32_t nDownsampleWidth = 0, int32_t nDownsampleHeight = 0); + bool Continue(void* LoadHandle, IFX_Pause* pPause); ~CPDF_ImageLoader(); CFX_DIBSource* m_pBitmap; CFX_DIBSource* m_pMask; FX_DWORD m_MatteColor; - FX_BOOL m_bCached; + bool m_bCached; protected: int32_t m_nDownsampleWidth; int32_t m_nDownsampleHeight; @@ -218,8 +218,8 @@ public: CPDF_ProgressiveImageLoaderHandle(); ~CPDF_ProgressiveImageLoaderHandle(); - FX_BOOL Start(CPDF_ImageLoader* pImageLoader, const CPDF_ImageObject* pImage, CPDF_PageRenderCache* pCache, FX_BOOL bStdCS = FALSE, FX_DWORD GroupFamily = 0, FX_BOOL bLoadMask = FALSE, CPDF_RenderStatus* pRenderStatus = NULL, int32_t nDownsampleWidth = 0, int32_t nDownsampleHeight = 0); - FX_BOOL Continue(IFX_Pause* pPause); + bool Start(CPDF_ImageLoader* pImageLoader, const CPDF_ImageObject* pImage, CPDF_PageRenderCache* pCache, bool bStdCS = false, FX_DWORD GroupFamily = 0, bool bLoadMask = false, CPDF_RenderStatus* pRenderStatus = NULL, int32_t nDownsampleWidth = 0, int32_t nDownsampleHeight = 0); + bool Continue(IFX_Pause* pPause); protected: CPDF_ImageLoader* m_pImageLoader; CPDF_PageRenderCache* m_pCache; @@ -233,10 +233,10 @@ class CPDF_ImageRenderer : public IPDF_ObjectRenderer public: CPDF_ImageRenderer(); ~CPDF_ImageRenderer(); - FX_BOOL Start(CPDF_RenderStatus* pStatus, const CPDF_PageObject* pObj, const CFX_AffineMatrix* pObj2Device, FX_BOOL bStdCS, int blendType = FXDIB_BLEND_NORMAL); - FX_BOOL Start(CPDF_RenderStatus* pStatus, const CFX_DIBSource* pDIBSource, FX_ARGB bitmap_argb, - int bitmap_alpha, const CFX_AffineMatrix* pImage2Device, FX_DWORD flags, FX_BOOL bStdCS, int blendType = FXDIB_BLEND_NORMAL); - FX_BOOL Continue(IFX_Pause* pPause); + bool Start(CPDF_RenderStatus* pStatus, const CPDF_PageObject* pObj, const CFX_AffineMatrix* pObj2Device, bool bStdCS, int blendType = FXDIB_BLEND_NORMAL); + bool Start(CPDF_RenderStatus* pStatus, const CFX_DIBSource* pDIBSource, FX_ARGB bitmap_argb, + int bitmap_alpha, const CFX_AffineMatrix* pImage2Device, FX_DWORD flags, bool bStdCS, int blendType = FXDIB_BLEND_NORMAL); + bool Continue(IFX_Pause* pPause); protected: CPDF_RenderStatus* m_pRenderStatus; CPDF_ImageObject* m_pImageObject; @@ -247,7 +247,7 @@ protected: const CFX_DIBSource* m_pDIBSource; CFX_DIBitmap* m_pClone; int m_BitmapAlpha; - FX_BOOL m_bPatternColor; + bool m_bPatternColor; CPDF_Pattern* m_pPattern; FX_ARGB m_FillArgb; FX_DWORD m_Flags; @@ -255,21 +255,21 @@ protected: CFX_ImageTransformer* m_pTransformer; void* m_DeviceHandle; void* m_LoadHandle; - FX_BOOL m_bStdCS; + bool m_bStdCS; int m_BlendType; - FX_BOOL StartBitmapAlpha(); - FX_BOOL StartDIBSource(); - FX_BOOL StartRenderDIBSource(); - FX_BOOL StartLoadDIBSource(); - FX_BOOL DrawMaskedImage(); - FX_BOOL DrawPatternImage(const CFX_Matrix* pObj2Device); + bool StartBitmapAlpha(); + bool StartDIBSource(); + bool StartRenderDIBSource(); + bool StartLoadDIBSource(); + bool DrawMaskedImage(); + bool DrawPatternImage(const CFX_Matrix* pObj2Device); }; class CPDF_ScaledRenderBuffer { public: CPDF_ScaledRenderBuffer(); ~CPDF_ScaledRenderBuffer(); - FX_BOOL Initialize(CPDF_RenderContext* pContext, CFX_RenderDevice* pDevice, FX_RECT* pRect, + bool Initialize(CPDF_RenderContext* pContext, CFX_RenderDevice* pDevice, FX_RECT* pRect, const CPDF_PageObject* pObj, const CPDF_RenderOptions *pOptions = NULL, int max_dpi = 0); CFX_RenderDevice* GetDevice() { @@ -294,13 +294,13 @@ class CPDF_QuickStretcher public: CPDF_QuickStretcher(); ~CPDF_QuickStretcher(); - FX_BOOL Start(CPDF_ImageObject* pImageObj, CFX_AffineMatrix* pImage2Device, const FX_RECT* pClipBox); - FX_BOOL Continue(IFX_Pause* pPause); + bool Start(CPDF_ImageObject* pImageObj, CFX_AffineMatrix* pImage2Device, const FX_RECT* pClipBox); + bool Continue(IFX_Pause* pPause); CFX_DIBitmap* m_pBitmap; int m_ResultLeft, m_ResultTop, m_ClipLeft, m_ClipTop; int m_DestWidth, m_DestHeight, m_ResultWidth, m_ResultHeight; int m_Bpp, m_SrcWidth, m_SrcHeight; - FX_BOOL m_bFlipX, m_bFlipY; + bool m_bFlipX, m_bFlipY; CPDF_ColorSpace* m_pCS; ICodec_ScanlineDecoder* m_pDecoder; CPDF_StreamAcc m_StreamAcc; @@ -311,7 +311,7 @@ class CPDF_DeviceBuffer public: CPDF_DeviceBuffer(); ~CPDF_DeviceBuffer(); - FX_BOOL Initialize(CPDF_RenderContext* pContext, CFX_RenderDevice* pDevice, FX_RECT* pRect, + bool Initialize(CPDF_RenderContext* pContext, CFX_RenderDevice* pDevice, FX_RECT* pRect, const CPDF_PageObject* pObj, int max_dpi = 0); void OutputToDevice(); CFX_DIBitmap* GetBitmap() const @@ -337,8 +337,8 @@ public: ~CPDF_ImageCache(); void ClearImageData(); void Reset(const CFX_DIBitmap* pBitmap); - FX_BOOL GetCachedBitmap(CFX_DIBSource*& pBitmap, CFX_DIBSource*& pMask, FX_DWORD& MatteColor, CPDF_Dictionary* pPageResources, - FX_BOOL bStdCS = FALSE, FX_DWORD GroupFamily = 0, FX_BOOL bLoadMask = FALSE, + bool GetCachedBitmap(CFX_DIBSource*& pBitmap, CFX_DIBSource*& pMask, FX_DWORD& MatteColor, CPDF_Dictionary* pPageResources, + bool bStdCS = false, FX_DWORD GroupFamily = 0, bool bLoadMask = false, CPDF_RenderStatus* pRenderStatus = NULL, int32_t downsampleWidth = 0, int32_t downsampleHeight = 0); FX_DWORD EstimateSize() const { @@ -359,8 +359,8 @@ public: int m_dwTimeCount; public: int StartGetCachedBitmap(CPDF_Dictionary* pFormResources, CPDF_Dictionary* pPageResources, - FX_BOOL bStdCS = FALSE, FX_DWORD GroupFamily = 0, - FX_BOOL bLoadMask = FALSE, CPDF_RenderStatus* pRenderStatus = NULL, int32_t downsampleWidth = 0, int32_t downsampleHeight = 0); + bool bStdCS = false, FX_DWORD GroupFamily = 0, + bool bLoadMask = false, CPDF_RenderStatus* pRenderStatus = NULL, int32_t downsampleWidth = 0, int32_t downsampleHeight = 0); int Continue(IFX_Pause* pPause); int ContinueGetCachedBitmap(); CFX_DIBSource* DetachBitmap(); @@ -388,23 +388,23 @@ class CPDF_DIBSource : public CFX_DIBSource public: CPDF_DIBSource(); virtual ~CPDF_DIBSource(); - FX_BOOL Load(CPDF_Document* pDoc, const CPDF_Stream* pStream, + bool Load(CPDF_Document* pDoc, const CPDF_Stream* pStream, CPDF_DIBSource** ppMask, FX_DWORD* pMatteColor, CPDF_Dictionary* pFormResources, CPDF_Dictionary* pPageResources, - FX_BOOL bStdCS = FALSE, FX_DWORD GroupFamily = 0, FX_BOOL bLoadMask = FALSE); - virtual FX_BOOL SkipToScanline(int line, IFX_Pause* pPause) const; + bool bStdCS = false, FX_DWORD GroupFamily = 0, bool bLoadMask = false); + virtual bool SkipToScanline(int line, IFX_Pause* pPause) const; virtual uint8_t* GetBuffer() const; virtual const uint8_t* GetScanline(int line) const; virtual void DownSampleScanline(int line, uint8_t* dest_scan, int dest_bpp, - int dest_width, FX_BOOL bFlipX, int clip_left, int clip_width) const; + int dest_width, bool bFlipX, int clip_left, int clip_width) const; virtual void SetDownSampleSize(int dest_width, int dest_height) const; CFX_DIBitmap* GetBitmap() const; void ReleaseBitmap(CFX_DIBitmap*) const; void ClearImageData(); public: - int StartLoadDIBSource(CPDF_Document* pDoc, const CPDF_Stream* pStream, FX_BOOL bHasMask, + int StartLoadDIBSource(CPDF_Document* pDoc, const CPDF_Stream* pStream, bool bHasMask, CPDF_Dictionary* pFormResources, CPDF_Dictionary* pPageResources, - FX_BOOL bStdCS = FALSE, FX_DWORD GroupFamily = 0, FX_BOOL bLoadMask = FALSE); + bool bStdCS = false, FX_DWORD GroupFamily = 0, bool bLoadMask = false); int ContinueLoadDIBSource(IFX_Pause* pPause); int StratLoadMask(); int StartLoadMaskDIB(); @@ -415,13 +415,13 @@ public: FX_DWORD m_MatteColor; void* m_pJbig2Context; CPDF_StreamAcc* m_pGlobalStream; - FX_BOOL m_bStdCS; + bool m_bStdCS; int m_Status; CPDF_Object* m_pMaskStream; - FX_BOOL m_bHasMask; + bool m_bHasMask; protected: - FX_BOOL LoadColorInfo(CPDF_Dictionary* pFormResources, CPDF_Dictionary* pPageResources); - DIB_COMP_DATA* GetDecodeAndMaskArray(FX_BOOL& bDefaultDecode, FX_BOOL& bColorKey); + bool LoadColorInfo(CPDF_Dictionary* pFormResources, CPDF_Dictionary* pPageResources); + DIB_COMP_DATA* GetDecodeAndMaskArray(bool& bDefaultDecode, bool& bColorKey); CPDF_DIBSource* LoadMask(FX_DWORD& MatteColor); CPDF_DIBSource* LoadMaskDIB(CPDF_Stream* pMask); void LoadJpxBitmap(); @@ -439,11 +439,11 @@ protected: FX_DWORD m_bpc_orig; FX_DWORD m_nComponents; FX_DWORD m_GroupFamily; - FX_BOOL m_bLoadMask; - FX_BOOL m_bDefaultDecode; - FX_BOOL m_bImageMask; - FX_BOOL m_bDoBpcCheck; - FX_BOOL m_bColorKey; + bool m_bLoadMask; + bool m_bDefaultDecode; + bool m_bImageMask; + bool m_bDoBpcCheck; + bool m_bColorKey; DIB_COMP_DATA* m_pCompData; uint8_t* m_pLineBuf; uint8_t* m_pMaskedLine; |