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

Side by Side Diff: core/fpdfapi/fpdf_page/include/cpdf_path.h

Issue 2310693002: Use safe bool conversion operators in fpdf_page/ (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 unified diff | Download patch
« no previous file with comments | « core/fpdfapi/fpdf_page/include/cpdf_generalstate.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 PDFium Authors. All rights reserved. 1 // Copyright 2016 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 6
7 #ifndef CORE_FPDFAPI_FPDF_PAGE_INCLUDE_CPDF_PATH_H_ 7 #ifndef CORE_FPDFAPI_FPDF_PAGE_INCLUDE_CPDF_PATH_H_
8 #define CORE_FPDFAPI_FPDF_PAGE_INCLUDE_CPDF_PATH_H_ 8 #define CORE_FPDFAPI_FPDF_PAGE_INCLUDE_CPDF_PATH_H_
9 9
10 #include "core/fxcrt/include/cfx_count_ref.h" 10 #include "core/fxcrt/include/cfx_count_ref.h"
11 #include "core/fxcrt/include/fx_system.h" 11 #include "core/fxcrt/include/fx_system.h"
12 #include "core/fxge/include/cfx_fxgedevice.h" 12 #include "core/fxge/include/cfx_fxgedevice.h"
13 #include "core/fxge/include/cfx_pathdata.h" 13 #include "core/fxge/include/cfx_pathdata.h"
14 #include "core/fxge/include/cfx_renderdevice.h" 14 #include "core/fxge/include/cfx_renderdevice.h"
15 15
16 class CPDF_Path { 16 class CPDF_Path {
17 public: 17 public:
18 CPDF_Path(); 18 CPDF_Path();
19 CPDF_Path(const CPDF_Path& that); 19 CPDF_Path(const CPDF_Path& that);
20 ~CPDF_Path(); 20 ~CPDF_Path();
21 21
22 void Emplace() { m_Ref.Emplace(); } 22 void Emplace() { m_Ref.Emplace(); }
23 operator bool() const { return !!m_Ref; } 23 explicit operator bool() const { return !!m_Ref; }
24 24
25 int GetPointCount() const; 25 int GetPointCount() const;
26 void SetPointCount(int count); 26 void SetPointCount(int count);
27 const FX_PATHPOINT* GetPoints() const; 27 const FX_PATHPOINT* GetPoints() const;
28 FX_PATHPOINT* GetMutablePoints(); 28 FX_PATHPOINT* GetMutablePoints();
29 29
30 int GetFlag(int index) const; 30 int GetFlag(int index) const;
31 FX_FLOAT GetPointX(int index) const; 31 FX_FLOAT GetPointX(int index) const;
32 FX_FLOAT GetPointY(int index) const; 32 FX_FLOAT GetPointY(int index) const;
33 CFX_FloatRect GetBoundingBox() const; 33 CFX_FloatRect GetBoundingBox() const;
34 CFX_FloatRect GetBoundingBox(FX_FLOAT line_width, FX_FLOAT miter_limit) const; 34 CFX_FloatRect GetBoundingBox(FX_FLOAT line_width, FX_FLOAT miter_limit) const;
35 35
36 FX_BOOL IsRect() const; 36 FX_BOOL IsRect() const;
37 void Transform(const CFX_Matrix* pMatrix); 37 void Transform(const CFX_Matrix* pMatrix);
38 38
39 void Append(const CPDF_Path& other, const CFX_Matrix* pMatrix); 39 void Append(const CPDF_Path& other, const CFX_Matrix* pMatrix);
40 void Append(const CFX_PathData* pData, const CFX_Matrix* pMatrix); 40 void Append(const CFX_PathData* pData, const CFX_Matrix* pMatrix);
41 void AppendRect(FX_FLOAT left, FX_FLOAT bottom, FX_FLOAT right, FX_FLOAT top); 41 void AppendRect(FX_FLOAT left, FX_FLOAT bottom, FX_FLOAT right, FX_FLOAT top);
42 42
43 // TODO(tsepez): Remove when all access thru this class. 43 // TODO(tsepez): Remove when all access thru this class.
44 const CFX_PathData* GetObject() const { return m_Ref.GetObject(); } 44 const CFX_PathData* GetObject() const { return m_Ref.GetObject(); }
45 45
46 private: 46 private:
47 CFX_CountRef<CFX_PathData> m_Ref; 47 CFX_CountRef<CFX_PathData> m_Ref;
48 }; 48 };
49 49
50 #endif // CORE_FPDFAPI_FPDF_PAGE_INCLUDE_CPDF_PATH_H_ 50 #endif // CORE_FPDFAPI_FPDF_PAGE_INCLUDE_CPDF_PATH_H_
OLDNEW
« no previous file with comments | « core/fpdfapi/fpdf_page/include/cpdf_generalstate.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698