diff options
author | caryclark <caryclark@google.com> | 2016-06-02 08:59:20 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-06-02 08:59:20 -0700 |
commit | 36e258b475702bdb1a95a88fcebd78b51069c532 (patch) | |
tree | 6752f85aa4944cbc59b7e05decfd1e891ad22ed1 /core/fxge/skia/fx_skia_device.h | |
parent | 2235b7b52e2cedea9b5d4822de9548994362ca96 (diff) | |
download | pdfium-36e258b475702bdb1a95a88fcebd78b51069c532.tar.xz |
The PDFium source in core/fxge/dib implements a bit-blitting backend.
This code has several disadvantages over a more modern graphics engine:
- no SIMD support
- no GPU support
- limited quality
Further, calling this code locks in the perceived resolution, so that
the output cannot be scaled without additional loss.
By directing all bitmap drawing through
CFX_SkiaDeviceDriver::StartDIBits, Skia can handle all appropriate
bitmap optimizations.
To that end, SetDIBits and StretchDIBits now call StartDIBits.
Other changes:
Skia's bitmaps are premultiplied. PDF contains bitmaps that are
unpremultiplied. PDFium appears to use premultiplied bitmaps sometimes,
and unpremultiplied bitmaps elsewhere. Add a debug check for
unpremultiplied bits in Skia's driver, and add a utility to premultiply
PDFium's bitmaps' bits.
PDFium supports a 24 bit RGB bitmap padded to a 32 bit word. Set the
high byte so that Skia can treat this as an ARGB bitmap.
Defer the application of the alpha value to the draw call rather than
calling MultiplyAlpha where possible.
Allow the destination bitmap to be alpha 8 or argb 32.
Review-Url: https://codereview.chromium.org/2025043002
Diffstat (limited to 'core/fxge/skia/fx_skia_device.h')
-rw-r--r-- | core/fxge/skia/fx_skia_device.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/core/fxge/skia/fx_skia_device.h b/core/fxge/skia/fx_skia_device.h index dd3ba420e8..085977b66e 100644 --- a/core/fxge/skia/fx_skia_device.h +++ b/core/fxge/skia/fx_skia_device.h @@ -114,8 +114,12 @@ class CFX_SkiaDeviceDriver : public IFX_RenderDeviceDriver { int alpha_flag = 0, void* pIccTransform = NULL, int blend_type = FXDIB_BLEND_NORMAL) override; - FX_BOOL ContinueDIBits(void* handle, IFX_Pause* pPause) override; - void CancelDIBits(void* handle) override; + + FX_BOOL ContinueDIBits(void* handle, IFX_Pause* pPause) override { + return FALSE; + } + + void CancelDIBits(void* handle) override {} FX_BOOL DrawDeviceText(int nChars, const FXTEXT_CHARPOS* pCharPos, @@ -138,6 +142,7 @@ class CFX_SkiaDeviceDriver : public IFX_RenderDeviceDriver { const CFX_GraphStateData* pGraphState, const SkMatrix& matrix); SkPictureRecorder* GetRecorder() const { return m_pRecorder; } + void PreMultiply(); private: CFX_DIBitmap* m_pBitmap; |