re-enable skia caching
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
diff --git a/fpdfsdk/fpdfformfill.cpp b/fpdfsdk/fpdfformfill.cpp
index 44204b7..6b8cbaa 100644
--- a/fpdfsdk/fpdfformfill.cpp
+++ b/fpdfsdk/fpdfformfill.cpp
@@ -137,10 +137,11 @@
pPageView->PageView_OnDraw(pDevice.get(), &matrix, &options);
#endif // PDF_ENABLE_XFA
-#ifdef _SKIA_SUPPORT_PATHS
+ pDevice->RestoreState(false);
+#ifdef _SKIA_SUPPORT_PATHS_
+ pDevice->Flush();
CFXBitmapFromFPDFBitmap(bitmap)->UnPreMultiply();
#endif
- pDevice->RestoreState(false);
delete options.m_pOCContext;
options.m_pOCContext = nullptr;
}