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

Side by Side Diff: fpdfsdk/fxedit/fxet_edit.cpp

Issue 2305103002: Make CPDF_Path have a CFX_Path rather than inheriting (Closed)
Patch Set: rebase 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 | « fpdfsdk/fpdf_transformpage.cpp ('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 2014 PDFium Authors. All rights reserved. 1 // Copyright 2014 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 #include "fpdfsdk/fxedit/include/fxet_edit.h" 7 #include "fpdfsdk/fxedit/include/fxet_edit.h"
8 8
9 #include <algorithm> 9 #include <algorithm>
10 10
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 nullptr, &ro); 130 nullptr, &ro);
131 } 131 }
132 } 132 }
133 } 133 }
134 } 134 }
135 135
136 void AddRectToPageObjects(CPDF_PageObjectHolder* pObjectHolder, 136 void AddRectToPageObjects(CPDF_PageObjectHolder* pObjectHolder,
137 FX_COLORREF crFill, 137 FX_COLORREF crFill,
138 const CFX_FloatRect& rcFill) { 138 const CFX_FloatRect& rcFill) {
139 std::unique_ptr<CPDF_PathObject> pPathObj(new CPDF_PathObject); 139 std::unique_ptr<CPDF_PathObject> pPathObj(new CPDF_PathObject);
140 CFX_PathData* pPathData = pPathObj->m_Path.GetPrivateCopy(); 140 pPathObj->m_Path.AppendRect(rcFill.left, rcFill.bottom, rcFill.right,
141 pPathData->AppendRect(rcFill.left, rcFill.bottom, rcFill.right, rcFill.top); 141 rcFill.top);
142 142
143 FX_FLOAT rgb[3]; 143 FX_FLOAT rgb[3];
144 rgb[0] = FXARGB_R(crFill) / 255.0f; 144 rgb[0] = FXARGB_R(crFill) / 255.0f;
145 rgb[1] = FXARGB_G(crFill) / 255.0f; 145 rgb[1] = FXARGB_G(crFill) / 255.0f;
146 rgb[2] = FXARGB_B(crFill) / 255.0f; 146 rgb[2] = FXARGB_B(crFill) / 255.0f;
147 pPathObj->m_ColorState.SetFillColor( 147 pPathObj->m_ColorState.SetFillColor(
148 CPDF_ColorSpace::GetStockCS(PDFCS_DEVICERGB), rgb, 3); 148 CPDF_ColorSpace::GetStockCS(PDFCS_DEVICERGB), rgb, 3);
149 149
150 pPathObj->m_FillType = FXFILL_ALTERNATE; 150 pPathObj->m_FillType = FXFILL_ALTERNATE;
151 pPathObj->m_bStroke = FALSE; 151 pPathObj->m_bStroke = FALSE;
(...skipping 2904 matching lines...) Expand 10 before | Expand all | Expand 10 after
3056 int32_t CFX_Edit_RectArray::GetSize() const { 3056 int32_t CFX_Edit_RectArray::GetSize() const {
3057 return m_Rects.GetSize(); 3057 return m_Rects.GetSize();
3058 } 3058 }
3059 3059
3060 CFX_FloatRect* CFX_Edit_RectArray::GetAt(int32_t nIndex) const { 3060 CFX_FloatRect* CFX_Edit_RectArray::GetAt(int32_t nIndex) const {
3061 if (nIndex < 0 || nIndex >= m_Rects.GetSize()) 3061 if (nIndex < 0 || nIndex >= m_Rects.GetSize())
3062 return nullptr; 3062 return nullptr;
3063 3063
3064 return m_Rects.GetAt(nIndex); 3064 return m_Rects.GetAt(nIndex);
3065 } 3065 }
OLDNEW
« no previous file with comments | « fpdfsdk/fpdf_transformpage.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698