diff options
author | tsepez <tsepez@chromium.org> | 2016-09-02 15:22:00 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-09-02 15:22:00 -0700 |
commit | bbee445c5a77dfbaea9041308f001c756e49c5fd (patch) | |
tree | 65fe8d3808891c81c791e8592ba3aba8d9e2d81c /core/fpdfapi/fpdf_render | |
parent | d54c9d8df1511f6abac291ec2ec660cef372d9d3 (diff) | |
download | pdfium-bbee445c5a77dfbaea9041308f001c756e49c5fd.tar.xz |
Make CPDF_GeneralState have a CPDF_GeneralStateDatachromium/2848
Remove a const cast along the way and propagate to callers.
Review-Url: https://codereview.chromium.org/2303553002
Diffstat (limited to 'core/fpdfapi/fpdf_render')
-rw-r--r-- | core/fpdfapi/fpdf_render/fpdf_render.cpp | 94 | ||||
-rw-r--r-- | core/fpdfapi/fpdf_render/fpdf_render_image.cpp | 43 | ||||
-rw-r--r-- | core/fpdfapi/fpdf_render/fpdf_render_pattern.cpp | 12 | ||||
-rw-r--r-- | core/fpdfapi/fpdf_render/fpdf_render_text.cpp | 13 | ||||
-rw-r--r-- | core/fpdfapi/fpdf_render/render_int.h | 37 |
5 files changed, 89 insertions, 110 deletions
diff --git a/core/fpdfapi/fpdf_render/fpdf_render.cpp b/core/fpdfapi/fpdf_render/fpdf_render.cpp index 7df6b9a4b2..1ac5bfa04c 100644 --- a/core/fpdfapi/fpdf_render/fpdf_render.cpp +++ b/core/fpdfapi/fpdf_render/fpdf_render.cpp @@ -249,7 +249,7 @@ void CPDF_RenderStatus::RenderObjectList( #endif } -void CPDF_RenderStatus::RenderSingleObject(const CPDF_PageObject* pObj, +void CPDF_RenderStatus::RenderSingleObject(CPDF_PageObject* pObj, const CFX_Matrix* pObj2Device) { #if defined _SKIA_SUPPORT_ DebugVerifyDeviceIsPreMultiplied(); @@ -274,7 +274,7 @@ void CPDF_RenderStatus::RenderSingleObject(const CPDF_PageObject* pObj, #endif } -FX_BOOL CPDF_RenderStatus::ContinueSingleObject(const CPDF_PageObject* pObj, +FX_BOOL CPDF_RenderStatus::ContinueSingleObject(CPDF_PageObject* pObj, const CFX_Matrix* pObj2Device, IFX_Pause* pPause) { if (m_pImageRenderer) { @@ -335,7 +335,7 @@ FX_BOOL CPDF_RenderStatus::GetObjectClippedRect(const CPDF_PageObject* pObj, return rect.IsEmpty(); } -void CPDF_RenderStatus::ProcessObjectNoClip(const CPDF_PageObject* pObj, +void CPDF_RenderStatus::ProcessObjectNoClip(CPDF_PageObject* pObj, const CFX_Matrix* pObj2Device) { #if defined _SKIA_SUPPORT_ DebugVerifyDeviceIsPreMultiplied(); @@ -365,7 +365,7 @@ void CPDF_RenderStatus::ProcessObjectNoClip(const CPDF_PageObject* pObj, #endif } -FX_BOOL CPDF_RenderStatus::DrawObjWithBlend(const CPDF_PageObject* pObj, +FX_BOOL CPDF_RenderStatus::DrawObjWithBlend(CPDF_PageObject* pObj, const CFX_Matrix* pObj2Device) { FX_BOOL bRet = FALSE; switch (pObj->GetType()) { @@ -388,7 +388,8 @@ void CPDF_RenderStatus::GetScaledMatrix(CFX_Matrix& matrix) const { matrix.a *= FXSYS_fabs(dCTM.a); matrix.d *= FXSYS_fabs(dCTM.d); } -void CPDF_RenderStatus::DrawObjWithBackground(const CPDF_PageObject* pObj, + +void CPDF_RenderStatus::DrawObjWithBackground(CPDF_PageObject* pObj, const CFX_Matrix* pObj2Device) { FX_RECT rect; if (GetObjectClippedRect(pObj, pObj2Device, FALSE, rect)) { @@ -462,7 +463,7 @@ FX_BOOL IsAvailableMatrix(const CFX_Matrix& matrix) { return TRUE; } -FX_BOOL CPDF_RenderStatus::ProcessPath(const CPDF_PathObject* pPathObj, +FX_BOOL CPDF_RenderStatus::ProcessPath(CPDF_PathObject* pPathObj, const CFX_Matrix* pObj2Device) { int FillType = pPathObj->m_FillType; FX_BOOL bStroke = pPathObj->m_bStroke; @@ -485,9 +486,10 @@ FX_BOOL CPDF_RenderStatus::ProcessPath(const CPDF_PathObject* pPathObj, FillType |= FXFILL_NOPATHSMOOTH; if (bStroke) FillType |= FX_FILL_STROKE; - const CPDF_GeneralStateData* pGeneralData = - static_cast<const CPDF_PageObject*>(pPathObj)->m_GeneralState.GetObject(); - if (pGeneralData && pGeneralData->m_StrokeAdjust) + + const CPDF_PageObject* pPageObj = + static_cast<const CPDF_PageObject*>(pPathObj); + if (pPageObj->m_GeneralState.GetStrokeAdjust()) FillType |= FX_STROKE_ADJUST; if (m_pType3Char) FillType |= FX_FILL_TEXT_MODE; @@ -505,7 +507,8 @@ CPDF_TransferFunc* CPDF_RenderStatus::GetTransferFunc(CPDF_Object* pObj) const { CPDF_DocRenderData* pDocCache = m_pContext->GetDocument()->GetRenderData(); return pDocCache ? pDocCache->GetTransferFunc(pObj) : nullptr; } -FX_ARGB CPDF_RenderStatus::GetFillArgb(const CPDF_PageObject* pObj, + +FX_ARGB CPDF_RenderStatus::GetFillArgb(CPDF_PageObject* pObj, FX_BOOL bType3) const { const CPDF_ColorStateData* pColorData = pObj->m_ColorState.GetObject(); if (m_pType3Char && !bType3 && @@ -521,25 +524,20 @@ FX_ARGB CPDF_RenderStatus::GetFillArgb(const CPDF_PageObject* pObj, if (rgb == (uint32_t)-1) { return 0; } - const CPDF_GeneralStateData* pGeneralData = pObj->m_GeneralState.GetObject(); - int alpha; - if (pGeneralData) { - alpha = (int32_t)(pGeneralData->m_FillAlpha * 255); - if (pGeneralData->m_pTR) { - if (!pGeneralData->m_pTransferFunc) { - ((CPDF_GeneralStateData*)pGeneralData)->m_pTransferFunc = - GetTransferFunc(pGeneralData->m_pTR); - } - if (pGeneralData->m_pTransferFunc) { - rgb = pGeneralData->m_pTransferFunc->TranslateColor(rgb); - } + int32_t alpha = + static_cast<int32_t>((pObj->m_GeneralState.GetFillAlpha() * 255)); + if (pObj->m_GeneralState.GetTR()) { + if (!pObj->m_GeneralState.GetTransferFunc()) { + pObj->m_GeneralState.SetTransferFunc( + GetTransferFunc(pObj->m_GeneralState.GetTR())); } - } else { - alpha = 255; + if (pObj->m_GeneralState.GetTransferFunc()) + rgb = pObj->m_GeneralState.GetTransferFunc()->TranslateColor(rgb); } return m_Options.TranslateColor(ArgbEncode(alpha, rgb)); } -FX_ARGB CPDF_RenderStatus::GetStrokeArgb(const CPDF_PageObject* pObj) const { + +FX_ARGB CPDF_RenderStatus::GetStrokeArgb(CPDF_PageObject* pObj) const { const CPDF_ColorStateData* pColorData = pObj->m_ColorState.GetObject(); if (m_pType3Char && (!m_pType3Char->m_bColored || (m_pType3Char->m_bColored && @@ -553,21 +551,15 @@ FX_ARGB CPDF_RenderStatus::GetStrokeArgb(const CPDF_PageObject* pObj) const { if (rgb == (uint32_t)-1) { return 0; } - const CPDF_GeneralStateData* pGeneralData = pObj->m_GeneralState.GetObject(); - int alpha; - if (pGeneralData) { - alpha = (int32_t)(pGeneralData->m_StrokeAlpha * 255); - if (pGeneralData->m_pTR) { - if (!pGeneralData->m_pTransferFunc) { - ((CPDF_GeneralStateData*)pGeneralData)->m_pTransferFunc = - GetTransferFunc(pGeneralData->m_pTR); - } - if (pGeneralData->m_pTransferFunc) { - rgb = pGeneralData->m_pTransferFunc->TranslateColor(rgb); - } + int32_t alpha = static_cast<int32_t>(pObj->m_GeneralState.GetStrokeAlpha() * + 255); // not rounded. + if (pObj->m_GeneralState.GetTR()) { + if (!pObj->m_GeneralState.GetTransferFunc()) { + pObj->m_GeneralState.SetTransferFunc( + GetTransferFunc(pObj->m_GeneralState.GetTR())); } - } else { - alpha = 255; + if (pObj->m_GeneralState.GetTransferFunc()) + rgb = pObj->m_GeneralState.GetTransferFunc()->TranslateColor(rgb); } return m_Options.TranslateColor(ArgbEncode(alpha, rgb)); } @@ -675,20 +667,17 @@ FX_BOOL CPDF_RenderStatus::SelectClipPath(const CPDF_PathObject* pPathObj, return m_pDevice->SetClip_PathFill(pPathObj->m_Path.GetObject(), &path_matrix, fill_mode); } -FX_BOOL CPDF_RenderStatus::ProcessTransparency(const CPDF_PageObject* pPageObj, +FX_BOOL CPDF_RenderStatus::ProcessTransparency(CPDF_PageObject* pPageObj, const CFX_Matrix* pObj2Device) { #if defined _SKIA_SUPPORT_ DebugVerifyDeviceIsPreMultiplied(); #endif - const CPDF_GeneralStateData* pGeneralState = - pPageObj->m_GeneralState.GetObject(); - int blend_type = - pGeneralState ? pGeneralState->m_BlendType : FXDIB_BLEND_NORMAL; - if (blend_type == FXDIB_BLEND_UNSUPPORTED) { + int blend_type = pPageObj->m_GeneralState.GetBlendType(); + if (blend_type == FXDIB_BLEND_UNSUPPORTED) return TRUE; - } + CPDF_Dictionary* pSMaskDict = - pGeneralState ? ToDictionary(pGeneralState->m_pSoftMask) : nullptr; + ToDictionary(pPageObj->m_GeneralState.GetSoftMask()); if (pSMaskDict) { if (pPageObj->IsImage() && pPageObj->AsImage()->GetImage()->GetDict()->KeyExist("SMask")) { @@ -701,11 +690,7 @@ FX_BOOL CPDF_RenderStatus::ProcessTransparency(const CPDF_PageObject* pPageObj, FX_BOOL bGroupTransparent = FALSE; if (pPageObj->IsForm()) { const CPDF_FormObject* pFormObj = pPageObj->AsForm(); - const CPDF_GeneralStateData* pStateData = - pFormObj->m_GeneralState.GetObject(); - if (pStateData) { - group_alpha = pStateData->m_FillAlpha; - } + group_alpha = pFormObj->m_GeneralState.GetFillAlpha(); Transparency = pFormObj->m_pForm->m_Transparency; bGroupTransparent = !!(Transparency & PDFTRANS_ISOLATED); if (pFormObj->m_pForm->m_pFormDict) { @@ -717,7 +702,8 @@ FX_BOOL CPDF_RenderStatus::ProcessTransparency(const CPDF_PageObject* pPageObj, m_pDevice->GetDeviceClass() == FXDC_DISPLAY && !(m_pDevice->GetDeviceCaps(FXDC_RENDER_CAPS) & FXRC_SOFT_CLIP)); if ((m_Options.m_Flags & RENDER_OVERPRINT) && pPageObj->IsImage() && - pGeneralState && pGeneralState->m_FillOP && pGeneralState->m_StrokeOP) { + pPageObj->m_GeneralState.GetFillOP() && + pPageObj->m_GeneralState.GetStrokeOP()) { CPDF_Document* pDocument = nullptr; CPDF_Page* pPage = nullptr; if (m_pContext->GetPageCache()) { @@ -819,7 +805,7 @@ FX_BOOL CPDF_RenderStatus::ProcessTransparency(const CPDF_PageObject* pPageObj, m_bStopped = bitmap_render.m_bStopped; if (pSMaskDict) { CFX_Matrix smask_matrix; - FXSYS_memcpy(&smask_matrix, pGeneralState->m_SMaskMatrix, + FXSYS_memcpy(&smask_matrix, pPageObj->m_GeneralState.GetSMaskMatrix(), sizeof smask_matrix); smask_matrix.Concat(*pObj2Device); std::unique_ptr<CFX_DIBSource> pSMaskSource( diff --git a/core/fpdfapi/fpdf_render/fpdf_render_image.cpp b/core/fpdfapi/fpdf_render/fpdf_render_image.cpp index 295ac4f7d7..e7e9682322 100644 --- a/core/fpdfapi/fpdf_render/fpdf_render_image.cpp +++ b/core/fpdfapi/fpdf_render/fpdf_render_image.cpp @@ -33,7 +33,7 @@ #include "core/fxge/skia/fx_skia_device.h" #endif -FX_BOOL CPDF_RenderStatus::ProcessImage(const CPDF_ImageObject* pImageObj, +FX_BOOL CPDF_RenderStatus::ProcessImage(CPDF_ImageObject* pImageObj, const CFX_Matrix* pObj2Device) { CPDF_ImageRenderer render; if (render.Start(this, pImageObj, pObj2Device, m_bStdCS, m_curBlend)) { @@ -388,30 +388,27 @@ FX_BOOL CPDF_ImageRenderer::StartLoadDIBSource() { } FX_BOOL CPDF_ImageRenderer::StartRenderDIBSource() { - if (!m_Loader.m_pBitmap) { + if (!m_Loader.m_pBitmap) return FALSE; - } - m_BitmapAlpha = 255; - const CPDF_GeneralStateData* pGeneralState = - m_pImageObject->m_GeneralState.GetObject(); - if (pGeneralState) { - m_BitmapAlpha = FXSYS_round(pGeneralState->m_FillAlpha * 255); - } + + m_BitmapAlpha = + FXSYS_round(255 * m_pImageObject->m_GeneralState.GetFillAlpha()); m_pDIBSource = m_Loader.m_pBitmap; if (m_pRenderStatus->m_Options.m_ColorMode == RENDER_COLOR_ALPHA && !m_Loader.m_pMask) { return StartBitmapAlpha(); } - if (pGeneralState && pGeneralState->m_pTR) { - if (!pGeneralState->m_pTransferFunc) { - ((CPDF_GeneralStateData*)pGeneralState)->m_pTransferFunc = - m_pRenderStatus->GetTransferFunc(pGeneralState->m_pTR); + if (m_pImageObject->m_GeneralState.GetTR()) { + if (!m_pImageObject->m_GeneralState.GetTransferFunc()) { + m_pImageObject->m_GeneralState.SetTransferFunc( + m_pRenderStatus->GetTransferFunc( + m_pImageObject->m_GeneralState.GetTR())); } - if (pGeneralState->m_pTransferFunc && - !pGeneralState->m_pTransferFunc->m_bIdentity) { + if (m_pImageObject->m_GeneralState.GetTransferFunc() && + !m_pImageObject->m_GeneralState.GetTransferFunc()->m_bIdentity) { m_pDIBSource = m_Loader.m_pBitmap = - pGeneralState->m_pTransferFunc->TranslateImage(m_Loader.m_pBitmap, - !m_Loader.m_bCached); + m_pImageObject->m_GeneralState.GetTransferFunc()->TranslateImage( + m_Loader.m_pBitmap, !m_Loader.m_bCached); if (m_Loader.m_bCached && m_Loader.m_pMask) { m_Loader.m_pMask = m_Loader.m_pMask->Clone(); } @@ -474,10 +471,12 @@ FX_BOOL CPDF_ImageRenderer::StartRenderDIBSource() { if (m_bPatternColor) { return DrawPatternImage(m_pObj2Device); } - if (m_BitmapAlpha == 255 && pGeneralState && pGeneralState->m_FillOP && - pGeneralState->m_OPMode == 0 && - pGeneralState->m_BlendType == FXDIB_BLEND_NORMAL && - pGeneralState->m_StrokeAlpha == 1 && pGeneralState->m_FillAlpha == 1) { + if (m_BitmapAlpha == 255 && m_pImageObject->m_GeneralState && + m_pImageObject->m_GeneralState.GetFillOP() && + m_pImageObject->m_GeneralState.GetOPMode() == 0 && + m_pImageObject->m_GeneralState.GetBlendType() == FXDIB_BLEND_NORMAL && + m_pImageObject->m_GeneralState.GetStrokeAlpha() == 1.0f && + m_pImageObject->m_GeneralState.GetFillAlpha() == 1.0f) { CPDF_Document* pDocument = nullptr; CPDF_Page* pPage = nullptr; if (m_pRenderStatus->m_pContext->GetPageCache()) { @@ -505,7 +504,7 @@ FX_BOOL CPDF_ImageRenderer::StartRenderDIBSource() { } FX_BOOL CPDF_ImageRenderer::Start(CPDF_RenderStatus* pStatus, - const CPDF_PageObject* pObj, + CPDF_PageObject* pObj, const CFX_Matrix* pObj2Device, FX_BOOL bStdCS, int blendType) { diff --git a/core/fpdfapi/fpdf_render/fpdf_render_pattern.cpp b/core/fpdfapi/fpdf_render/fpdf_render_pattern.cpp index fc06c0be57..090060d2c0 100644 --- a/core/fpdfapi/fpdf_render/fpdf_render_pattern.cpp +++ b/core/fpdfapi/fpdf_render/fpdf_render_pattern.cpp @@ -961,7 +961,9 @@ void CPDF_RenderStatus::DrawShadingPattern(CPDF_ShadingPattern* pattern, CFX_Matrix matrix = *pattern->pattern_to_form(); matrix.Concat(*pObj2Device); GetScaledMatrix(matrix); - int alpha = pPageObj->m_GeneralState.GetAlpha(bStroke); + int alpha = + FXSYS_round(255 * (bStroke ? pPageObj->m_GeneralState.GetStrokeAlpha() + : pPageObj->m_GeneralState.GetFillAlpha())); DrawShading(pattern, &matrix, rect, alpha, m_Options.m_ColorMode == RENDER_COLOR_ALPHA); m_pDevice->RestoreState(false); @@ -978,12 +980,12 @@ void CPDF_RenderStatus::ProcessShading(const CPDF_ShadingObject* pShadingObj, CFX_Matrix matrix = pShadingObj->m_Matrix; matrix.Concat(*pObj2Device); DrawShading(pShadingObj->m_pShading, &matrix, rect, - pShadingObj->m_GeneralState.GetAlpha(FALSE), + FXSYS_round(255 * pShadingObj->m_GeneralState.GetFillAlpha()), m_Options.m_ColorMode == RENDER_COLOR_ALPHA); } void CPDF_RenderStatus::DrawTilingPattern(CPDF_TilingPattern* pPattern, - const CPDF_PageObject* pPageObj, + CPDF_PageObject* pPageObj, const CFX_Matrix* pObj2Device, FX_BOOL bStroke) { if (!pPattern->Load()) { @@ -1167,7 +1169,7 @@ void CPDF_RenderStatus::DrawTilingPattern(CPDF_TilingPattern* pPattern, m_pDevice->RestoreState(false); } -void CPDF_RenderStatus::DrawPathWithPattern(const CPDF_PathObject* pPathObj, +void CPDF_RenderStatus::DrawPathWithPattern(CPDF_PathObject* pPathObj, const CFX_Matrix* pObj2Device, const CPDF_Color* pColor, FX_BOOL bStroke) { @@ -1181,7 +1183,7 @@ void CPDF_RenderStatus::DrawPathWithPattern(const CPDF_PathObject* pPathObj, DrawShadingPattern(pShadingPattern, pPathObj, pObj2Device, bStroke); } -void CPDF_RenderStatus::ProcessPathPattern(const CPDF_PathObject* pPathObj, +void CPDF_RenderStatus::ProcessPathPattern(CPDF_PathObject* pPathObj, const CFX_Matrix* pObj2Device, int& filltype, FX_BOOL& bStroke) { diff --git a/core/fpdfapi/fpdf_render/fpdf_render_text.cpp b/core/fpdfapi/fpdf_render/fpdf_render_text.cpp index ed254c17be..74997027ca 100644 --- a/core/fpdfapi/fpdf_render/fpdf_render_text.cpp +++ b/core/fpdfapi/fpdf_render/fpdf_render_text.cpp @@ -32,7 +32,7 @@ #include "core/fxge/include/cfx_pathdata.h" #include "core/fxge/include/cfx_renderdevice.h" -FX_BOOL CPDF_RenderStatus::ProcessText(const CPDF_TextObject* textobj, +FX_BOOL CPDF_RenderStatus::ProcessText(CPDF_TextObject* textobj, const CFX_Matrix* pObj2Device, CFX_PathData* pClippingPath) { if (textobj->m_nChars == 0) @@ -128,15 +128,10 @@ FX_BOOL CPDF_RenderStatus::ProcessText(const CPDF_TextObject* textobj, flag |= FX_FILL_STROKE; flag |= FX_STROKE_TEXT_MODE; } - const CPDF_GeneralStateData* pGeneralData = - static_cast<const CPDF_PageObject*>(textobj) - ->m_GeneralState.GetObject(); - if (pGeneralData && pGeneralData->m_StrokeAdjust) { + if (textobj->m_GeneralState.GetStrokeAdjust()) flag |= FX_STROKE_ADJUST; - } - if (m_Options.m_Flags & RENDER_NOTEXTSMOOTH) { + if (m_Options.m_Flags & RENDER_NOTEXTSMOOTH) flag |= FXFILL_NOPATHSMOOTH; - } return CPDF_TextRenderer::DrawTextPath( m_pDevice, textobj->m_nChars, textobj->m_pCharCodes, textobj->m_pCharPos, pFont, font_size, &text_matrix, pDeviceMatrix, @@ -178,7 +173,7 @@ class CPDF_RefType3Cache { }; // TODO(npm): Font fallback for type 3 fonts? (Completely separate code!!) -FX_BOOL CPDF_RenderStatus::ProcessType3Text(const CPDF_TextObject* textobj, +FX_BOOL CPDF_RenderStatus::ProcessType3Text(CPDF_TextObject* textobj, const CFX_Matrix* pObj2Device) { CPDF_Type3Font* pType3Font = textobj->m_TextState.GetFont()->AsType3Font(); for (int i = 0; i < m_Type3FontCache.GetSize(); ++i) { diff --git a/core/fpdfapi/fpdf_render/render_int.h b/core/fpdfapi/fpdf_render/render_int.h index 893784bc8f..672e5923df 100644 --- a/core/fpdfapi/fpdf_render/render_int.h +++ b/core/fpdfapi/fpdf_render/render_int.h @@ -110,9 +110,8 @@ class CPDF_RenderStatus { FX_BOOL bLoadMask = FALSE); void RenderObjectList(const CPDF_PageObjectHolder* pObjectHolder, const CFX_Matrix* pObj2Device); - void RenderSingleObject(const CPDF_PageObject* pObj, - const CFX_Matrix* pObj2Device); - FX_BOOL ContinueSingleObject(const CPDF_PageObject* pObj, + void RenderSingleObject(CPDF_PageObject* pObj, const CFX_Matrix* pObj2Device); + FX_BOOL ContinueSingleObject(CPDF_PageObject* pObj, const CFX_Matrix* pObj2Device, IFX_Pause* pPause); CPDF_RenderContext* GetContext() { return m_pContext; } @@ -132,26 +131,25 @@ class CPDF_RenderStatus { void ProcessClipPath(CPDF_ClipPath ClipPath, const CFX_Matrix* pObj2Device); void DrawClipPath(CPDF_ClipPath ClipPath, const CFX_Matrix* pObj2Device); - FX_BOOL ProcessTransparency(const CPDF_PageObject* PageObj, + FX_BOOL ProcessTransparency(CPDF_PageObject* PageObj, const CFX_Matrix* pObj2Device); - void ProcessObjectNoClip(const CPDF_PageObject* PageObj, + void ProcessObjectNoClip(CPDF_PageObject* PageObj, const CFX_Matrix* pObj2Device); - void DrawObjWithBackground(const CPDF_PageObject* pObj, + void DrawObjWithBackground(CPDF_PageObject* pObj, const CFX_Matrix* pObj2Device); - FX_BOOL DrawObjWithBlend(const CPDF_PageObject* pObj, + FX_BOOL DrawObjWithBlend(CPDF_PageObject* pObj, const CFX_Matrix* pObj2Device); - FX_BOOL ProcessPath(const CPDF_PathObject* pPathObj, - const CFX_Matrix* pObj2Device); - void ProcessPathPattern(const CPDF_PathObject* pPathObj, + FX_BOOL ProcessPath(CPDF_PathObject* pPathObj, const CFX_Matrix* pObj2Device); + void ProcessPathPattern(CPDF_PathObject* pPathObj, const CFX_Matrix* pObj2Device, int& filltype, FX_BOOL& bStroke); - void DrawPathWithPattern(const CPDF_PathObject* pPathObj, + void DrawPathWithPattern(CPDF_PathObject* pPathObj, const CFX_Matrix* pObj2Device, const CPDF_Color* pColor, FX_BOOL bStroke); void DrawTilingPattern(CPDF_TilingPattern* pPattern, - const CPDF_PageObject* pPageObj, + CPDF_PageObject* pPageObj, const CFX_Matrix* pObj2Device, FX_BOOL bStroke); void DrawShadingPattern(CPDF_ShadingPattern* pPattern, @@ -161,7 +159,7 @@ class CPDF_RenderStatus { FX_BOOL SelectClipPath(const CPDF_PathObject* pPathObj, const CFX_Matrix* pObj2Device, FX_BOOL bStroke); - FX_BOOL ProcessImage(const CPDF_ImageObject* pImageObj, + FX_BOOL ProcessImage(CPDF_ImageObject* pImageObj, const CFX_Matrix* pObj2Device); FX_BOOL OutputBitmapAlpha(CPDF_ImageObject* pImageObj, const CFX_Matrix* pImage2Device); @@ -187,9 +185,9 @@ class CPDF_RenderStatus { FX_RECT& clip_rect, int alpha, FX_BOOL bAlphaMode); - FX_BOOL ProcessType3Text(const CPDF_TextObject* textobj, + FX_BOOL ProcessType3Text(CPDF_TextObject* textobj, const CFX_Matrix* pObj2Device); - FX_BOOL ProcessText(const CPDF_TextObject* textobj, + FX_BOOL ProcessText(CPDF_TextObject* textobj, const CFX_Matrix* pObj2Device, CFX_PathData* pClippingPath); void DrawTextPathWithPattern(const CPDF_TextObject* textobj, @@ -214,9 +212,8 @@ class CPDF_RenderStatus { 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, - FX_BOOL bType3 = FALSE) const; - FX_ARGB GetStrokeArgb(const CPDF_PageObject* pObj) const; + FX_ARGB GetFillArgb(CPDF_PageObject* pObj, FX_BOOL bType3 = FALSE) const; + FX_ARGB GetStrokeArgb(CPDF_PageObject* pObj) const; FX_BOOL GetObjectClippedRect(const CPDF_PageObject* pObj, const CFX_Matrix* pObj2Device, FX_BOOL bLogical, @@ -311,7 +308,7 @@ class CPDF_ImageRenderer { ~CPDF_ImageRenderer(); FX_BOOL Start(CPDF_RenderStatus* pStatus, - const CPDF_PageObject* pObj, + CPDF_PageObject* pObj, const CFX_Matrix* pObj2Device, FX_BOOL bStdCS, int blendType = FXDIB_BLEND_NORMAL); @@ -337,7 +334,7 @@ class CPDF_ImageRenderer { FX_BOOL DrawPatternImage(const CFX_Matrix* pObj2Device); CPDF_RenderStatus* m_pRenderStatus; - const CPDF_ImageObject* m_pImageObject; + CPDF_ImageObject* m_pImageObject; int m_Status; const CFX_Matrix* m_pObj2Device; CFX_Matrix m_ImageMatrix; |