From 687fbde2e4ee13637cb3fd9b1fec39a436ef73d7 Mon Sep 17 00:00:00 2001 From: caryclark Date: Tue, 22 Nov 2016 12:44:25 -0800 Subject: handle antialiased rendering as premultiplied Transparencies and bitmap patterns need to be unpremultiplied after Skia renders them so that PDFium can use its own compositing. Also added some linear (i.e. axial) gradient support, although its unclear if any of the test corpus uses this feature. R=dsinclair@chromium.org Review-Url: https://codereview.chromium.org/2520073003 --- fpdfsdk/fpdfformfill.cpp | 3 +++ fpdfsdk/fpdfview.cpp | 3 +++ 2 files changed, 6 insertions(+) (limited to 'fpdfsdk') diff --git a/fpdfsdk/fpdfformfill.cpp b/fpdfsdk/fpdfformfill.cpp index e8a8a6e2d0..44204b766a 100644 --- a/fpdfsdk/fpdfformfill.cpp +++ b/fpdfsdk/fpdfformfill.cpp @@ -137,6 +137,9 @@ void FFLCommon(FPDF_FORMHANDLE hHandle, pPageView->PageView_OnDraw(pDevice.get(), &matrix, &options); #endif // PDF_ENABLE_XFA +#ifdef _SKIA_SUPPORT_PATHS + CFXBitmapFromFPDFBitmap(bitmap)->UnPreMultiply(); +#endif pDevice->RestoreState(false); delete options.m_pOCContext; options.m_pOCContext = nullptr; diff --git a/fpdfsdk/fpdfview.cpp b/fpdfsdk/fpdfview.cpp index d5f9a0e810..959bf14390 100644 --- a/fpdfsdk/fpdfview.cpp +++ b/fpdfsdk/fpdfview.cpp @@ -598,6 +598,9 @@ DLLEXPORT void STDCALL FPDF_RenderPageBitmap(FPDF_BITMAP bitmap, FPDF_RenderPage_Retail(pContext, page, start_x, start_y, size_x, size_y, rotate, flags, true, nullptr); +#ifdef _SKIA_SUPPORT_PATHS_ + pBitmap->UnPreMultiply(); +#endif pPage->SetRenderContext(nullptr); } -- cgit v1.2.3