From af177fe1c062d20b663a4a1c14924be85d0e631e Mon Sep 17 00:00:00 2001 From: caryclark Date: Wed, 16 Nov 2016 10:10:03 -0800 Subject: Create a subset of skia support for paths only This is a continuation of https://codereview.chromium.org/2346483006/ This removes the need for agg, without providing full Skia support. It doesn't work yet, but it does compile and run for simple PDFs. R=dsinclair@google.com Committed: https://pdfium.googlesource.com/pdfium/+/5d223298b26c9b2b6284cba9a51521d3873b6e58 Review-Url: https://codereview.chromium.org/2491693002 --- core/fxge/skia/fx_skia_device.h | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'core/fxge/skia/fx_skia_device.h') diff --git a/core/fxge/skia/fx_skia_device.h b/core/fxge/skia/fx_skia_device.h index 199e76689a..ca5707c41a 100644 --- a/core/fxge/skia/fx_skia_device.h +++ b/core/fxge/skia/fx_skia_device.h @@ -5,7 +5,7 @@ #ifndef CORE_FXGE_SKIA_FX_SKIA_DEVICE_H_ #define CORE_FXGE_SKIA_FX_SKIA_DEVICE_H_ -#if defined(_SKIA_SUPPORT_) +#if defined _SKIA_SUPPORT_ || defined _SKIA_SUPPORT_PATHS_ #include "core/fxge/cfx_pathdata.h" #include "core/fxge/ifx_renderdevicedriver.h" @@ -25,8 +25,10 @@ class CFX_SkiaDeviceDriver : public IFX_RenderDeviceDriver { bool bRgbByteOrder, CFX_DIBitmap* pOriDevice, bool bGroupKnockout); +#ifdef _SKIA_SUPPORT_ explicit CFX_SkiaDeviceDriver(SkPictureRecorder* recorder); CFX_SkiaDeviceDriver(int size_x, int size_y); +#endif ~CFX_SkiaDeviceDriver() override; /** Options */ @@ -84,12 +86,17 @@ class CFX_SkiaDeviceDriver : public IFX_RenderDeviceDriver { int dest_left, int dest_top, int blend_type) override; +#ifdef _SKIA_SUPPORT_ bool SetBitsWithMask(const CFX_DIBSource* pBitmap, const CFX_DIBSource* pMask, int dest_left, int dest_top, int bitmap_alpha, int blend_type) override; +#else + void SetClipMask(const FX_RECT& clipBox, const SkPath& skClipPath); +#endif + bool StretchDIBits(const CFX_DIBSource* pBitmap, uint32_t color, int dest_left, @@ -125,11 +132,13 @@ class CFX_SkiaDeviceDriver : public IFX_RenderDeviceDriver { FX_FLOAT font_size, uint32_t color) override; +#ifdef _SKIA_SUPPORT_ bool DrawShading(const CPDF_ShadingPattern* pPattern, const CFX_Matrix* pMatrix, const FX_RECT& clip_rect, int alpha, bool bAlphaMode) override; +#endif virtual uint8_t* GetBuffer() const; @@ -152,6 +161,12 @@ class CFX_SkiaDeviceDriver : public IFX_RenderDeviceDriver { SkCanvas* m_pCanvas; SkPictureRecorder* const m_pRecorder; std::unique_ptr m_pCache; +#ifndef _SKIA_SUPPORT_ + std::unique_ptr m_pClipRgn; + std::vector> m_StateStack; + int m_FillFlags; + bool m_bRgbByteOrder; +#endif bool m_bGroupKnockout; }; #endif // defined(_SKIA_SUPPORT_) -- cgit v1.2.3