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

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

Issue 2281683002: Rework CFX_CountRef in terms of CFX_RetainPtr (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Add test that GetModify() may construct a duplicate 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/cpdf_contentmark.h ('k') | core/fxcrt/cfx_count_ref_unittest.cpp » ('j') | 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/fx_system.h" 10 #include "core/fxcrt/include/fx_system.h"
11 #include "core/fxge/include/cfx_fxgedevice.h" 11 #include "core/fxge/include/cfx_fxgedevice.h"
12 #include "core/fxge/include/cfx_pathdata.h" 12 #include "core/fxge/include/cfx_pathdata.h"
13 #include "core/fxge/include/cfx_renderdevice.h" 13 #include "core/fxge/include/cfx_renderdevice.h"
14 14
15 class CPDF_Path : public CFX_CountRef<CFX_PathData> { 15 class CPDF_Path : public CFX_CountRef<CFX_PathData> {
16 public: 16 public:
17 int GetPointCount() const { return m_pObject->GetPointCount(); } 17 int GetPointCount() const { return m_pObject->GetPointCount(); }
18 int GetFlag(int index) const { return m_pObject->GetFlag(index); } 18 int GetFlag(int index) const { return m_pObject->GetFlag(index); }
19 FX_FLOAT GetPointX(int index) const { return m_pObject->GetPointX(index); } 19 FX_FLOAT GetPointX(int index) const { return m_pObject->GetPointX(index); }
20 FX_FLOAT GetPointY(int index) const { return m_pObject->GetPointY(index); } 20 FX_FLOAT GetPointY(int index) const { return m_pObject->GetPointY(index); }
21 FX_PATHPOINT* GetPoints() const { return m_pObject->GetPoints(); } 21 FX_PATHPOINT* GetPoints() const { return m_pObject->GetPoints(); }
22 CFX_FloatRect GetBoundingBox() const { return m_pObject->GetBoundingBox(); } 22 CFX_FloatRect GetBoundingBox() const { return m_pObject->GetBoundingBox(); }
23 CFX_FloatRect GetBoundingBox(FX_FLOAT line_width, 23 CFX_FloatRect GetBoundingBox(FX_FLOAT line_width,
24 FX_FLOAT miter_limit) const { 24 FX_FLOAT miter_limit) const {
25 return m_pObject->GetBoundingBox(line_width, miter_limit); 25 return m_pObject->GetBoundingBox(line_width, miter_limit);
26 } 26 }
27 27
28 FX_BOOL IsRect() const { return m_pObject->IsRect(); } 28 FX_BOOL IsRect() const { return m_pObject->IsRect(); }
29 void Transform(const CFX_Matrix* pMatrix) { GetModify()->Transform(pMatrix); } 29 void Transform(const CFX_Matrix* pMatrix) { GetModify()->Transform(pMatrix); }
30 void Append(CPDF_Path src, const CFX_Matrix* pMatrix) { 30 void Append(const CPDF_Path& other, const CFX_Matrix* pMatrix) {
31 m_pObject->Append(src.m_pObject, pMatrix); 31 m_pObject->Append(other.GetObject(), pMatrix);
32 } 32 }
33 33
34 void AppendRect(FX_FLOAT left, 34 void AppendRect(FX_FLOAT left,
35 FX_FLOAT bottom, 35 FX_FLOAT bottom,
36 FX_FLOAT right, 36 FX_FLOAT right,
37 FX_FLOAT top) { 37 FX_FLOAT top) {
38 m_pObject->AppendRect(left, bottom, right, top); 38 m_pObject->AppendRect(left, bottom, right, top);
39 } 39 }
40 }; 40 };
41 41
42 #endif // CORE_FPDFAPI_FPDF_PAGE_INCLUDE_CPDF_PATH_H_ 42 #endif // CORE_FPDFAPI_FPDF_PAGE_INCLUDE_CPDF_PATH_H_
OLDNEW
« no previous file with comments | « core/fpdfapi/fpdf_page/cpdf_contentmark.h ('k') | core/fxcrt/cfx_count_ref_unittest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698