From f855489794ffd575d073eb575b04ac1ca1f286c2 Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Wed, 17 Jan 2018 16:29:15 +0000 Subject: Move fill draw code to fill classes This CL moves the code related to drawing fills and the various types of fill to the specific fill classes. Change-Id: Ie151089b00ca96c5fa88d22ab5f697d9425297cd Reviewed-on: https://pdfium-review.googlesource.com/23071 Reviewed-by: Ryan Harrison Commit-Queue: dsinclair --- xfa/fxfa/parser/cxfa_fill.h | 42 +++++++++++++++++++++++++----------------- 1 file changed, 25 insertions(+), 17 deletions(-) (limited to 'xfa/fxfa/parser/cxfa_fill.h') diff --git a/xfa/fxfa/parser/cxfa_fill.h b/xfa/fxfa/parser/cxfa_fill.h index dc733f5a24..1ffdcdf2a3 100644 --- a/xfa/fxfa/parser/cxfa_fill.h +++ b/xfa/fxfa/parser/cxfa_fill.h @@ -7,9 +7,12 @@ #ifndef XFA_FXFA_PARSER_CXFA_FILL_H_ #define XFA_FXFA_PARSER_CXFA_FILL_H_ +#include "core/fxcrt/fx_coordinates.h" #include "core/fxge/fx_dib.h" #include "xfa/fxfa/parser/cxfa_node.h" +#include "xfa/fxgraphics/cxfa_gepath.h" +class CXFA_Graphics; class CXFA_Linear; class CXFA_Pattern; class CXFA_Radial; @@ -25,25 +28,30 @@ class CXFA_Fill : public CXFA_Node { FX_ARGB GetColor(bool bText); void SetColor(FX_ARGB color); - XFA_Element GetFillType() const; - - XFA_AttributeEnum GetPatternType(); - FX_ARGB GetPatternColor(); - - XFA_AttributeEnum GetLinearType(); - FX_ARGB GetLinearColor(); - - int32_t GetStippleRate(); - FX_ARGB GetStippleColor(); - - bool IsRadialToEdge(); - FX_ARGB GetRadialColor(); + void Draw(CXFA_Graphics* pGS, + CXFA_GEPath* fillPath, + const CFX_RectF& rtWidget, + const CFX_Matrix& matrix); private: - CXFA_Stipple* GetStippleIfExists(); - CXFA_Radial* GetRadialIfExists(); - CXFA_Linear* GetLinearIfExists(); - CXFA_Pattern* GetPatternIfExists(); + XFA_Element GetType() const; + + void DrawStipple(CXFA_Graphics* pGS, + CXFA_GEPath* fillPath, + const CFX_RectF& rtWidget, + const CFX_Matrix& matrix); + void DrawRadial(CXFA_Graphics* pGS, + CXFA_GEPath* fillPath, + const CFX_RectF& rtWidget, + const CFX_Matrix& matrix); + void DrawLinear(CXFA_Graphics* pGS, + CXFA_GEPath* fillPath, + const CFX_RectF& rtWidget, + const CFX_Matrix& matrix); + void DrawPattern(CXFA_Graphics* pGS, + CXFA_GEPath* fillPath, + const CFX_RectF& rtWidget, + const CFX_Matrix& matrix); }; #endif // XFA_FXFA_PARSER_CXFA_FILL_H_ -- cgit v1.2.3