From f40c6f122d6ddd73de21d225fca0c1734c9bdeac Mon Sep 17 00:00:00 2001 From: tsepez Date: Tue, 6 Sep 2016 11:45:32 -0700 Subject: Make ColorStateData private to CPDF_ColorState Review-Url: https://codereview.chromium.org/2311313002 --- core/fpdfapi/fpdf_page/cpdf_colorstate.h | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) (limited to 'core/fpdfapi/fpdf_page/cpdf_colorstate.h') diff --git a/core/fpdfapi/fpdf_page/cpdf_colorstate.h b/core/fpdfapi/fpdf_page/cpdf_colorstate.h index a4077d965f..f6f72a2b46 100644 --- a/core/fpdfapi/fpdf_page/cpdf_colorstate.h +++ b/core/fpdfapi/fpdf_page/cpdf_colorstate.h @@ -7,7 +7,7 @@ #ifndef CORE_FPDFAPI_FPDF_PAGE_CPDF_COLORSTATE_H_ #define CORE_FPDFAPI_FPDF_PAGE_CPDF_COLORSTATE_H_ -#include "core/fpdfapi/fpdf_page/cpdf_colorstatedata.h" +#include "core/fpdfapi/fpdf_page/include/cpdf_color.h" #include "core/fxcrt/include/cfx_count_ref.h" #include "core/fxcrt/include/fx_basic.h" #include "core/fxcrt/include/fx_system.h" @@ -48,19 +48,30 @@ class CPDF_ColorState { FX_FLOAT* pValue, uint32_t nValues); - // TODO(tsepez): Stop leaking ColorStateData outside this class. - const CPDF_ColorStateData* GetObject() const { return m_Ref.GetObject(); } - explicit operator bool() const { return !!m_Ref; } private: + class ColorData { + public: + ColorData(); + ColorData(const ColorData& src); + ~ColorData(); + + void SetDefault(); + + uint32_t m_FillRGB; + uint32_t m_StrokeRGB; + CPDF_Color m_FillColor; + CPDF_Color m_StrokeColor; + }; + void SetColor(CPDF_Color& color, uint32_t& rgb, CPDF_ColorSpace* pCS, FX_FLOAT* pValue, uint32_t nValues); - CFX_CountRef m_Ref; + CFX_CountRef m_Ref; }; #endif // CORE_FPDFAPI_FPDF_PAGE_CPDF_COLORSTATE_H_ -- cgit v1.2.3