diff options
author | Lei Zhang <thestig@chromium.org> | 2018-04-12 14:15:33 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-04-12 14:15:33 +0000 |
commit | e6d4559a1b6c2eb0eb433b9db70745e3be3d8465 (patch) | |
tree | d3c3ca944a97389e7ab698ecc5ab90dfb9bf1b13 /core/fxge/cfx_renderdevice.h | |
parent | 59a8f48571fc1e1b11f070c54e5d75b8b1c2e9a2 (diff) | |
download | pdfium-e6d4559a1b6c2eb0eb433b9db70745e3be3d8465.tar.xz |
Clean up some CFX_RenderDevice code.
- Pass matrices by const-ref instead of by pointers.
- Mark one SetClip_Rect() variant as XFA-only.
- Pass std::vector into DrawFillArea().
- Simplify the only DrawFillArea() caller.
Change-Id: I8f7497e4d46345d50ac4cc8f3e7eef135644e7a7
Reviewed-on: https://pdfium-review.googlesource.com/30131
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'core/fxge/cfx_renderdevice.h')
-rw-r--r-- | core/fxge/cfx_renderdevice.h | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/core/fxge/cfx_renderdevice.h b/core/fxge/cfx_renderdevice.h index e6c44ff35f..1d6fe48170 100644 --- a/core/fxge/cfx_renderdevice.h +++ b/core/fxge/cfx_renderdevice.h @@ -8,6 +8,7 @@ #define CORE_FXGE_CFX_RENDERDEVICE_H_ #include <memory> +#include <vector> #include "core/fpdfdoc/cpdf_defaultappearance.h" #include "core/fxcrt/unowned_ptr.h" @@ -123,7 +124,9 @@ class CFX_RenderDevice { bool SetClip_PathFill(const CFX_PathData* pPathData, const CFX_Matrix* pObject2Device, int fill_mode); - bool SetClip_Rect(const CFX_RectF& pRect); +#ifdef PDF_ENABLE_XFA + bool SetClip_Rect(const CFX_RectF& rtClip); +#endif bool SetClip_Rect(const FX_RECT& pRect); bool SetClip_PathStroke(const CFX_PathData* pPathData, const CFX_Matrix* pObject2Device, @@ -233,7 +236,7 @@ class CFX_RenderDevice { void DrawFillRect(const CFX_Matrix* pUser2Device, const CFX_FloatRect& rect, const FX_COLORREF& color); - void DrawStrokeRect(const CFX_Matrix* pUser2Device, + void DrawStrokeRect(const CFX_Matrix& mtUser2Device, const CFX_FloatRect& rect, const FX_COLORREF& color, float fWidth); @@ -250,14 +253,13 @@ class CFX_RenderDevice { const CFX_Color& crRightBottom, BorderStyle nStyle, int32_t nTransparency); - void DrawFillArea(const CFX_Matrix* pUser2Device, - const CFX_PointF* pPts, - int32_t nCount, + void DrawFillArea(const CFX_Matrix& mtUser2Device, + const std::vector<CFX_PointF>& points, const FX_COLORREF& color); - void DrawShadow(const CFX_Matrix* pUser2Device, + void DrawShadow(const CFX_Matrix& mtUser2Device, bool bVertical, bool bHorizontal, - CFX_FloatRect rect, + const CFX_FloatRect& rect, int32_t nTransparency, int32_t nStartGray, int32_t nEndGray); |