summaryrefslogtreecommitdiff
path: root/core/src/fpdfapi/fpdf_render
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-07-27 12:08:12 -0700
committerTom Sepez <tsepez@chromium.org>2015-07-27 12:08:12 -0700
commit8d2aae7ee320da3a8ffe01c57e38b3f98443257d (patch)
treee694c6f82ec72fa46e6172b4475996b30d3f6a3a /core/src/fpdfapi/fpdf_render
parentff46aaf499edcf153ee2f57c7016587aa96dcfa0 (diff)
downloadpdfium-8d2aae7ee320da3a8ffe01c57e38b3f98443257d.tar.xz
Revert "FX Bool considered harmful, part 3"
This reverts commit ff46aaf499edcf153ee2f57c7016587aa96dcfa0. TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1255293002 .
Diffstat (limited to 'core/src/fpdfapi/fpdf_render')
-rw-r--r--core/src/fpdfapi/fpdf_render/fpdf_render.cpp164
-rw-r--r--core/src/fpdfapi/fpdf_render/fpdf_render_cache.cpp38
-rw-r--r--core/src/fpdfapi/fpdf_render/fpdf_render_image.cpp186
-rw-r--r--core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp180
-rw-r--r--core/src/fpdfapi/fpdf_render/fpdf_render_pattern.cpp64
-rw-r--r--core/src/fpdfapi/fpdf_render/fpdf_render_text.cpp110
-rw-r--r--core/src/fpdfapi/fpdf_render/render_int.h162
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 a70f5bfdf9..f8b59913e4 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(bool bRelease)
+void CPDF_DocRenderData::Clear(FX_BOOL bRelease)
{
for (auto it = m_Type3FaceMap.begin(); it != m_Type3FaceMap.end();) {
auto curr_it = it++;
@@ -48,7 +48,7 @@ void CPDF_DocRenderData::Clear(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;
}
-bool CPDF_RenderStatus::Initialize(CPDF_RenderContext* pContext, CFX_RenderDevice* pDevice,
+FX_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, bool bDropObjects,
- CPDF_Dictionary* pFormResource, bool bStdCS, CPDF_Type3Char* pType3Char,
+ const CPDF_RenderOptions* pOptions, int transparency, FX_BOOL bDropObjects,
+ CPDF_Dictionary* pFormResource, FX_BOOL bStdCS, CPDF_Type3Char* pType3Char,
FX_ARGB fill_color, FX_DWORD GroupFamily,
- bool bLoadMask)
+ FX_BOOL bLoadMask)
{
m_pContext = pContext;
m_pDevice = pDevice;
@@ -253,7 +253,7 @@ bool CPDF_RenderStatus::Initialize(CPDF_RenderContext* pContext, CFX_RenderDevic
}
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);
}
-bool CPDF_RenderStatus::ContinueSingleObject(const CPDF_PageObject* pObj, const CFX_AffineMatrix* pObj2Device, IFX_Pause* pPause)
+FX_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;
}
-bool CPDF_RenderStatus::GetObjectClippedRect(const CPDF_PageObject* pObj, const CFX_AffineMatrix* pObj2Device, bool bLogical, FX_RECT &rect) const
+FX_BOOL CPDF_RenderStatus::GetObjectClippedRect(const CPDF_PageObject* pObj, const CFX_AffineMatrix* pObj2Device, FX_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)
{
- bool bRet = false;
+ FX_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);
}
}
-bool CPDF_RenderStatus::DrawObjWithBlend(const CPDF_PageObject* pObj, const CFX_AffineMatrix* pObj2Device)
+FX_BOOL CPDF_RenderStatus::DrawObjWithBlend(const CPDF_PageObject* pObj, const CFX_AffineMatrix* pObj2Device)
{
- bool bRet = false;
+ FX_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();
}
-bool CPDF_RenderStatus::ProcessForm(CPDF_FormObject* pFormObj, const CFX_AffineMatrix* pObj2Device)
+FX_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 @@ bool CPDF_RenderStatus::ProcessForm(CPDF_FormObject* pFormObj, const CFX_AffineM
}
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;
}
-bool IsAvailableMatrix(const CFX_AffineMatrix& matrix)
+FX_BOOL IsAvailableMatrix(const CFX_AffineMatrix& matrix)
{
if (matrix.a == 0 || matrix.d == 0) {
return matrix.b != 0 && matrix.c != 0;
@@ -489,15 +489,15 @@ bool IsAvailableMatrix(const CFX_AffineMatrix& matrix)
if (matrix.b == 0 || matrix.c == 0) {
return matrix.a != 0 && matrix.d != 0;
}
- return true;
+ return TRUE;
}
-bool CPDF_RenderStatus::ProcessPath(CPDF_PathObject* pPathObj, const CFX_AffineMatrix* pObj2Device)
+FX_BOOL CPDF_RenderStatus::ProcessPath(CPDF_PathObject* pPathObj, const CFX_AffineMatrix* pObj2Device)
{
int FillType = pPathObj->m_FillType;
- bool bStroke = pPathObj->m_bStroke;
+ FX_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 @@ bool CPDF_RenderStatus::ProcessPath(CPDF_PathObject* pPathObj, const CFX_AffineM
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, bool bType3) const
+FX_ARGB CPDF_RenderStatus::GetFillArgb(const CPDF_PageObject* pObj, FX_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);
}
}
-bool CPDF_RenderStatus::SelectClipPath(CPDF_PathObject* pPathObj, const CFX_AffineMatrix* pObj2Device, bool bStroke)
+FX_BOOL CPDF_RenderStatus::SelectClipPath(CPDF_PathObject* pPathObj, const CFX_AffineMatrix* pObj2Device, FX_BOOL bStroke)
{
CFX_AffineMatrix path_matrix = pPathObj->m_Matrix;
path_matrix.Concat(*pObj2Device);
@@ -707,12 +707,12 @@ bool CPDF_RenderStatus::SelectClipPath(CPDF_PathObject* pPathObj, const CFX_Affi
}
return m_pDevice->SetClip_PathFill(pPathObj->m_Path, &path_matrix, fill_mode);
}
-bool CPDF_RenderStatus::ProcessTransparency(const CPDF_PageObject* pPageObj, const CFX_AffineMatrix* pObj2Device)
+FX_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 @@ bool CPDF_RenderStatus::ProcessTransparency(const CPDF_PageObject* pPageObj, con
CPDF_Dictionary* pFormResource = NULL;
FX_FLOAT group_alpha = 1.0f;
int Transparency = m_Transparency;
- bool bGroupTransparent = false;
+ FX_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 @@ bool CPDF_RenderStatus::ProcessTransparency(const CPDF_PageObject* pPageObj, con
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");
}
}
- bool bTextClip = false;
+ FX_BOOL bTextClip = FALSE;
if (pPageObj->m_ClipPath.NotNull() && pPageObj->m_ClipPath.GetTextCount() &&
m_pDevice->GetDeviceClass() == FXDC_DISPLAY && !(m_pDevice->GetDeviceCaps(FXDC_RENDER_CAPS) & FXRC_SOFT_CLIP)) {
- bTextClip = true;
+ 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 @@ bool CPDF_RenderStatus::ProcessTransparency(const CPDF_PageObject* pPageObj, con
}
}
if (pSMaskDict == NULL && group_alpha == 1.0f && blend_type == FXDIB_BLEND_NORMAL && !bTextClip && !bGroupTransparent) {
- return false;
+ return FALSE;
}
- bool isolated = Transparency & PDFTRANS_ISOLATED;
+ FX_BOOL isolated = Transparency & PDFTRANS_ISOLATED;
if (m_bPrint) {
- bool bRet = false;
+ FX_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 @@ bool CPDF_RenderStatus::ProcessTransparency(const CPDF_PageObject* pPageObj, con
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 @@ bool CPDF_RenderStatus::ProcessTransparency(const CPDF_PageObject* pPageObj, con
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 @@ bool CPDF_RenderStatus::ProcessTransparency(const CPDF_PageObject* pPageObj, con
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 @@ bool CPDF_RenderStatus::ProcessTransparency(const CPDF_PageObject* pPageObj, con
}
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 @@ bool CPDF_RenderStatus::ProcessTransparency(const CPDF_PageObject* pPageObj, con
}
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,
- bool bBackAlphaRequired)
+ FX_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;
}
- bool bNeedDraw;
+ FX_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, bool bStroke)
+CPDF_GraphicStates* CPDF_RenderStatus::CloneObjStates(const CPDF_GraphicStates* pSrcStates, FX_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, bool bFirstLayer)
+ CPDF_Dictionary* pPageResources, FX_BOOL bFirstLayer)
{
m_pDocument = pDoc;
m_pPageResources = pPageResources;
m_pPageCache = pPageCache;
m_bFirstLayer = bFirstLayer;
}
-void CPDF_RenderContext::Create(CPDF_Page* pPage, bool bFirstLayer)
+void CPDF_RenderContext::Create(CPDF_Page* pPage, FX_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 };
- bool bUniTransfer = true;
- bool bIdentity = true;
+ FX_BOOL bUniTransfer = TRUE;
+ FX_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;
}
-bool CPDF_DeviceBuffer::Initialize(CPDF_RenderContext* pContext, CFX_RenderDevice* pDevice, FX_RECT* pRect,
+FX_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 @@ bool CPDF_DeviceBuffer::Initialize(CPDF_RenderContext* pContext, CFX_RenderDevic
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)
-bool CPDF_ScaledRenderBuffer::Initialize(CPDF_RenderContext* pContext, CFX_RenderDevice* pDevice, FX_RECT* pRect,
+FX_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 @@ bool CPDF_ScaledRenderBuffer::Initialize(CPDF_RenderContext* pContext, CFX_Rende
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 @@ bool CPDF_ScaledRenderBuffer::Initialize(CPDF_RenderContext* pContext, CFX_Rende
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());
}
}
-bool IPDF_OCContext::CheckObjectVisible(const CPDF_PageObject* pObj)
+FX_BOOL IPDF_OCContext::CheckObjectVisible(const CPDF_PageObject* pObj)
{
const CPDF_ContentMarkData* pData = pObj->m_ContentMark;
int nItems = pData->CountItems();
@@ -1383,9 +1383,9 @@ 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 d9767b4817..cdbecd65ea 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,
- bool bStdCS, FX_DWORD GroupFamily, bool bLoadMask, CPDF_RenderStatus* pRenderStatus,
+ FX_BOOL bStdCS, FX_DWORD GroupFamily, FX_BOOL bLoadMask, CPDF_RenderStatus* pRenderStatus,
int32_t downsampleWidth, int32_t downsampleHeight)
{
CPDF_ImageCache* pImageCache;
- bool bFind = m_ImageCaches.Lookup(pStream, (void*&)pImageCache);
+ FX_BOOL bFind = m_ImageCaches.Lookup(pStream, (void*&)pImageCache);
if (!bFind) {
pImageCache = new CPDF_ImageCache(m_pPage->m_pDocument, pStream);
}
m_nTimeCount ++;
- bool bCached = pImageCache->GetCachedBitmap(pBitmap, pMask, MatteColor, m_pPage->m_pPageResources, bStdCS, GroupFamily, bLoadMask, pRenderStatus, downsampleWidth, downsampleHeight);
+ FX_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();
}
}
-bool CPDF_PageRenderCache::StartGetCachedBitmap(CPDF_Stream* pStream, bool bStdCS, FX_DWORD GroupFamily, bool bLoadMask, CPDF_RenderStatus* pRenderStatus, int32_t downsampleWidth, int32_t downsampleHeight)
+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)
{
m_bCurFindCache = m_ImageCaches.Lookup(pStream, (void*&)m_pCurImageCache);
if (!m_bCurFindCache) {
@@ -133,7 +133,7 @@ bool CPDF_PageRenderCache::StartGetCachedBitmap(CPDF_Stream* pStream, bool bStdC
}
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 @@ bool CPDF_PageRenderCache::StartGetCachedBitmap(CPDF_Stream* pStream, bool bStdC
if (!ret) {
m_nCacheSize += m_pCurImageCache->EstimateSize();
}
- return false;
+ return FALSE;
}
-bool CPDF_PageRenderCache::Continue(IFX_Pause* pPause)
+FX_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 @@ 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;
}
-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,
+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,
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 @@ bool CPDF_ImageCache::GetCachedBitmap(CFX_DIBSource*& pBitmap, CFX_DIBSource*& p
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 @@ bool CPDF_ImageCache::GetCachedBitmap(CFX_DIBSource*& pBitmap, CFX_DIBSource*& p
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, bool bStdCS,
- FX_DWORD GroupFamily, bool bLoadMask, CPDF_RenderStatus* pRenderStatus,
+int CPDF_ImageCache::StartGetCachedBitmap(CPDF_Dictionary* pFormResources, CPDF_Dictionary* pPageResources, FX_BOOL bStdCS,
+ FX_DWORD GroupFamily, FX_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 258ad111fa..fa9325a4d2 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"
-bool CPDF_RenderStatus::ProcessImage(CPDF_ImageObject* pImageObj, const CFX_AffineMatrix* pObj2Device)
+FX_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;
}
- bool bIsolated = Transparency & PDFTRANS_ISOLATED;
- bool bGroup = Transparency & PDFTRANS_GROUP;
+ FX_BOOL bIsolated = Transparency & PDFTRANS_ISOLATED;
+ FX_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
}
}
}
- bool bBackAlphaRequired = blend_mode && bIsolated && !m_bDropObjects;
- bool bGetBackGround = ((m_pDevice->GetRenderCaps() & FXRC_ALPHA_OUTPUT)) ||
+ FX_BOOL bBackAlphaRequired = blend_mode && bIsolated && !m_bDropObjects;
+ FX_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;
- bool bClone = false;
+ FX_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, bool bAutoDropSrc)
+CFX_DIBSource* CPDF_TransferFunc::TranslateImage(const CFX_DIBSource* pSrc, FX_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;
- bool bSkip = false;
+ FX_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 bool _IsSupported(CPDF_ColorSpace* pCS)
+static FX_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;
}
-bool CPDF_ImageRenderer::StartLoadDIBSource()
+FX_BOOL CPDF_ImageRenderer::StartLoadDIBSource()
{
CFX_FloatRect image_rect_f = m_ImageMatrix.GetUnitRect();
FX_RECT image_rect = image_rect_f.GetOutterRect();
@@ -321,16 +321,16 @@ 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;
}
-bool CPDF_ImageRenderer::StartRenderDIBSource()
+FX_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 @@ 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 @@ bool CPDF_ImageRenderer::StartRenderDIBSource()
}
return StartDIBSource();
}
-bool CPDF_ImageRenderer::Start(CPDF_RenderStatus* pStatus, const CPDF_PageObject* pObj, const CFX_AffineMatrix* pObj2Device, bool bStdCS, int blendType)
+FX_BOOL CPDF_ImageRenderer::Start(CPDF_RenderStatus* pStatus, const CPDF_PageObject* pObj, const CFX_AffineMatrix* pObj2Device, FX_BOOL bStdCS, int blendType)
{
m_pRenderStatus = pStatus;
m_bStdCS = bStdCS;
@@ -439,17 +439,17 @@ bool CPDF_ImageRenderer::Start(CPDF_RenderStatus* pStatus, const CPDF_PageObject
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();
}
-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)
+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)
{
m_pRenderStatus = pStatus;
m_pDIBSource = pDIBSource;
@@ -461,16 +461,16 @@ bool CPDF_ImageRenderer::Start(CPDF_RenderStatus* pStatus, const CFX_DIBSource*
m_BlendType = blendType;
return StartDIBSource();
}
-bool CPDF_ImageRenderer::DrawPatternImage(const CFX_Matrix* pObj2Device)
+FX_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 @@ 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 @@ 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;
}
-bool CPDF_ImageRenderer::DrawMaskedImage()
+FX_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 @@ 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 @@ bool CPDF_ImageRenderer::DrawMaskedImage()
}
}
m_pRenderStatus->m_pDevice->SetDIBits(bitmap_device1.GetBitmap(), rect.left, rect.top, m_BlendType);
- return false;
+ return FALSE;
}
-bool CPDF_ImageRenderer::StartDIBSource()
+FX_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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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;
}
-bool CPDF_ImageRenderer::StartBitmapAlpha()
+FX_BOOL CPDF_ImageRenderer::StartBitmapAlpha()
{
if (m_pDIBSource->IsOpaqueImage()) {
CFX_PathData path;
@@ -728,7 +728,7 @@ 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 @@ bool CPDF_ImageRenderer::StartBitmapAlpha()
delete pAlphaMask;
}
}
- return false;
+ return FALSE;
}
-bool CPDF_ImageRenderer::Continue(IFX_Pause* pPause)
+FX_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 @@ 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 @@ 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);
-bool CPDF_QuickStretcher::Start(CPDF_ImageObject* pImageObj, CFX_AffineMatrix* pImage2Device, const FX_RECT* pClipBox)
+FX_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 @@ bool CPDF_QuickStretcher::Start(CPDF_ImageObject* pImageObj, CFX_AffineMatrix* p
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 @@ bool CPDF_QuickStretcher::Start(CPDF_ImageObject* pImageObj, CFX_AffineMatrix* p
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 @@ bool CPDF_QuickStretcher::Start(CPDF_ImageObject* pImageObj, CFX_AffineMatrix* p
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 @@ bool CPDF_QuickStretcher::Start(CPDF_ImageObject* pImageObj, CFX_AffineMatrix* p
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 @@ bool CPDF_QuickStretcher::Start(CPDF_ImageObject* pImageObj, CFX_AffineMatrix* p
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 @@ bool CPDF_QuickStretcher::Start(CPDF_ImageObject* pImageObj, CFX_AffineMatrix* p
m_pBitmap->Create(m_ResultWidth, m_ResultHeight, FXDIB_Rgb);
#endif
m_LineIndex = 0;
- return true;
+ return TRUE;
}
-bool CPDF_QuickStretcher::Continue(IFX_Pause* pPause)
+FX_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 @@ 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;
- bool bLuminosity = false;
+ FX_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 0861048eb7..7d17e78e24 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, bool bStdCS, FX_DWORD GroupFamily, bool bLoadMask) const
+CFX_DIBSource* CPDF_Image::LoadDIBSource(CFX_DIBSource** ppMask, FX_DWORD* pMatteColor, FX_BOOL bStdCS, FX_DWORD GroupFamily, FX_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;
}
-bool CPDF_Image::StartLoadDIBSource(CPDF_Dictionary* pFormResource, CPDF_Dictionary* pPageResource, bool bStdCS, FX_DWORD GroupFamily, bool bLoadMask)
+FX_BOOL CPDF_Image::StartLoadDIBSource(CPDF_Dictionary* pFormResource, CPDF_Dictionary* pPageResource, FX_BOOL bStdCS, FX_DWORD GroupFamily, FX_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;
}
-bool CPDF_Image::Continue(IFX_Pause* pPause)
+FX_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;
}
}
-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)
+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)
{
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 @@ bool CPDF_DIBSource::Load(CPDF_Document* pDoc, const CPDF_Stream* pStream, CPDF_
}
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 @@ bool CPDF_DIBSource::Load(CPDF_Document* pDoc, const CPDF_Stream* pStream, CPDF_
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 @@ bool CPDF_DIBSource::Load(CPDF_Document* pDoc, const CPDF_Stream* pStream, CPDF_
*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, bool bHasMask,
+int CPDF_DIBSource::StartLoadDIBSource(CPDF_Document* pDoc, const CPDF_Stream* pStream, FX_BOOL bHasMask,
CPDF_Dictionary* pFormResources, CPDF_Dictionary* pPageResources,
- bool bStdCS, FX_DWORD GroupFamily, bool bLoadMask)
+ FX_BOOL bStdCS, FX_DWORD GroupFamily, FX_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;
}
-bool CPDF_DIBSource::LoadColorInfo(CPDF_Dictionary* pFormResources, CPDF_Dictionary* pPageResources)
+FX_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 @@ bool CPDF_DIBSource::LoadColorInfo(CPDF_Dictionary* pFormResources, CPDF_Diction
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 @@ bool CPDF_DIBSource::LoadColorInfo(CPDF_Dictionary* pFormResources, CPDF_Diction
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 @@ bool CPDF_DIBSource::LoadColorInfo(CPDF_Dictionary* pFormResources, CPDF_Diction
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(bool& bDefaultDecode, bool& bColorKey)
+DIB_COMP_DATA* CPDF_DIBSource::GetDecodeAndMaskArray(FX_BOOL& bDefaultDecode, FX_BOOL& bColorKey)
{
if (m_pColorSpace == NULL) {
return NULL;
@@ -556,7 +556,7 @@ DIB_COMP_DATA* CPDF_DIBSource::GetDecodeAndMaskArray(bool& bDefaultDecode, bool&
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(bool& bDefaultDecode, bool&
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) {
- bool bTransform = false;
+ FX_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;
- bool bTranslateColor;
- bool bSwapRGB = false;
+ FX_BOOL bTranslateColor;
+ FX_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;
}
-bool CPDF_DIBSource::SkipToScanline(int line, IFX_Pause* pPause) const
+FX_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, bool bFlipX, int clip_left, int clip_width) const
+ int dest_width, FX_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()
{
}
-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)
+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)
{
m_pImageLoader = pImageLoader;
m_pCache = pCache;
m_pImage = (CPDF_ImageObject*)pImage;
m_nDownsampleWidth = nDownsampleWidth;
m_nDownsampleHeight = nDownsampleHeight;
- bool ret;
+ FX_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 @@ bool CPDF_ProgressiveImageLoaderHandle::Start(CPDF_ImageLoader* pImageLoader, co
}
return ret;
}
-bool CPDF_ProgressiveImageLoaderHandle::Continue(IFX_Pause* pPause)
+FX_BOOL CPDF_ProgressiveImageLoaderHandle::Continue(IFX_Pause* pPause)
{
- bool ret;
+ FX_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 @@ bool CPDF_ProgressiveImageLoaderHandle::Continue(IFX_Pause* pPause)
}
return ret;
}
-bool CPDF_ImageLoader::Load(const CPDF_ImageObject* pImage, CPDF_PageRenderCache* pCache, bool bStdCS, FX_DWORD GroupFamily, bool bLoadMask, CPDF_RenderStatus* pRenderStatus)
+FX_BOOL CPDF_ImageLoader::Load(const CPDF_ImageObject* pImage, CPDF_PageRenderCache* pCache, FX_BOOL bStdCS, FX_DWORD GroupFamily, FX_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;
}
-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)
+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)
{
m_nDownsampleWidth = nDownsampleWidth;
m_nDownsampleHeight = nDownsampleHeight;
CPDF_ProgressiveImageLoaderHandle* pLoaderHandle = new CPDF_ProgressiveImageLoaderHandle;
- bool ret = pLoaderHandle->Start(this, pImage, pCache, bStdCS, GroupFamily, bLoadMask, pRenderStatus, m_nDownsampleWidth, m_nDownsampleHeight);
+ FX_BOOL ret = pLoaderHandle->Start(this, pImage, pCache, bStdCS, GroupFamily, bLoadMask, pRenderStatus, m_nDownsampleWidth, m_nDownsampleHeight);
LoadHandle = pLoaderHandle;
return ret;
}
-bool CPDF_ImageLoader::Continue(void* LoadHandle, IFX_Pause* pPause)
+FX_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 e08649062c..3ee2222d8b 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);
}
- bool bStartExtend = false, bEndExtend = false;
+ FX_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);
}
- bool bStartExtend = false, bEndExtend = false;
+ FX_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();
- bool bDecreasing = false;
+ FX_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
}
}
}
-bool _GetScanlineIntersect(int y, FX_FLOAT x1, FX_FLOAT y1, FX_FLOAT x2, FX_FLOAT y2, FX_FLOAT& x)
+FX_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];
- bool bIntersect = _GetScanlineIntersect(y, vertex1.x, vertex1.y,
+ FX_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)
{
- bool bSmall = C1.Distance() < 2 && C2.Distance() < 2 && D1.Distance() < 2 && D2.Distance() < 2;
+ FX_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 {
}
};
-bool _CheckCoonTensorPara(const CPDF_MeshStream &stream)
+FX_BOOL _CheckCoonTensorPara(const CPDF_MeshStream &stream)
{
- bool bCoorBits = ( stream.m_nCoordBits== 1 ||
+ FX_BOOL bCoorBits = ( stream.m_nCoordBits== 1 ||
stream.m_nCoordBits == 2 ||
stream.m_nCoordBits == 4 ||
stream.m_nCoordBits == 8 ||
@@ -674,21 +674,21 @@ bool _CheckCoonTensorPara(const CPDF_MeshStream &stream)
stream.m_nCoordBits == 24 ||
stream.m_nCoordBits == 32 );
- bool bCompBits = ( stream.m_nCompBits == 1 ||
+ FX_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 );
- bool bFlagBits = ( stream.m_nFlagBits == 2 ||
+ FX_BOOL bFlagBits = ( stream.m_nFlagBits == 2 ||
stream.m_nFlagBits == 4 ||
stream.m_nFlagBits == 8 );
return bCoorBits && bCompBits && bFlagBits;
}
-static void _DrawCoonPatchMeshes(bool bTensor, CFX_DIBitmap* pBitmap, CFX_AffineMatrix* pObject2Bitmap,
+static void _DrawCoonPatchMeshes(FX_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(bool bTensor, CFX_DIBitmap* pBitmap, CFX_Affine
}
}
void CPDF_RenderStatus::DrawShading(CPDF_ShadingPattern* pPattern, CFX_AffineMatrix* pMatrix,
- FX_RECT& clip_rect, int alpha, bool bAlphaMode)
+ FX_RECT& clip_rect, int alpha, FX_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, bool bStroke)
+void CPDF_RenderStatus::DrawShadingPattern(CPDF_ShadingPattern* pattern, CPDF_PageObject* pPageObj, const CFX_AffineMatrix* pObj2Device, FX_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();
}
-bool CPDF_RenderStatus::ProcessShading(CPDF_ShadingObject* pShadingObj, const CFX_AffineMatrix* pObj2Device)
+FX_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, bool bStroke)
+void CPDF_RenderStatus::DrawTilingPattern(CPDF_TilingPattern* pPattern, CPDF_PageObject* pPageObj, const CFX_AffineMatrix* pObj2Device, FX_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);
- bool bAligned = false;
+ FX_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, bool bStroke)
+void CPDF_RenderStatus::DrawPathWithPattern(CPDF_PathObject* pPathObj, const CFX_AffineMatrix* pObj2Device, CPDF_Color* pColor, FX_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, bool& bStroke)
+void CPDF_RenderStatus::ProcessPathPattern(CPDF_PathObject* pPathObj, const CFX_AffineMatrix* pObj2Device, int& filltype, FX_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 26138a9fbf..ad5dc58a1c 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 bool IsAvailableMatrix(const CFX_AffineMatrix& matrix);
+extern FX_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 bool _IsScanLine1bpp(uint8_t* pBuf, int width)
+static FX_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 bool _IsScanLine8bpp(uint8_t* pBuf, int width)
+static FX_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, bool bFirst)
+static int _DetectFirstLastScan(const CFX_DIBitmap* pBitmap, FX_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;
- bool bFlipped = top_y > bottom_y;
+ FX_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);
}
-bool CPDF_RenderStatus::ProcessText(const CPDF_TextObject* textobj, const CFX_AffineMatrix* pObj2Device, CFX_PathData* pClippingPath)
+FX_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);
}
- bool bFill = false, bStroke = false, bClip = false;
+ FX_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;
- bool bPattern = false;
+ FX_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());
}
-bool CPDF_Type3Char::LoadBitmap(CPDF_RenderContext* pContext)
+FX_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 @@ 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;
};
-bool CPDF_RenderStatus::ProcessType3Text(const CPDF_TextObject* textobj, const CFX_AffineMatrix* pObj2Device)
+FX_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 @@ bool CPDF_RenderStatus::ProcessType3Text(const CPDF_TextObject* textobj, const C
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 @@ bool CPDF_RenderStatus::ProcessType3Text(const CPDF_TextObject* textobj, const C
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 @@ bool CPDF_RenderStatus::ProcessType3Text(const CPDF_TextObject* textobj, const C
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 @@ bool CPDF_RenderStatus::ProcessType3Text(const CPDF_TextObject* textobj, const C
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 @@ bool CPDF_RenderStatus::ProcessType3Text(const CPDF_TextObject* textobj, const C
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 @@ bool CPDF_RenderStatus::ProcessType3Text(const CPDF_TextObject* textobj, const C
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 @@ bool CPDF_RenderStatus::ProcessType3Text(const CPDF_TextObject* textobj, const C
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();
- bool bVertWriting = pCIDFont && pCIDFont->IsVertWriting();
+ FX_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;
}
- bool bVert = false;
+ FX_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;
}
}
}
-bool CPDF_TextRenderer::DrawTextPath(CFX_RenderDevice* pDevice, int nChars, FX_DWORD* pCharCodes, FX_FLOAT* pCharPos,
+FX_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);
}
}
-bool CPDF_TextRenderer::DrawNormalText(CFX_RenderDevice* pDevice, int nChars, FX_DWORD* pCharCodes, FX_FLOAT* pCharPos,
+FX_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 @@ bool CPDF_TextRenderer::DrawNormalText(CFX_RenderDevice* pDevice, int nChars, FX
}
void CPDF_RenderStatus::DrawTextPathWithPattern(const CPDF_TextObject* textobj, const CFX_AffineMatrix* pObj2Device,
CPDF_Font* pFont, FX_FLOAT font_size,
- const CFX_AffineMatrix* pTextMatrix, bool bFill, bool bStroke)
+ const CFX_AffineMatrix* pTextMatrix, FX_BOOL bFill, FX_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 c9c8944a0b..e5fb831a63 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];
- bool m_bIdentity;
+ FX_BOOL m_bIdentity;
- CFX_DIBSource* TranslateImage(const CFX_DIBSource* pSrc, bool bAutoDropSrc);
+ CFX_DIBSource* TranslateImage(const CFX_DIBSource* pSrc, FX_BOOL bAutoDropSrc);
FX_COLORREF TranslateColor(FX_COLORREF src);
};
@@ -66,7 +66,7 @@ public:
{
return m_pFontCache;
}
- void Clear(bool bRelease = false);
+ void Clear(FX_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 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;
+ 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;
};
class CPDF_RenderStatus
{
public:
CPDF_RenderStatus();
~CPDF_RenderStatus();
- bool Initialize(class CPDF_RenderContext* pContext, CFX_RenderDevice* pDevice, const CFX_AffineMatrix* pDeviceMatrix,
+ FX_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, 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);
+ 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);
void RenderObjectList(const CPDF_PageObjects* pObjs, const CFX_AffineMatrix* pObj2Device);
void RenderSingleObject(const CPDF_PageObject* pObj, const CFX_AffineMatrix* pObj2Device);
- bool ContinueSingleObject(const CPDF_PageObject* pObj, const CFX_AffineMatrix* pObj2Device, IFX_Pause* pPause);
+ FX_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);
- bool ProcessTransparency(const CPDF_PageObject* PageObj, const CFX_AffineMatrix* pObj2Device);
+ FX_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);
- 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,
+ 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,
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);
- bool ProcessShading(CPDF_ShadingObject* pShadingObj, const CFX_AffineMatrix* pObj2Device);
+ FX_BOOL ProcessShading(CPDF_ShadingObject* pShadingObj, const CFX_AffineMatrix* pObj2Device);
void DrawShading(CPDF_ShadingPattern* pPattern, CFX_AffineMatrix* pMatrix, FX_RECT& clip_rect,
- 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);
+ 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);
void DrawTextPathWithPattern(const CPDF_TextObject* textobj, const CFX_AffineMatrix* pObj2Device,
CPDF_Font* pFont, FX_FLOAT font_size,
- const CFX_AffineMatrix* pTextMatrix, bool bFill, bool bStroke);
- bool ProcessForm(CPDF_FormObject* pFormObj, const CFX_AffineMatrix* pObj2Device);
+ const CFX_AffineMatrix* pTextMatrix, FX_BOOL bFill, FX_BOOL bStroke);
+ FX_BOOL ProcessForm(CPDF_FormObject* pFormObj, const CFX_AffineMatrix* pObj2Device);
CFX_DIBitmap* GetBackdrop(const CPDF_PageObject* pObj, const FX_RECT& rect, int& left, int& top,
- bool bBackAlphaRequired);
+ FX_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, bool bStroke);
+ static CPDF_GraphicStates* CloneObjStates(const CPDF_GraphicStates* pPathObj, FX_BOOL bStroke);
CPDF_TransferFunc* GetTransferFunc(CPDF_Object* pObject) const;
- FX_ARGB GetFillArgb(const CPDF_PageObject* pObj, bool bType3 = false) const;
+ FX_ARGB GetFillArgb(const CPDF_PageObject* pObj, FX_BOOL bType3 = FALSE) const;
FX_ARGB GetStrokeArgb(const CPDF_PageObject* pObj) const;
CPDF_RenderContext* m_pContext;
- bool m_bStopped;
+ FX_BOOL m_bStopped;
void DitherObjectArea(const CPDF_PageObject* pObj, const CFX_AffineMatrix* pObj2Device);
- bool GetObjectClippedRect(const CPDF_PageObject* pObj, const CFX_AffineMatrix* pObj2Device, bool bLogical, FX_RECT &rect) const;
+ FX_BOOL GetObjectClippedRect(const CPDF_PageObject* pObj, const CFX_AffineMatrix* pObj2Device, FX_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;
- bool m_bPrint;
+ FX_BOOL m_bPrint;
int m_Transparency;
int m_DitherBits;
- bool m_bDropObjects;
- bool m_bStdCS;
+ FX_BOOL m_bDropObjects;
+ FX_BOOL m_bStdCS;
FX_DWORD m_GroupFamily;
- bool m_bLoadMask;
+ FX_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;
}
- 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 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 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);
+ 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);
~CPDF_ImageLoader();
CFX_DIBSource* m_pBitmap;
CFX_DIBSource* m_pMask;
FX_DWORD m_MatteColor;
- bool m_bCached;
+ FX_BOOL m_bCached;
protected:
int32_t m_nDownsampleWidth;
int32_t m_nDownsampleHeight;
@@ -218,8 +218,8 @@ public:
CPDF_ProgressiveImageLoaderHandle();
~CPDF_ProgressiveImageLoaderHandle();
- 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);
+ 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);
protected:
CPDF_ImageLoader* m_pImageLoader;
CPDF_PageRenderCache* m_pCache;
@@ -233,10 +233,10 @@ class CPDF_ImageRenderer : public IPDF_ObjectRenderer
public:
CPDF_ImageRenderer();
~CPDF_ImageRenderer();
- 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);
+ 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);
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;
- bool m_bPatternColor;
+ FX_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;
- bool m_bStdCS;
+ FX_BOOL m_bStdCS;
int m_BlendType;
- bool StartBitmapAlpha();
- bool StartDIBSource();
- bool StartRenderDIBSource();
- bool StartLoadDIBSource();
- bool DrawMaskedImage();
- bool DrawPatternImage(const CFX_Matrix* pObj2Device);
+ FX_BOOL StartBitmapAlpha();
+ FX_BOOL StartDIBSource();
+ FX_BOOL StartRenderDIBSource();
+ FX_BOOL StartLoadDIBSource();
+ FX_BOOL DrawMaskedImage();
+ FX_BOOL DrawPatternImage(const CFX_Matrix* pObj2Device);
};
class CPDF_ScaledRenderBuffer
{
public:
CPDF_ScaledRenderBuffer();
~CPDF_ScaledRenderBuffer();
- bool Initialize(CPDF_RenderContext* pContext, CFX_RenderDevice* pDevice, FX_RECT* pRect,
+ FX_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();
- bool Start(CPDF_ImageObject* pImageObj, CFX_AffineMatrix* pImage2Device, const FX_RECT* pClipBox);
- bool Continue(IFX_Pause* pPause);
+ FX_BOOL Start(CPDF_ImageObject* pImageObj, CFX_AffineMatrix* pImage2Device, const FX_RECT* pClipBox);
+ FX_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;
- bool m_bFlipX, m_bFlipY;
+ FX_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();
- bool Initialize(CPDF_RenderContext* pContext, CFX_RenderDevice* pDevice, FX_RECT* pRect,
+ FX_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);
- bool GetCachedBitmap(CFX_DIBSource*& pBitmap, CFX_DIBSource*& pMask, FX_DWORD& MatteColor, CPDF_Dictionary* pPageResources,
- bool bStdCS = false, FX_DWORD GroupFamily = 0, bool bLoadMask = false,
+ 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,
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,
- bool bStdCS = false, FX_DWORD GroupFamily = 0,
- bool bLoadMask = false, CPDF_RenderStatus* pRenderStatus = NULL, int32_t downsampleWidth = 0, int32_t downsampleHeight = 0);
+ FX_BOOL bStdCS = FALSE, FX_DWORD GroupFamily = 0,
+ FX_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();
- bool Load(CPDF_Document* pDoc, const CPDF_Stream* pStream,
+ FX_BOOL Load(CPDF_Document* pDoc, const CPDF_Stream* pStream,
CPDF_DIBSource** ppMask, FX_DWORD* pMatteColor,
CPDF_Dictionary* pFormResources, CPDF_Dictionary* pPageResources,
- bool bStdCS = false, FX_DWORD GroupFamily = 0, bool bLoadMask = false);
- virtual bool SkipToScanline(int line, IFX_Pause* pPause) const;
+ FX_BOOL bStdCS = FALSE, FX_DWORD GroupFamily = 0, FX_BOOL bLoadMask = FALSE);
+ virtual FX_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, bool bFlipX, int clip_left, int clip_width) const;
+ int dest_width, FX_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, bool bHasMask,
+ int StartLoadDIBSource(CPDF_Document* pDoc, const CPDF_Stream* pStream, FX_BOOL bHasMask,
CPDF_Dictionary* pFormResources, CPDF_Dictionary* pPageResources,
- bool bStdCS = false, FX_DWORD GroupFamily = 0, bool bLoadMask = false);
+ FX_BOOL bStdCS = FALSE, FX_DWORD GroupFamily = 0, FX_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;
- bool m_bStdCS;
+ FX_BOOL m_bStdCS;
int m_Status;
CPDF_Object* m_pMaskStream;
- bool m_bHasMask;
+ FX_BOOL m_bHasMask;
protected:
- bool LoadColorInfo(CPDF_Dictionary* pFormResources, CPDF_Dictionary* pPageResources);
- DIB_COMP_DATA* GetDecodeAndMaskArray(bool& bDefaultDecode, bool& bColorKey);
+ FX_BOOL LoadColorInfo(CPDF_Dictionary* pFormResources, CPDF_Dictionary* pPageResources);
+ DIB_COMP_DATA* GetDecodeAndMaskArray(FX_BOOL& bDefaultDecode, FX_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;
- bool m_bLoadMask;
- bool m_bDefaultDecode;
- bool m_bImageMask;
- bool m_bDoBpcCheck;
- bool m_bColorKey;
+ FX_BOOL m_bLoadMask;
+ FX_BOOL m_bDefaultDecode;
+ FX_BOOL m_bImageMask;
+ FX_BOOL m_bDoBpcCheck;
+ FX_BOOL m_bColorKey;
DIB_COMP_DATA* m_pCompData;
uint8_t* m_pLineBuf;
uint8_t* m_pMaskedLine;