summaryrefslogtreecommitdiff
path: root/core/src/fpdfapi/fpdf_render
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/fpdfapi/fpdf_render')
-rw-r--r--core/src/fpdfapi/fpdf_render/fpdf_render.cpp59
-rw-r--r--core/src/fpdfapi/fpdf_render/fpdf_render_cache.cpp36
-rw-r--r--core/src/fpdfapi/fpdf_render/fpdf_render_image.cpp83
-rw-r--r--core/src/fpdfapi/fpdf_render/fpdf_render_pattern.cpp10
-rw-r--r--core/src/fpdfapi/fpdf_render/fpdf_render_text.cpp12
-rw-r--r--core/src/fpdfapi/fpdf_render/render_int.h4
6 files changed, 1 insertions, 203 deletions
diff --git a/core/src/fpdfapi/fpdf_render/fpdf_render.cpp b/core/src/fpdfapi/fpdf_render/fpdf_render.cpp
index 611804bc06..ab1ddb6e85 100644
--- a/core/src/fpdfapi/fpdf_render/fpdf_render.cpp
+++ b/core/src/fpdfapi/fpdf_render/fpdf_render.cpp
@@ -35,7 +35,6 @@ void CPDF_DocRenderData::Clear(FX_BOOL bRelease)
}
}
}
-#ifndef _FPDFAPI_MINI_
{
pos = m_TransferFuncMap.GetStartPosition();
while (pos) {
@@ -49,7 +48,6 @@ void CPDF_DocRenderData::Clear(FX_BOOL bRelease)
}
}
}
-#endif
if (m_pFontCache) {
if (bRelease) {
delete m_pFontCache;
@@ -149,9 +147,6 @@ CPDF_RenderOptions::CPDF_RenderOptions()
, m_dwLimitCacheSize(1024 * 1024 * 100)
, m_HalftoneLimit(-1)
{
-#if defined(_FPDFAPI_MINI_)
- m_Flags |= RENDER_LIMITEDIMAGECACHE;
-#endif
}
FX_ARGB CPDF_RenderOptions::TranslateColor(FX_ARGB argb) const
{
@@ -261,12 +256,6 @@ FX_BOOL CPDF_RenderStatus::Initialize(int level, CPDF_RenderContext* pContext, C
} else {
m_InitialStates.DefaultStates();
}
-#if defined(_FPDFAPI_MINI_)||defined(_FXCORE_LIMITED_CPU_)
- m_HalftoneLimit = CPDF_ModuleMgr::Get()->GetRenderModule()->GetConfig()->m_HalftoneLimit;
- if (pOptions && pOptions->m_HalftoneLimit >= 0) {
- m_HalftoneLimit = pOptions->m_HalftoneLimit;
- }
-#endif
m_pObjectRenderer = NULL;
m_Transparency = transparency;
return TRUE;
@@ -327,11 +316,6 @@ FX_BOOL CPDF_RenderStatus::ContinueSingleObject(const CPDF_PageObject* pObj, con
if (!m_pObjectRenderer->m_Result) {
DrawObjWithBackground(pObj, pObj2Device);
}
-#ifdef _FPDFAPI_MINI_
- if (m_DitherBits) {
- DitherObjectArea(pObj, pObj2Device);
- }
-#endif
delete m_pObjectRenderer;
m_pObjectRenderer = NULL;
return FALSE;
@@ -351,11 +335,6 @@ FX_BOOL CPDF_RenderStatus::ContinueSingleObject(const CPDF_PageObject* pObj, con
if (!m_pObjectRenderer->m_Result) {
DrawObjWithBackground(pObj, pObj2Device);
}
-#ifdef _FPDFAPI_MINI_
- if (m_DitherBits) {
- DitherObjectArea(pObj, pObj2Device);
- }
-#endif
delete m_pObjectRenderer;
m_pObjectRenderer = NULL;
return FALSE;
@@ -431,11 +410,6 @@ void CPDF_RenderStatus::ProcessObjectNoClip(const CPDF_PageObject* pObj, const C
case PDFPAGE_FORM:
bRet = ProcessForm((CPDF_FormObject*)pObj, pObj2Device);
break;
-#if defined(_FPDFAPI_MINI_)
- case PDFPAGE_INLINES:
- bRet = ProcessInlines((CPDF_InlineImages*)pObj, pObj2Device);
- break;
-#endif
}
if (!bRet) {
DrawObjWithBackground(pObj, pObj2Device);
@@ -465,7 +439,6 @@ void CPDF_RenderStatus::GetScaledMatrix(CFX_Matrix &matrix) const
}
void CPDF_RenderStatus::DrawObjWithBackground(const CPDF_PageObject* pObj, const CFX_AffineMatrix* pObj2Device)
{
-#if !defined(_FPDFAPI_MINI_) || defined(_FXCORE_FEATURE_ALL_)
FX_RECT rect;
if (GetObjectClippedRect(pObj, pObj2Device, FALSE, rect)) {
return;
@@ -492,7 +465,6 @@ void CPDF_RenderStatus::DrawObjWithBackground(const CPDF_PageObject* pObj, const
status.Initialize(m_Level + 1, m_pContext, buffer.GetDevice(), buffer.GetMatrix(), NULL, NULL, NULL, &m_Options, m_Transparency, m_bDropObjects, pFormResource);
status.RenderSingleObject(pObj, &matrix);
buffer.OutputToDevice();
-#endif
}
FX_BOOL CPDF_RenderStatus::ProcessForm(CPDF_FormObject* pFormObj, const CFX_AffineMatrix* pObj2Device)
{
@@ -559,12 +531,10 @@ FX_BOOL CPDF_RenderStatus::ProcessPath(CPDF_PathObject* pPathObj, const CFX_Affi
if (bStroke) {
FillType |= FX_FILL_STROKE;
}
-#if !defined(_FPDFAPI_MINI_) || defined(_FXCORE_FEATURE_ALL_)
const CPDF_GeneralStateData* pGeneralData = ((CPDF_PageObject*)pPathObj)->m_GeneralState;
if (pGeneralData && pGeneralData->m_StrokeAdjust) {
FillType |= FX_STROKE_ADJUST;
}
-#endif
if (m_pType3Char) {
FillType |= FX_FILL_TEXT_MODE;
}
@@ -599,7 +569,6 @@ FX_ARGB CPDF_RenderStatus::GetFillArgb(const CPDF_PageObject* pObj, FX_BOOL bTyp
int alpha;
if (pGeneralData) {
alpha = (FX_INT32)(pGeneralData->m_FillAlpha * 255);
-#ifndef _FPDFAPI_MINI_
if (pGeneralData->m_pTR) {
if (!pGeneralData->m_pTransferFunc) {
((CPDF_GeneralStateData*)pGeneralData)->m_pTransferFunc = GetTransferFunc(pGeneralData->m_pTR);
@@ -608,7 +577,6 @@ FX_ARGB CPDF_RenderStatus::GetFillArgb(const CPDF_PageObject* pObj, FX_BOOL bTyp
rgb = pGeneralData->m_pTransferFunc->TranslateColor(rgb);
}
}
-#endif
} else {
alpha = 255;
}
@@ -630,7 +598,6 @@ FX_ARGB CPDF_RenderStatus::GetStrokeArgb(const CPDF_PageObject* pObj) const
int alpha;
if (pGeneralData) {
alpha = (FX_INT32)(pGeneralData->m_StrokeAlpha * 255);
-#ifndef _FPDFAPI_MINI_
if (pGeneralData->m_pTR) {
if (!pGeneralData->m_pTransferFunc) {
((CPDF_GeneralStateData*)pGeneralData)->m_pTransferFunc = GetTransferFunc(pGeneralData->m_pTR);
@@ -639,7 +606,6 @@ FX_ARGB CPDF_RenderStatus::GetStrokeArgb(const CPDF_PageObject* pObj) const
rgb = pGeneralData->m_pTransferFunc->TranslateColor(rgb);
}
}
-#endif
} else {
alpha = 255;
}
@@ -1038,11 +1004,9 @@ void CPDF_RenderContext::Render(CFX_RenderDevice* pDevice, const CPDF_PageObject
status.Initialize(0, this, pDevice, pLastMatrix, pStopObj, NULL, NULL, pOptions,
pItem->m_pObjectList->m_Transparency, FALSE, NULL);
status.RenderObjectList(pItem->m_pObjectList, &FinalMatrix);
-#if !defined(_FPDFAPI_MINI_)
if (status.m_Options.m_Flags & RENDER_LIMITEDIMAGECACHE) {
m_pPageCache->CacheOptimization(status.m_Options.m_dwLimitCacheSize);
}
-#endif
if (status.m_bStopped) {
pDevice->RestoreState();
break;
@@ -1052,11 +1016,9 @@ void CPDF_RenderContext::Render(CFX_RenderDevice* pDevice, const CPDF_PageObject
status.Initialize(0, this, pDevice, NULL, pStopObj, NULL, NULL, pOptions,
pItem->m_pObjectList->m_Transparency, FALSE, NULL);
status.RenderObjectList(pItem->m_pObjectList, &pItem->m_Matrix);
-#if !defined(_FPDFAPI_MINI_)
if (status.m_Options.m_Flags & RENDER_LIMITEDIMAGECACHE) {
m_pPageCache->CacheOptimization(status.m_Options.m_dwLimitCacheSize);
}
-#endif
if (status.m_bStopped) {
pDevice->RestoreState();
break;
@@ -1113,11 +1075,7 @@ void CPDF_ProgressiveRenderer::Start(CPDF_RenderContext* pContext, CFX_RenderDev
m_PrevLastPos = NULL;
Continue(pPause);
}
-#ifdef _FPDFAPI_MINI_
-#define RENDER_STEP_LIMIT 20
-#else
#define RENDER_STEP_LIMIT 100
-#endif
void CPDF_ProgressiveRenderer::Continue(IFX_Pause* pPause)
{
if (m_Status != ToBeContinued) {
@@ -1175,11 +1133,9 @@ void CPDF_ProgressiveRenderer::Continue(IFX_Pause* pPause)
if (m_pRenderer->ContinueSingleObject(pCurObj, &pItem->m_Matrix, pPause)) {
return;
}
-#if !defined(_FPDFAPI_MINI_)
if (pCurObj->m_Type == PDFPAGE_IMAGE && m_pRenderer->m_Options.m_Flags & RENDER_LIMITEDIMAGECACHE) {
m_pContext->GetPageCache()->CacheOptimization(m_pRenderer->m_Options.m_dwLimitCacheSize);
}
-#endif
if (pCurObj->m_Type == PDFPAGE_FORM || pCurObj->m_Type == PDFPAGE_SHADING) {
objs_to_go = 0;
} else {
@@ -1320,11 +1276,7 @@ void CPDF_DocRenderData::ReleaseTransferFunc(CPDF_Object* pObj)
CPDF_RenderConfig::CPDF_RenderConfig()
{
m_HalftoneLimit = 0;
-#ifdef _FPDFAPI_MINI_
- m_RenderStepLimit = 20;
-#else
m_RenderStepLimit = 100;
-#endif
}
CPDF_RenderConfig::~CPDF_RenderConfig()
{
@@ -1363,9 +1315,6 @@ FX_BOOL CPDF_DeviceBuffer::Initialize(CPDF_RenderContext* pContext, CFX_RenderDe
m_Matrix.Scale(1.0f, (FX_FLOAT)(max_dpi) / (FX_FLOAT)dpiv);
}
}
-#ifdef _FPDFAPI_MINI_
- m_Matrix.Scale(0.5f, 0.5f);
-#endif
#endif
CFX_Matrix ctm = m_pDevice->GetCTM();
FX_FLOAT fScaleX = FXSYS_fabs(ctm.a);
@@ -1387,13 +1336,11 @@ void CPDF_DeviceBuffer::OutputToDevice()
m_pDevice->StretchDIBits(m_pBitmap, m_Rect.left, m_Rect.top, m_Rect.Width(), m_Rect.Height());
}
} else {
-#if !defined(_FPDFAPI_MINI_) || defined(_FXCORE_FEATURE_ALL_)
CFX_DIBitmap buffer;
m_pDevice->CreateCompatibleBitmap(&buffer, m_pBitmap->GetWidth(), m_pBitmap->GetHeight());
m_pContext->GetBackground(&buffer, m_pObject, NULL, &m_Matrix);
buffer.CompositeBitmap(0, 0, buffer.GetWidth(), buffer.GetHeight(), m_pBitmap, 0, 0);
m_pDevice->StretchDIBits(&buffer, m_Rect.left, m_Rect.top, m_Rect.Width(), m_Rect.Height());
-#endif
}
}
CPDF_ScaledRenderBuffer::CPDF_ScaledRenderBuffer()
@@ -1406,11 +1353,7 @@ CPDF_ScaledRenderBuffer::~CPDF_ScaledRenderBuffer()
delete m_pBitmapDevice;
}
}
-#ifndef _FPDFAPI_MINI_
#define _FPDFAPI_IMAGESIZE_LIMIT_ (30 * 1024 * 1024)
-#else
-#define _FPDFAPI_IMAGESIZE_LIMIT_ (10 * 1024 * 1024)
-#endif
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)
{
@@ -1460,9 +1403,7 @@ FX_BOOL CPDF_ScaledRenderBuffer::Initialize(CPDF_RenderContext* pContext, CFX_Re
}
m_Matrix.Scale(0.5f, 0.5f);
}
-#if !defined(_FPDFAPI_MINI_) || defined(_FXCORE_FEATURE_ALL_)
m_pContext->GetBackground(m_pBitmapDevice->GetBitmap(), m_pObject, pOptions, &m_Matrix);
-#endif
return TRUE;
}
void CPDF_ScaledRenderBuffer::OutputToDevice()
diff --git a/core/src/fpdfapi/fpdf_render/fpdf_render_cache.cpp b/core/src/fpdfapi/fpdf_render/fpdf_render_cache.cpp
index 45b6970e2a..de2a409e1c 100644
--- a/core/src/fpdfapi/fpdf_render/fpdf_render_cache.cpp
+++ b/core/src/fpdfapi/fpdf_render/fpdf_render_cache.cpp
@@ -248,7 +248,6 @@ FX_BOOL CPDF_ImageCache::GetCachedBitmap(CFX_DIBSource*& pBitmap, CFX_DIBSource*
return FALSE;
}
m_MatteColor = MatteColor;
-#if !defined(_FPDFAPI_MINI_)
if (pSrc->GetPitch() * pSrc->GetHeight() < FPDF_HUGE_IMAGE_SIZE) {
m_pCachedBitmap = pSrc->Clone();
delete pSrc;
@@ -259,23 +258,7 @@ FX_BOOL CPDF_ImageCache::GetCachedBitmap(CFX_DIBSource*& pBitmap, CFX_DIBSource*
m_pCachedMask = pMaskSrc->Clone();
delete pMaskSrc;
}
-#else
- if (pSrc->GetFormat() == FXDIB_8bppRgb && pSrc->GetPalette() &&
- pSrc->GetHeight() * pSrc->GetWidth() * 3 < 1024) {
-#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
- m_pCachedBitmap = pSrc->CloneConvert(FXDIB_Rgb32);
-#else
- m_pCachedBitmap = pSrc->CloneConvert(FXDIB_Rgb);
-#endif
- delete pSrc;
- } else if (pSrc->GetPitch() * pSrc->GetHeight() < 102400) {
- m_pCachedBitmap = pSrc->Clone();
- delete pSrc;
- } else {
- m_pCachedBitmap = pSrc;
- }
- m_pCachedMask = pMaskSrc;
-#endif
+
pBitmap = m_pCachedBitmap;
pMask = m_pCachedMask;
CalcSize();
@@ -326,7 +309,6 @@ int CPDF_ImageCache::ContinueGetCachedBitmap()
CPDF_RenderContext*pContext = m_pRenderStatus->GetContext();
CPDF_PageRenderCache* pPageRenderCache = pContext->m_pPageCache;
m_dwTimeCount = pPageRenderCache->GetTimeCount();
-#if !defined(_FPDFAPI_MINI_)
if (m_pCurBitmap->GetPitch() * m_pCurBitmap->GetHeight() < FPDF_HUGE_IMAGE_SIZE) {
m_pCachedBitmap = m_pCurBitmap->Clone();
delete m_pCurBitmap;
@@ -339,22 +321,6 @@ int CPDF_ImageCache::ContinueGetCachedBitmap()
delete m_pCurMask;
m_pCurMask = NULL;
}
-#else
- if (m_pCurBitmap->GetFormat() == FXDIB_8bppRgb && m_pCurBitmap->GetPalette() &&
- m_pCurBitmap->GetHeight() * m_pCurBitmap->GetWidth() * 3 < 1024) {
- m_pCachedBitmap = m_pCurBitmap->CloneConvert(FXDIB_Rgb32);
- m_pCachedBitmap = m_pCurBitmap->CloneConvert(FXDIB_Rgb);
- delete m_pCurBitmap;
- m_pCurBitmap = NULL;
- } else if (m_pCurBitmap->GetPitch() * m_pCurBitmap->GetHeight() < 102400) {
- m_pCachedBitmap = m_pCurBitmap->Clone();
- delete m_pCurBitmap;
- m_pCurBitmap = NULL;
- } else {
- m_pCachedBitmap = m_pCurBitmap;
- }
- m_pCachedMask = m_pCurMask;
-#endif
m_pCurBitmap = m_pCachedBitmap;
m_pCurMask = m_pCachedMask;
CalcSize();
diff --git a/core/src/fpdfapi/fpdf_render/fpdf_render_image.cpp b/core/src/fpdfapi/fpdf_render/fpdf_render_image.cpp
index 1452b9d9f9..ffe559ad54 100644
--- a/core/src/fpdfapi/fpdf_render/fpdf_render_image.cpp
+++ b/core/src/fpdfapi/fpdf_render/fpdf_render_image.cpp
@@ -17,53 +17,8 @@ FX_BOOL CPDF_RenderStatus::ProcessImage(CPDF_ImageObject* pImageObj, const CFX_A
if (render.Start(this, pImageObj, pObj2Device, m_bStdCS, m_curBlend)) {
render.Continue(NULL);
}
-#ifdef _FPDFAPI_MINI_
- if (m_DitherBits) {
- DitherObjectArea(pImageObj, pObj2Device);
- }
-#endif
return render.m_Result;
}
-#if defined(_FPDFAPI_MINI_)
-FX_BOOL CPDF_RenderStatus::ProcessInlines(CPDF_InlineImages* pInlines, const CFX_AffineMatrix* pObj2Device)
-{
- int bitmap_alpha = 255;
- if (!pInlines->m_GeneralState.IsNull()) {
- bitmap_alpha = FXSYS_round(pInlines->m_GeneralState.GetObject()->m_FillAlpha * 255);
- }
- if (pInlines->m_pStream) {
- CPDF_DIBSource dibsrc;
- if (!dibsrc.Load(m_pContext->m_pDocument, pInlines->m_pStream, NULL, NULL, NULL, NULL)) {
- return TRUE;
- }
- pInlines->m_pBitmap = dibsrc.Clone();
- pInlines->m_pStream->Release();
- pInlines->m_pStream = NULL;
- }
- if (pInlines->m_pBitmap == NULL) {
- return TRUE;
- }
- FX_ARGB fill_argb = 0;
- if (pInlines->m_pBitmap->IsAlphaMask()) {
- fill_argb = GetFillArgb(pInlines);
- }
- int flags = 0;
- if (m_Options.m_Flags & RENDER_FORCE_DOWNSAMPLE) {
- flags |= RENDER_FORCE_DOWNSAMPLE;
- } else if (m_Options.m_Flags & RENDER_FORCE_HALFTONE) {
- flags = 0;
- }
- for (int i = 0; i < pInlines->m_Matrices.GetSize(); i ++) {
- CFX_AffineMatrix image_matrix = pInlines->m_Matrices.GetAt(i);
- image_matrix.Concat(*pObj2Device);
- CPDF_ImageRenderer renderer;
- if (renderer.Start(this, pInlines->m_pBitmap, fill_argb, bitmap_alpha, &image_matrix, flags, FALSE, m_curBlend)) {
- renderer.Continue(NULL);
- }
- }
- return TRUE;
-}
-#endif
void CPDF_RenderStatus::CompositeDIBitmap(CFX_DIBitmap* pDIBitmap, int left, int top, FX_ARGB mask_argb,
int bitmap_alpha, int blend_mode, int Transparency)
{
@@ -392,7 +347,6 @@ FX_BOOL CPDF_ImageRenderer::StartRenderDIBSource()
if (m_pRenderStatus->m_Options.m_ColorMode == RENDER_COLOR_ALPHA && m_Loader.m_pMask == NULL) {
return StartBitmapAlpha();
}
-#ifndef _FPDFAPI_MINI_
if (pGeneralState && pGeneralState->m_pTR) {
if (!pGeneralState->m_pTransferFunc) {
((CPDF_GeneralStateData*)pGeneralState)->m_pTransferFunc = m_pRenderStatus->GetTransferFunc(pGeneralState->m_pTR);
@@ -405,7 +359,6 @@ FX_BOOL CPDF_ImageRenderer::StartRenderDIBSource()
m_Loader.m_bCached = FALSE;
}
}
-#endif
m_FillArgb = 0;
m_bPatternColor = FALSE;
m_pPattern = NULL;
@@ -424,32 +377,11 @@ FX_BOOL CPDF_ImageRenderer::StartRenderDIBSource()
m_pDIBSource = m_pClone;
}
m_Flags = 0;
-#if !defined(_FPDFAPI_MINI_)
if (m_pRenderStatus->m_Options.m_Flags & RENDER_FORCE_DOWNSAMPLE) {
m_Flags |= RENDER_FORCE_DOWNSAMPLE;
} else if (m_pRenderStatus->m_Options.m_Flags & RENDER_FORCE_HALFTONE) {
m_Flags |= RENDER_FORCE_HALFTONE;
}
-#else
- if (!(m_pRenderStatus->m_Options.m_Flags & RENDER_FORCE_HALFTONE)) {
- if (m_pRenderStatus->m_HalftoneLimit) {
- CFX_FloatRect image_rect_f = m_ImageMatrix.GetUnitRect();
- FX_RECT image_rect = image_rect_f.GetOutterRect();
- FX_RECT image_clip = image_rect;
- image_rect.Intersect(m_pRenderStatus->m_pDevice->GetClipBox());
- if (image_rect.Width() && image_rect.Height()) {
- if ((image_clip.Width() * m_pDIBSource->GetWidth() / image_rect.Width()) *
- (image_clip.Height() * m_pDIBSource->GetHeight() / image_rect.Height()) >
- m_pRenderStatus->m_HalftoneLimit) {
- m_Flags |= RENDER_FORCE_DOWNSAMPLE;
- }
- }
- } else {
- m_Flags |= RENDER_FORCE_DOWNSAMPLE;
- }
- }
-#endif
-#ifndef _FPDFAPI_MINI_
if (m_pRenderStatus->m_pDevice->GetDeviceClass() != FXDC_DISPLAY) {
CPDF_Object* pFilters = m_pImageObject->m_pImage->GetStream()->GetDict()->GetElementValue(FX_BSTRC("Filter"));
if (pFilters) {
@@ -475,14 +407,12 @@ FX_BOOL CPDF_ImageRenderer::StartRenderDIBSource()
} else if (m_pImageObject->m_pImage->IsInterpol()) {
m_Flags |= FXDIB_INTERPOL;
}
-#endif
if (m_Loader.m_pMask) {
return DrawMaskedImage();
}
if (m_bPatternColor) {
return DrawPatternImage(m_pObj2Device);
}
-#if !defined(_FPDFAPI_MINI_) || defined(_FXCORE_FEATURE_ALL_)
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) {
CPDF_Document* pDocument = NULL;
@@ -504,7 +434,6 @@ FX_BOOL CPDF_ImageRenderer::StartRenderDIBSource()
pDocument->GetPageData()->ReleaseColorSpace(pCSObj);
}
}
-#endif
return StartDIBSource();
}
FX_BOOL CPDF_ImageRenderer::Start(CPDF_RenderStatus* pStatus, const CPDF_PageObject* pObj, const CFX_AffineMatrix* pObj2Device, FX_BOOL bStdCS, int blendType)
@@ -514,12 +443,10 @@ FX_BOOL CPDF_ImageRenderer::Start(CPDF_RenderStatus* pStatus, const CPDF_PageObj
m_pImageObject = (CPDF_ImageObject*)pObj;
m_BlendType = blendType;
m_pObj2Device = pObj2Device;
-#ifndef _FPDFAPI_MINI_
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;
}
-#endif
m_ImageMatrix = m_pImageObject->m_Matrix;
m_ImageMatrix.Concat(*pObj2Device);
if (StartLoadDIBSource()) {
@@ -721,14 +648,12 @@ FX_BOOL CPDF_ImageRenderer::DrawMaskedImage()
}
FX_BOOL CPDF_ImageRenderer::StartDIBSource()
{
-#if !defined(_FPDFAPI_MINI_)
if (!(m_Flags & RENDER_FORCE_DOWNSAMPLE) && m_pDIBSource->GetBPP() > 1) {
int image_size = m_pDIBSource->GetBPP() / 8 * m_pDIBSource->GetWidth() * m_pDIBSource->GetHeight();
if (image_size > FPDF_HUGE_IMAGE_SIZE && !(m_Flags & RENDER_FORCE_HALFTONE)) {
m_Flags |= RENDER_FORCE_DOWNSAMPLE;
}
}
-#endif
if (m_pRenderStatus->m_pDevice->StartDIBits(m_pDIBSource, m_BitmapAlpha, m_FillArgb,
&m_ImageMatrix, m_Flags, m_DeviceHandle, 0, NULL, m_BlendType)) {
if (m_DeviceHandle != NULL) {
@@ -737,7 +662,6 @@ FX_BOOL CPDF_ImageRenderer::StartDIBSource()
}
return FALSE;
}
-#if !defined(_FPDFAPI_MINI_) || defined(_FXCORE_FEATURE_ALL_)
CFX_FloatRect image_rect_f = m_ImageMatrix.GetUnitRect();
FX_RECT image_rect = image_rect_f.GetOutterRect();
int dest_width = image_rect.Width();
@@ -794,12 +718,10 @@ FX_BOOL CPDF_ImageRenderer::StartDIBSource()
delete pStretched;
pStretched = NULL;
}
-#endif
return FALSE;
}
FX_BOOL CPDF_ImageRenderer::StartBitmapAlpha()
{
-#ifndef _FPDFAPI_MINI_
if (m_pDIBSource->IsOpaqueImage()) {
CFX_PathData path;
path.AppendRect(0, 0, 1, 1);
@@ -830,13 +752,11 @@ FX_BOOL CPDF_ImageRenderer::StartBitmapAlpha()
delete pAlphaMask;
}
}
-#endif
return FALSE;
}
FX_BOOL CPDF_ImageRenderer::Continue(IFX_Pause* pPause)
{
if (m_Status == 1) {
-#ifndef _FPDFAPI_MINI_
if (m_pQuickStretcher->Continue(pPause)) {
return TRUE;
}
@@ -847,9 +767,7 @@ FX_BOOL CPDF_ImageRenderer::Continue(IFX_Pause* pPause)
m_pRenderStatus->m_pDevice->SetDIBits(m_pQuickStretcher->m_pBitmap, m_pQuickStretcher->m_ResultLeft,
m_pQuickStretcher->m_ResultTop, m_BlendType);
return FALSE;
-#endif
} else if (m_Status == 2) {
-#if !defined(_FPDFAPI_MINI_) || defined(_FXCORE_FEATURE_ALL_)
if (m_pTransformer->Continue(pPause)) {
return TRUE;
}
@@ -872,7 +790,6 @@ FX_BOOL CPDF_ImageRenderer::Continue(IFX_Pause* pPause)
}
delete pBitmap;
return FALSE;
-#endif
} else if (m_Status == 3) {
return m_pRenderStatus->m_pDevice->ContinueDIBits(m_DeviceHandle, pPause);
} else if (m_Status == 4) {
diff --git a/core/src/fpdfapi/fpdf_render/fpdf_render_pattern.cpp b/core/src/fpdfapi/fpdf_render/fpdf_render_pattern.cpp
index 9d9d9ecfd1..6b895b525b 100644
--- a/core/src/fpdfapi/fpdf_render/fpdf_render_pattern.cpp
+++ b/core/src/fpdfapi/fpdf_render/fpdf_render_pattern.cpp
@@ -881,11 +881,6 @@ FX_BOOL CPDF_RenderStatus::ProcessShading(CPDF_ShadingObject* pShadingObj, const
matrix.Concat(*pObj2Device);
DrawShading(pShadingObj->m_pShading, &matrix, rect, pShadingObj->m_GeneralState.GetAlpha(FALSE),
m_Options.m_ColorMode == RENDER_COLOR_ALPHA);
-#ifdef _FPDFAPI_MINI_
- if (m_DitherBits) {
- DitherObjectArea(pShadingObj, pObj2Device);
- }
-#endif
return TRUE;
}
static CFX_DIBitmap* DrawPatternBitmap(CPDF_Document* pDoc, CPDF_PageRenderCache* pCache,
@@ -1117,9 +1112,4 @@ void CPDF_RenderStatus::ProcessPathPattern(CPDF_PathObject* pPathObj, const CFX_
bPattern = TRUE;
}
}
-#ifdef _FPDFAPI_MINI_
- if (bPattern && m_DitherBits) {
- DitherObjectArea(pPathObj, pObj2Device);
- }
-#endif
}
diff --git a/core/src/fpdfapi/fpdf_render/fpdf_render_text.cpp b/core/src/fpdfapi/fpdf_render/fpdf_render_text.cpp
index fcb422b6c4..449b003c56 100644
--- a/core/src/fpdfapi/fpdf_render/fpdf_render_text.cpp
+++ b/core/src/fpdfapi/fpdf_render/fpdf_render_text.cpp
@@ -256,16 +256,6 @@ FX_BOOL CPDF_RenderStatus::ProcessText(const CPDF_TextObject* textobj, const CFX
DrawTextPathWithPattern(textobj, pObj2Device, pFont, font_size, &text_matrix, bFill, bStroke);
return TRUE;
}
-#if defined(_FPDFAPI_MINI_)
- if (bFill) {
- bStroke = FALSE;
- }
- if (bStroke) {
- if (font_size * text_matrix.GetXUnit() * pObj2Device->GetXUnit() < 6) {
- bStroke = FALSE;
- }
- }
-#endif
if (bClip || bStroke) {
const CFX_AffineMatrix* pDeviceMatrix = pObj2Device;
CFX_AffineMatrix device_matrix;
@@ -284,12 +274,10 @@ FX_BOOL CPDF_RenderStatus::ProcessText(const CPDF_TextObject* textobj, const CFX
flag |= FX_FILL_STROKE;
flag |= FX_STROKE_TEXT_MODE;
}
-#if !defined(_FPDFAPI_MINI_) || defined(_FXCORE_FEATURE_ALL_)
const CPDF_GeneralStateData* pGeneralData = ((CPDF_PageObject*)textobj)->m_GeneralState;
if (pGeneralData && pGeneralData->m_StrokeAdjust) {
flag |= FX_STROKE_ADJUST;
}
-#endif
if (m_Options.m_Flags & RENDER_NOTEXTSMOOTH) {
flag |= FXFILL_NOPATHSMOOTH;
}
diff --git a/core/src/fpdfapi/fpdf_render/render_int.h b/core/src/fpdfapi/fpdf_render/render_int.h
index f9a04a99a4..81feb5eb88 100644
--- a/core/src/fpdfapi/fpdf_render/render_int.h
+++ b/core/src/fpdfapi/fpdf_render/render_int.h
@@ -435,11 +435,7 @@ protected:
CFX_DIBitmap* m_pCachedBitmap;
ICodec_ScanlineDecoder* m_pDecoder;
};
-#ifdef _FPDFAPI_MINI_
-#define FPDF_HUGE_IMAGE_SIZE 3000000
-#else
#define FPDF_HUGE_IMAGE_SIZE 60000000
-#endif
class CPDF_DIBTransferFunc : public CFX_FilteredDIB
{
public: