Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(113)

Unified Diff: core/src/fpdfapi/fpdf_render/fpdf_render_cache.cpp

Issue 801913002: Simplify PDFium by removing code that's not used in the open source repo. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: core/src/fpdfapi/fpdf_render/fpdf_render_cache.cpp
diff --git a/core/src/fpdfapi/fpdf_render/fpdf_render_cache.cpp b/core/src/fpdfapi/fpdf_render/fpdf_render_cache.cpp
index 45b6970e2a58a28481447573777831914f998da4..de2a409e1cc363a76c1f124a58c49863aa4f3bc2 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();

Powered by Google App Engine
This is Rietveld 408576698