summaryrefslogtreecommitdiff
path: root/core/fxge/cfx_graphstatedata.h
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2018-09-24 17:55:00 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-09-24 17:55:00 +0000
commitfed6e124109f089a38e24e37b104d983231bee78 (patch)
tree6c1aa45a97eb27c67611dbe7480bdbcd26710d14 /core/fxge/cfx_graphstatedata.h
parent97f4483de007c2ff248696f24d34634e0adbf894 (diff)
downloadpdfium-fed6e124109f089a38e24e37b104d983231bee78.tar.xz
Give CFX_GraphStateData a work-over.chromium/3561
Use std::vector<float> for dash array. Use compiler-generated default operations. Squeeze some enums. Fix obvious logic botch in DashChanged(). Change-Id: If1d809cc46a3cf2db98a09a3f5a49d22138c0640 Reviewed-on: https://pdfium-review.googlesource.com/42613 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'core/fxge/cfx_graphstatedata.h')
-rw-r--r--core/fxge/cfx_graphstatedata.h36
1 files changed, 20 insertions, 16 deletions
diff --git a/core/fxge/cfx_graphstatedata.h b/core/fxge/cfx_graphstatedata.h
index a907f2a922..5604802449 100644
--- a/core/fxge/cfx_graphstatedata.h
+++ b/core/fxge/cfx_graphstatedata.h
@@ -7,33 +7,37 @@
#ifndef CORE_FXGE_CFX_GRAPHSTATEDATA_H_
#define CORE_FXGE_CFX_GRAPHSTATEDATA_H_
+#include <vector>
+
#include "core/fxcrt/fx_system.h"
#include "core/fxcrt/retain_ptr.h"
class CFX_GraphStateData final : public Retainable {
public:
- enum LineCap { LineCapButt = 0, LineCapRound = 1, LineCapSquare = 2 };
+ enum LineCap : uint8_t {
+ LineCapButt = 0,
+ LineCapRound = 1,
+ LineCapSquare = 2
+ };
+
+ enum LineJoin : uint8_t {
+ LineJoinMiter = 0,
+ LineJoinRound = 1,
+ LineJoinBevel = 2
+ };
CFX_GraphStateData();
CFX_GraphStateData(const CFX_GraphStateData& src);
~CFX_GraphStateData() override;
- void Copy(const CFX_GraphStateData& src);
- void SetDashCount(int count);
-
- LineCap m_LineCap;
- int m_DashCount;
- float* m_DashArray;
- float m_DashPhase;
+ CFX_GraphStateData& operator=(const CFX_GraphStateData& src);
- enum LineJoin {
- LineJoinMiter = 0,
- LineJoinRound = 1,
- LineJoinBevel = 2,
- };
- LineJoin m_LineJoin;
- float m_MiterLimit;
- float m_LineWidth;
+ LineCap m_LineCap = LineCapButt;
+ LineJoin m_LineJoin = LineJoinMiter;
+ float m_DashPhase = 0.0f;
+ float m_MiterLimit = 10.0f;
+ float m_LineWidth = 1.0f;
+ std::vector<float> m_DashArray;
};
#endif // CORE_FXGE_CFX_GRAPHSTATEDATA_H_