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

Unified Diff: core/fpdfapi/fpdf_page/include/cpdf_generalstate.h

Issue 2303553002: Make CPDF_GeneralState have a CPDF_GeneralStateData (Closed)
Patch Set: Nit 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
Index: core/fpdfapi/fpdf_page/include/cpdf_generalstate.h
diff --git a/core/fpdfapi/fpdf_page/include/cpdf_generalstate.h b/core/fpdfapi/fpdf_page/include/cpdf_generalstate.h
index dff8371119241d4b93e0bee77cdc0c85eebacb71..b653d640d7a82ff9b603d62bfea72b9c304f5f7d 100644
--- a/core/fpdfapi/fpdf_page/include/cpdf_generalstate.h
+++ b/core/fpdfapi/fpdf_page/include/cpdf_generalstate.h
@@ -10,22 +10,67 @@
#include "core/fpdfapi/fpdf_page/include/cpdf_generalstatedata.h"
#include "core/fxcrt/include/fx_basic.h"
-class CPDF_GeneralState : public CFX_CountRef<CPDF_GeneralStateData> {
+class CPDF_GeneralState {
public:
+ CPDF_GeneralState();
+ CPDF_GeneralState(const CPDF_GeneralState& that);
+ ~CPDF_GeneralState();
+
+ void Emplace() { m_Ref.Emplace(); }
+ operator bool() const { return !!m_Ref; }
+
void SetRenderIntent(const CFX_ByteString& ri);
- int GetBlendType() const {
- const CPDF_GeneralStateData* pData = GetObject();
- return pData ? pData->m_BlendType : FXDIB_BLEND_NORMAL;
- }
-
- int GetAlpha(FX_BOOL bStroke) const {
- const CPDF_GeneralStateData* pData = GetObject();
- if (!pData)
- return 255;
- return FXSYS_round((bStroke ? pData->m_StrokeAlpha : pData->m_FillAlpha) *
- 255);
- }
+ int GetBlendType() const;
+ void SetBlendType(int type);
+
+ FX_FLOAT GetFillAlpha() const;
+ void SetFillAlpha(FX_FLOAT alpha);
+
+ FX_FLOAT GetStrokeAlpha() const;
+ void SetStrokeAlpha(FX_FLOAT alpha);
+
+ CPDF_Object* GetSoftMask() const;
+ void SetSoftMask(CPDF_Object* pObject);
+
+ CPDF_Object* GetTR() const;
+ void SetTR(CPDF_Object* pObject);
+
+ CPDF_TransferFunc* GetTransferFunc() const;
+ void SetTransferFunc(CPDF_TransferFunc* pFunc);
+
+ void SetBlendMode(const CFX_ByteStringC& mode);
+
+ const FX_FLOAT* GetSMaskMatrix() const;
+ FX_FLOAT* GetMutableSMaskMatrix();
+
+ bool GetFillOP() const;
+ void SetFillOP(bool op);
+
+ bool GetStrokeOP() const;
+ void SetStrokeOP(bool op);
+
+ int GetOPMode() const;
+ void SetOPMode(int mode);
+
+ void SetBG(CPDF_Object* pObject);
+ void SetUCR(CPDF_Object* pObject);
+ void SetHT(CPDF_Object* pObject);
+
+ void SetFlatness(FX_FLOAT flatness);
+ void SetSmoothness(FX_FLOAT smoothness);
+
+ bool GetStrokeAdjust() const;
+ void SetStrokeAdjust(bool adjust);
+
+ void SetAlphaSource(bool source);
+ void SetTextKnockout(bool knockout);
+
+ void SetMatrix(const CFX_Matrix& matrix);
+ CFX_Matrix* GetMutableMatrix();
+
+ private:
+ CFX_CountRef<CPDF_GeneralStateData> m_Ref;
};
#endif // CORE_FPDFAPI_FPDF_PAGE_INCLUDE_CPDF_GENERALSTATE_H_
« no previous file with comments | « core/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp ('k') | core/fpdfapi/fpdf_page/include/cpdf_generalstatedata.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698