diff options
author | caryclark <caryclark@google.com> | 2016-12-06 13:49:34 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-12-06 13:49:34 -0800 |
commit | 8f875507a986d10335e40a5f7c1679aff9770d0a (patch) | |
tree | 7e466d2741ea5e36b35422d7aa03326a754afff4 /core/fxge/skia/fx_skia_device.h | |
parent | 6bdb56cad7f9e31183b90152324281ac52c4563d (diff) | |
download | pdfium-8f875507a986d10335e40a5f7c1679aff9770d0a.tar.xz |
re-enable skia cachingchromium/2944
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
Diffstat (limited to 'core/fxge/skia/fx_skia_device.h')
-rw-r--r-- | core/fxge/skia/fx_skia_device.h | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/core/fxge/skia/fx_skia_device.h b/core/fxge/skia/fx_skia_device.h index 06b7be3d82..c83f9919e0 100644 --- a/core/fxge/skia/fx_skia_device.h +++ b/core/fxge/skia/fx_skia_device.h @@ -152,8 +152,9 @@ class CFX_SkiaDeviceDriver : public IFX_RenderDeviceDriver { const CFX_GraphStateData* pGraphState, const SkMatrix& matrix); void Clear(uint32_t color); - void Flush(); + void Flush() override; SkPictureRecorder* GetRecorder() const { return m_pRecorder; } + void PreMultiply() { m_pBitmap->PreMultiply(); } static void PreMultiply(CFX_DIBitmap* pDIBitmap); SkCanvas* SkiaCanvas() { return m_pCanvas; } void DebugVerifyBitmapIsPreMultiplied() const; @@ -166,9 +167,7 @@ class CFX_SkiaDeviceDriver : public IFX_RenderDeviceDriver { CFX_DIBitmap* m_pOriDevice; SkCanvas* m_pCanvas; SkPictureRecorder* const m_pRecorder; -#ifdef _SKIA_SUPPORT_ std::unique_ptr<SkiaState> m_pCache; -#endif #ifdef _SKIA_SUPPORT_PATHS_ std::unique_ptr<CFX_ClipRgn> m_pClipRgn; std::vector<std::unique_ptr<CFX_ClipRgn>> m_StateStack; @@ -177,6 +176,6 @@ class CFX_SkiaDeviceDriver : public IFX_RenderDeviceDriver { #endif bool m_bGroupKnockout; }; -#endif // defined(_SKIA_SUPPORT_) +#endif // defined _SKIA_SUPPORT_ || defined _SKIA_SUPPORT_PATHS_ #endif // CORE_FXGE_SKIA_FX_SKIA_DEVICE_H_ |