diff options
author | caryclark <caryclark@google.com> | 2016-12-06 13:49:34 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-12-06 13:49:34 -0800 |
commit | 8f875507a986d10335e40a5f7c1679aff9770d0a (patch) | |
tree | 7e466d2741ea5e36b35422d7aa03326a754afff4 /core/fxge/ge | |
parent | 6bdb56cad7f9e31183b90152324281ac52c4563d (diff) | |
download | pdfium-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/fxge/ge')
-rw-r--r-- | core/fxge/ge/cfx_renderdevice.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/core/fxge/ge/cfx_renderdevice.cpp b/core/fxge/ge/cfx_renderdevice.cpp index 64fa6ff452..9c67a7d1e7 100644 --- a/core/fxge/ge/cfx_renderdevice.cpp +++ b/core/fxge/ge/cfx_renderdevice.cpp @@ -354,9 +354,13 @@ CFX_RenderDevice::CFX_RenderDevice() m_RenderCaps(0), m_DeviceClass(0) {} -CFX_RenderDevice::~CFX_RenderDevice() {} +CFX_RenderDevice::~CFX_RenderDevice() { +#if defined _SKIA_SUPPORT_ || defined _SKIA_SUPPORT_PATHS_ + Flush(); +#endif +} -#ifdef _SKIA_SUPPORT_ +#if defined _SKIA_SUPPORT_ || defined _SKIA_SUPPORT_PATHS_ void CFX_RenderDevice::Flush() { m_pDeviceDriver.reset(); } @@ -615,6 +619,9 @@ bool CFX_RenderDevice::DrawFillStrokePath(const CFX_PathData* pPathData, blend_type)) { return false; } +#if defined _SKIA_SUPPORT_ || defined _SKIA_SUPPORT_PATHS_ + bitmap_device.GetDeviceDriver()->Flush(); +#endif FX_RECT src_rect(0, 0, FXSYS_round(rect.Width() * fScaleX), FXSYS_round(rect.Height() * fScaleY)); return m_pDeviceDriver->SetDIBits(&bitmap, 0, &src_rect, rect.left, rect.top, |