diff options
author | Lei Zhang <thestig@chromium.org> | 2018-10-06 00:32:16 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-10-06 00:32:16 +0000 |
commit | d9826495fe0e279c6e2d587a656c7452cc2dc71f (patch) | |
tree | 0256f8903da70445c5f8e21b62c01d2d70385201 /core/fpdfapi/page/cpdf_pageobject.h | |
parent | a0032a2a2c53794bbf0ccb412a5c70ce66f052fb (diff) | |
download | pdfium-d9826495fe0e279c6e2d587a656c7452cc2dc71f.tar.xz |
Encapsulate CPDF_PageObject's rect member.
At the same time, change it from 4 floats to a CFX_FloatRect.
Change-Id: I00ded941723d6a264b7a17c73fd337e66b449308
Reviewed-on: https://pdfium-review.googlesource.com/c/43570
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'core/fpdfapi/page/cpdf_pageobject.h')
-rw-r--r-- | core/fpdfapi/page/cpdf_pageobject.h | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/core/fpdfapi/page/cpdf_pageobject.h b/core/fpdfapi/page/cpdf_pageobject.h index 1dfe20b6f9..013ef0d03b 100644 --- a/core/fpdfapi/page/cpdf_pageobject.h +++ b/core/fpdfapi/page/cpdf_pageobject.h @@ -54,12 +54,11 @@ class CPDF_PageObject : public CPDF_GraphicStates { void SetDirty(bool value) { m_bDirty = value; } bool IsDirty() const { return m_bDirty; } - void TransformClipPath(CFX_Matrix& matrix); - void TransformGeneralState(CFX_Matrix& matrix); + void TransformClipPath(const CFX_Matrix& matrix); + void TransformGeneralState(const CFX_Matrix& matrix); - CFX_FloatRect GetRect() const { - return CFX_FloatRect(m_Left, m_Bottom, m_Right, m_Top); - } + void SetRect(const CFX_FloatRect& rect) { m_Rect = rect; } + const CFX_FloatRect& GetRect() const { return m_Rect; } FX_RECT GetBBox() const; FX_RECT GetTransformedBBox(const CFX_Matrix& matrix) const; @@ -75,20 +74,18 @@ class CPDF_PageObject : public CPDF_GraphicStates { m_ContentStream = new_content_stream; } - float m_Left; - float m_Right; - float m_Top; - float m_Bottom; CPDF_ContentMark m_ContentMark; protected: void CopyData(const CPDF_PageObject* pSrcObject); + CFX_FloatRect m_Rect; + private: CPDF_PageObject(const CPDF_PageObject& src) = delete; void operator=(const CPDF_PageObject& src) = delete; - bool m_bDirty; + bool m_bDirty = false; int32_t m_ContentStream; }; |