Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(28)

Unified Diff: core/fpdfapi/fpdf_page/cpdf_colorstate.h

Issue 2311313002: Make ColorStateData private to CPDF_ColorState (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « BUILD.gn ('k') | core/fpdfapi/fpdf_page/cpdf_colorstate.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: 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 a4077d965f7f3c62e6822d09f14e25ad9094be04..f6f72a2b46b23a12c28cfee4c43a2ad68dac2aaa 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<CPDF_ColorStateData> m_Ref;
+ CFX_CountRef<ColorData> m_Ref;
};
#endif // CORE_FPDFAPI_FPDF_PAGE_CPDF_COLORSTATE_H_
« no previous file with comments | « BUILD.gn ('k') | core/fpdfapi/fpdf_page/cpdf_colorstate.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698