summaryrefslogtreecommitdiff
path: root/core/fpdfapi/fpdf_page/cpdf_colorstatedata.h
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2016-08-29 12:52:56 -0700
committerCommit bot <commit-bot@chromium.org>2016-08-29 12:52:56 -0700
commit91ddd3f7501429222f648b986a99f3959a398889 (patch)
treeb6a712b9caf63f1e344a6475281226394e1e07c2 /core/fpdfapi/fpdf_page/cpdf_colorstatedata.h
parentc37d7d452d6a37c997c8709576dd71406ecff618 (diff)
downloadpdfium-91ddd3f7501429222f648b986a99f3959a398889.tar.xz
Use ->() in CPDF_ColorState
Move methods to CPDF_ColorStateData. Move MakePrivateCopy() methods to call sites. Remove now-empty cpdf_colorstate.cpp file. Review-Url: https://codereview.chromium.org/2291763002
Diffstat (limited to 'core/fpdfapi/fpdf_page/cpdf_colorstatedata.h')
-rw-r--r--core/fpdfapi/fpdf_page/cpdf_colorstatedata.h38
1 files changed, 35 insertions, 3 deletions
diff --git a/core/fpdfapi/fpdf_page/cpdf_colorstatedata.h b/core/fpdfapi/fpdf_page/cpdf_colorstatedata.h
index 6a992ad0b1..1b8413f3f1 100644
--- a/core/fpdfapi/fpdf_page/cpdf_colorstatedata.h
+++ b/core/fpdfapi/fpdf_page/cpdf_colorstatedata.h
@@ -10,17 +10,49 @@
#include "core/fpdfapi/fpdf_page/include/cpdf_color.h"
#include "core/fxcrt/include/fx_system.h"
+class CPDF_Color;
+class CPDF_ColorSpace;
+class CPDF_Pattern;
+
class CPDF_ColorStateData {
public:
CPDF_ColorStateData() : m_FillRGB(0), m_StrokeRGB(0) {}
CPDF_ColorStateData(const CPDF_ColorStateData& src);
- void Default();
+ void SetDefault();
+
+ uint32_t GetFillRGB() const { return m_FillRGB; }
+ void SetFillRGB(uint32_t rgb) { m_FillRGB = rgb; }
+
+ uint32_t GetStrokeRGB() const { return m_StrokeRGB; }
+ void SetStrokeRGB(uint32_t rgb) { m_StrokeRGB = rgb; }
+
+ CPDF_Color* GetFillColor() { return &m_FillColor; }
+ const CPDF_Color* GetFillColor() const { return &m_FillColor; }
+ void SetFillColor(CPDF_ColorSpace* pCS, FX_FLOAT* pValue, uint32_t nValues);
+
+ CPDF_Color* GetStrokeColor() { return &m_StrokeColor; }
+ const CPDF_Color* GetStrokeColor() const { return &m_StrokeColor; }
+ void SetStrokeColor(CPDF_ColorSpace* pCS, FX_FLOAT* pValue, uint32_t nValues);
+
+ void SetFillPattern(CPDF_Pattern* pattern,
+ FX_FLOAT* pValue,
+ uint32_t nValues);
+ void SetStrokePattern(CPDF_Pattern* pattern,
+ FX_FLOAT* pValue,
+ uint32_t nValues);
+
+ private:
+ void SetColor(CPDF_Color& color,
+ uint32_t& rgb,
+ CPDF_ColorSpace* pCS,
+ FX_FLOAT* pValue,
+ uint32_t nValues);
- CPDF_Color m_FillColor;
uint32_t m_FillRGB;
- CPDF_Color m_StrokeColor;
uint32_t m_StrokeRGB;
+ CPDF_Color m_FillColor;
+ CPDF_Color m_StrokeColor;
};
#endif // CORE_FPDFAPI_FPDF_PAGE_CPDF_COLORSTATEDATA_H_