diff options
author | Cary Clark <caryclark@skia.org> | 2017-07-25 10:39:10 -0400 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-07-25 14:53:28 +0000 |
commit | 364d18b13575a2b569e9fc175cb0dd60106fa954 (patch) | |
tree | 56f594a9b9309330a6c91408132f19fb296b66e5 /fpdfsdk | |
parent | c411eb943bb51e16ff4fb5a6ffb06e277ca6a982 (diff) | |
download | pdfium-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 'fpdfsdk')
-rw-r--r-- | fpdfsdk/fpdf_progressive.cpp | 15 | ||||
-rw-r--r-- | fpdfsdk/fpdfformfill.cpp | 2 | ||||
-rw-r--r-- | fpdfsdk/fpdfview.cpp | 2 |
3 files changed, 14 insertions, 5 deletions
diff --git a/fpdfsdk/fpdf_progressive.cpp b/fpdfsdk/fpdf_progressive.cpp index 1b10a119dc..2411869904 100644 --- a/fpdfsdk/fpdf_progressive.cpp +++ b/fpdfsdk/fpdf_progressive.cpp @@ -61,7 +61,7 @@ DLLEXPORT int STDCALL FPDF_RenderPageBitmap_Start(FPDF_BITMAP bitmap, rotate, flags, false, &IPauseAdapter); #ifdef _SKIA_SUPPORT_PATHS_ - pDevice->Flush(); + pDevice->Flush(false); pBitmap->UnPreMultiply(); #endif if (pContext->m_pRenderer) { @@ -86,7 +86,7 @@ DLLEXPORT int STDCALL FPDF_RenderPage_Continue(FPDF_PAGE page, pContext->m_pRenderer->Continue(&IPauseAdapter); #ifdef _SKIA_SUPPORT_PATHS_ CFX_RenderDevice* pDevice = pContext->m_pDevice.get(); - pDevice->Flush(); + pDevice->Flush(false); pDevice->GetBitmap()->UnPreMultiply(); #endif return CPDF_ProgressiveRenderer::ToFPDFStatus( @@ -97,6 +97,15 @@ DLLEXPORT int STDCALL FPDF_RenderPage_Continue(FPDF_PAGE page, DLLEXPORT void STDCALL FPDF_RenderPage_Close(FPDF_PAGE page) { CPDF_Page* pPage = CPDFPageFromFPDFPage(page); - if (pPage) + if (pPage) { +#ifdef _SKIA_SUPPORT_PATHS_ + CPDF_PageRenderContext* pContext = pPage->GetRenderContext(); + if (pContext && pContext->m_pRenderer) { + CFX_RenderDevice* pDevice = pContext->m_pDevice.get(); + pDevice->Flush(true); + pDevice->GetBitmap()->UnPreMultiply(); + } +#endif pPage->SetRenderContext(nullptr); + } } diff --git a/fpdfsdk/fpdfformfill.cpp b/fpdfsdk/fpdfformfill.cpp index 627bd0a925..e541b81cc3 100644 --- a/fpdfsdk/fpdfformfill.cpp +++ b/fpdfsdk/fpdfformfill.cpp @@ -144,7 +144,7 @@ void FFLCommon(FPDF_FORMHANDLE hHandle, #endif // PDF_ENABLE_XFA } #ifdef _SKIA_SUPPORT_PATHS_ - pDevice->Flush(); + pDevice->Flush(true); holder->UnPreMultiply(); #endif } diff --git a/fpdfsdk/fpdfview.cpp b/fpdfsdk/fpdfview.cpp index f8823c994c..956e6db671 100644 --- a/fpdfsdk/fpdfview.cpp +++ b/fpdfsdk/fpdfview.cpp @@ -940,7 +940,7 @@ DLLEXPORT void STDCALL FPDF_RenderPageBitmap(FPDF_BITMAP bitmap, rotate, flags, true, nullptr); #ifdef _SKIA_SUPPORT_PATHS_ - pDevice->Flush(); + pDevice->Flush(true); pBitmap->UnPreMultiply(); #endif pPage->SetRenderContext(nullptr); |