summaryrefslogtreecommitdiff
path: root/core/src/fpdfapi/fpdf_render
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2015-10-08 15:14:24 -0700
committerLei Zhang <thestig@chromium.org>2015-10-08 15:14:24 -0700
commit921cc2403a9e643dfb29d70564fa435a1d79f972 (patch)
tree005543a896eb07b52a416abc2bc681d286fc24db /core/src/fpdfapi/fpdf_render
parentd1cb813d23df38a8e21df3314658995ded7c4b45 (diff)
downloadpdfium-921cc2403a9e643dfb29d70564fa435a1d79f972.tar.xz
Merge to XFA: Various changes to JBig2 cache:
- Makes the cache be per-document - Keys the cache on ObjNum and stream offset instead of keying on a pointer to the data (which can result in false cache hits). - Makes it so the cache is only used for the globals stream. - Reenable the cache. R=dml@google.com TBR=dml@google.com BUG=pdfium:207 Review URL: https://codereview.chromium.org/1380243004 . (cherry picked from commit f1b88e76134808f36f16b9e53a2e9dd89b12c8fd) Review URL: https://codereview.chromium.org/1394373002 .
Diffstat (limited to 'core/src/fpdfapi/fpdf_render')
-rw-r--r--core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp b/core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp
index f1fbf41d6d..1e7f077d48 100644
--- a/core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp
+++ b/core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp
@@ -407,12 +407,10 @@ int CPDF_DIBSource::ContinueLoadDIBSource(IFX_Pause* pPause) {
m_pGlobalStream->LoadAllData(pGlobals, FALSE);
}
}
- ret = pJbig2Module->StartDecode(
- m_pJbig2Context, m_Width, m_Height, m_pStreamAcc->GetData(),
- m_pStreamAcc->GetSize(),
- m_pGlobalStream ? m_pGlobalStream->GetData() : NULL,
- m_pGlobalStream ? m_pGlobalStream->GetSize() : 0,
- m_pCachedBitmap->GetBuffer(), m_pCachedBitmap->GetPitch(), pPause);
+ ret = pJbig2Module->StartDecode(m_pJbig2Context, m_pDocument, m_Width,
+ m_Height, m_pStreamAcc, m_pGlobalStream,
+ m_pCachedBitmap->GetBuffer(),
+ m_pCachedBitmap->GetPitch(), pPause);
if (ret < 0) {
m_pCachedBitmap.reset();
delete m_pGlobalStream;