diff options
author | caryclark <caryclark@google.com> | 2016-06-29 07:10:49 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-06-29 07:10:50 -0700 |
commit | e89391e2cbec0788d39985df9c0967dd467cbfa8 (patch) | |
tree | 1c6c94fb35fb6a0bc16a165761b3340c97e0f4b5 /core/fxge/skia/fx_skia_device.h | |
parent | 0efab9428fe9fe0a1af4f8eba9fabb78b1eee44a (diff) | |
download | pdfium-e89391e2cbec0788d39985df9c0967dd467cbfa8.tar.xz |
add local caching for skia draws
PDFium assumes the lowest common denominator
and draws many strings and paths that can
be accumulated.
Defer canvas->restore() calls until required
because the clip changed.
Defer text and path draws as long as subsequent
calls concatenate additional data.
Include debugging switch to allow disabling cache
at compile-time while bugs are shaken out.
Review-Url: https://codereview.chromium.org/2064753002
Diffstat (limited to 'core/fxge/skia/fx_skia_device.h')
-rw-r--r-- | core/fxge/skia/fx_skia_device.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/core/fxge/skia/fx_skia_device.h b/core/fxge/skia/fx_skia_device.h index 4ea1ad1218..c21119b9a4 100644 --- a/core/fxge/skia/fx_skia_device.h +++ b/core/fxge/skia/fx_skia_device.h @@ -14,6 +14,7 @@ class SkMatrix; class SkPaint; class SkPath; class SkPictureRecorder; +class SkiaState; struct SkIRect; class CFX_SkiaDeviceDriver : public IFX_RenderDeviceDriver { @@ -122,14 +123,20 @@ class CFX_SkiaDeviceDriver : public IFX_RenderDeviceDriver { void PaintStroke(SkPaint* spaint, const CFX_GraphStateData* pGraphState, const SkMatrix& matrix); + void Flush(); SkPictureRecorder* GetRecorder() const { return m_pRecorder; } void PreMultiply(); + SkCanvas* SkiaCanvas() { return m_pCanvas; } + void Dump() const; private: + friend class SkiaState; + CFX_DIBitmap* m_pBitmap; CFX_DIBitmap* m_pOriDevice; SkCanvas* m_pCanvas; SkPictureRecorder* const m_pRecorder; + std::unique_ptr<SkiaState> m_pCache; FX_BOOL m_bRgbByteOrder; FX_BOOL m_bGroupKnockout; }; |