summaryrefslogtreecommitdiff
path: root/core/fpdfapi
diff options
context:
space:
mode:
authorcaryclark <caryclark@google.com>2016-12-06 13:49:34 -0800
committerCommit bot <commit-bot@chromium.org>2016-12-06 13:49:34 -0800
commit8f875507a986d10335e40a5f7c1679aff9770d0a (patch)
tree7e466d2741ea5e36b35422d7aa03326a754afff4 /core/fpdfapi
parent6bdb56cad7f9e31183b90152324281ac52c4563d (diff)
downloadpdfium-8f875507a986d10335e40a5f7c1679aff9770d0a.tar.xz
re-enable skia cachingchromium/2944
This permits consecutive path drawing or text drawing to combine if their graphics state matches. This speeds up rendering considerably when PDFium draws in many small parts. It also allows discarding changes to the clip state that have no effect from draw to draw. All corpus tests draw equivalently with caching enabled or disabled. Change the member order in CPDF_PageRenderContext so the device is flushed before the referencing annotation is deleted. Add more printf style debugging for test draws. R=dsinclair@chromium.org Review-Url: https://codereview.chromium.org/2546803003
Diffstat (limited to 'core/fpdfapi')
-rw-r--r--core/fpdfapi/cpdf_pagerendercontext.h2
-rw-r--r--core/fpdfapi/render/cpdf_renderstatus.cpp2
2 files changed, 3 insertions, 1 deletions
diff --git a/core/fpdfapi/cpdf_pagerendercontext.h b/core/fpdfapi/cpdf_pagerendercontext.h
index 9ddd075778..27244e7fc3 100644
--- a/core/fpdfapi/cpdf_pagerendercontext.h
+++ b/core/fpdfapi/cpdf_pagerendercontext.h
@@ -21,10 +21,10 @@ class CPDF_PageRenderContext {
CPDF_PageRenderContext();
~CPDF_PageRenderContext();
+ std::unique_ptr<CPDF_AnnotList> m_pAnnots;
std::unique_ptr<CFX_RenderDevice> m_pDevice;
std::unique_ptr<CPDF_RenderContext> m_pContext;
std::unique_ptr<CPDF_ProgressiveRenderer> m_pRenderer;
- std::unique_ptr<CPDF_AnnotList> m_pAnnots;
std::unique_ptr<CPDF_RenderOptions> m_pOptions;
};
diff --git a/core/fpdfapi/render/cpdf_renderstatus.cpp b/core/fpdfapi/render/cpdf_renderstatus.cpp
index 88dbb030ce..b23b98cdb1 100644
--- a/core/fpdfapi/render/cpdf_renderstatus.cpp
+++ b/core/fpdfapi/render/cpdf_renderstatus.cpp
@@ -898,6 +898,7 @@ std::unique_ptr<CFX_DIBitmap> DrawPatternBitmap(
context.AppendLayer(pPattern->form(), &mtPattern2Bitmap);
context.Render(&bitmap_device, &options, nullptr);
#if defined _SKIA_SUPPORT_PATHS_
+ bitmap_device.Flush();
pBitmap->UnPreMultiply();
#endif
return pBitmap;
@@ -1553,6 +1554,7 @@ bool CPDF_RenderStatus::ProcessTransparency(CPDF_PageObject* pPageObj,
pFormResource, true);
bitmap_render.ProcessObjectNoClip(pPageObj, &new_matrix);
#if defined _SKIA_SUPPORT_PATHS_
+ bitmap_device.Flush();
bitmap->UnPreMultiply();
#endif
m_bStopped = bitmap_render.m_bStopped;