summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorCary Clark <caryclark@skia.org>2017-07-25 10:39:10 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-07-25 14:53:28 +0000
commit364d18b13575a2b569e9fc175cb0dd60106fa954 (patch)
tree56f594a9b9309330a6c91408132f19fb296b66e5 /core
parentc411eb943bb51e16ff4fb5a6ffb06e277ca6a982 (diff)
downloadpdfium-364d18b13575a2b569e9fc175cb0dd60106fa954.tar.xz
flush but do not release skia driver
Most calls to the Skia Driver combine flushing the draw cache with deleting the driver itself. Progressive drawing needs to flush the cache to keep drawing in order, but the driver must remain for the next progressive draw. R=dsinclair@chromium.org, hnakashima@chromium.org Bug: pdfium:833 Change-Id: I311f80b2dc0ef6e4df9a3a0f082ae076cb7a591f Reviewed-on: https://pdfium-review.googlesource.com/8890 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'core')
-rw-r--r--core/fpdfapi/render/cpdf_renderstatus.cpp4
-rw-r--r--core/fxge/cfx_renderdevice.cpp9
-rw-r--r--core/fxge/cfx_renderdevice.h2
-rw-r--r--core/fxge/skia/fx_skia_device.cpp2
4 files changed, 10 insertions, 7 deletions
diff --git a/core/fpdfapi/render/cpdf_renderstatus.cpp b/core/fpdfapi/render/cpdf_renderstatus.cpp
index e033f26093..a08650500b 100644
--- a/core/fpdfapi/render/cpdf_renderstatus.cpp
+++ b/core/fpdfapi/render/cpdf_renderstatus.cpp
@@ -944,7 +944,7 @@ CFX_RetainPtr<CFX_DIBitmap> DrawPatternBitmap(CPDF_Document* pDoc,
context.AppendLayer(pPattern->form(), &mtPattern2Bitmap);
context.Render(&bitmap_device, &options, nullptr);
#if defined _SKIA_SUPPORT_PATHS_
- bitmap_device.Flush();
+ bitmap_device.Flush(true);
pBitmap->UnPreMultiply();
#endif
return pBitmap;
@@ -1602,7 +1602,7 @@ bool CPDF_RenderStatus::ProcessTransparency(CPDF_PageObject* pPageObj,
m_bDropObjects, pFormResource, true);
bitmap_render.ProcessObjectNoClip(pPageObj, &new_matrix);
#if defined _SKIA_SUPPORT_PATHS_
- bitmap_device.Flush();
+ bitmap_device.Flush(true);
bitmap->UnPreMultiply();
#endif
m_bStopped = bitmap_render.m_bStopped;
diff --git a/core/fxge/cfx_renderdevice.cpp b/core/fxge/cfx_renderdevice.cpp
index 407c090c73..279e720d1e 100644
--- a/core/fxge/cfx_renderdevice.cpp
+++ b/core/fxge/cfx_renderdevice.cpp
@@ -375,13 +375,16 @@ CFX_RenderDevice::CFX_RenderDevice()
CFX_RenderDevice::~CFX_RenderDevice() {
RestoreState(false);
#if defined _SKIA_SUPPORT_ || defined _SKIA_SUPPORT_PATHS_
- Flush();
+ Flush(true);
#endif
}
#if defined _SKIA_SUPPORT_ || defined _SKIA_SUPPORT_PATHS_
-void CFX_RenderDevice::Flush() {
- m_pDeviceDriver.reset();
+void CFX_RenderDevice::Flush(bool release) {
+ if (release)
+ m_pDeviceDriver.reset();
+ else
+ m_pDeviceDriver->Flush();
}
#endif
diff --git a/core/fxge/cfx_renderdevice.h b/core/fxge/cfx_renderdevice.h
index ef15718d58..ad8e487749 100644
--- a/core/fxge/cfx_renderdevice.h
+++ b/core/fxge/cfx_renderdevice.h
@@ -274,7 +274,7 @@ class CFX_RenderDevice {
int blend_type);
#endif
#if defined _SKIA_SUPPORT_ || defined _SKIA_SUPPORT_PATHS_
- void Flush();
+ void Flush(bool release);
#endif
private:
diff --git a/core/fxge/skia/fx_skia_device.cpp b/core/fxge/skia/fx_skia_device.cpp
index 855699a4be..523c8a28e8 100644
--- a/core/fxge/skia/fx_skia_device.cpp
+++ b/core/fxge/skia/fx_skia_device.cpp
@@ -2595,7 +2595,7 @@ bool CFX_DefaultRenderDevice::Create(
}
CFX_DefaultRenderDevice::~CFX_DefaultRenderDevice() {
- Flush();
+ Flush(true);
}
#ifdef _SKIA_SUPPORT_