diff options
-rw-r--r-- | core/fpdfapi/render/cpdf_renderstatus.cpp | 4 | ||||
-rw-r--r-- | core/fxge/cfx_renderdevice.cpp | 9 | ||||
-rw-r--r-- | core/fxge/cfx_renderdevice.h | 2 | ||||
-rw-r--r-- | core/fxge/skia/fx_skia_device.cpp | 2 | ||||
-rw-r--r-- | fpdfsdk/fpdf_progressive.cpp | 15 | ||||
-rw-r--r-- | fpdfsdk/fpdfformfill.cpp | 2 | ||||
-rw-r--r-- | fpdfsdk/fpdfview.cpp | 2 |
7 files changed, 24 insertions, 12 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_ 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); |