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

Side by Side Diff: fpdfsdk/fpdf_transformpage.cpp

Issue 2301263003: Make CPDF_ClipPath have a CPDF_ClipPathData rather than inheriting (Closed)
Patch Set: safe bool while we're at it 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/fxcrt/include/cfx_count_ref.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 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 "public/fpdf_transformpage.h" 7 #include "public/fpdf_transformpage.h"
8 8
9 #include "core/fpdfapi/fpdf_page/include/cpdf_clippath.h" 9 #include "core/fpdfapi/fpdf_page/include/cpdf_clippath.h"
10 #include "core/fpdfapi/fpdf_page/include/cpdf_page.h" 10 #include "core/fpdfapi/fpdf_page/include/cpdf_page.h"
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 } 216 }
217 217
218 DLLEXPORT FPDF_CLIPPATH STDCALL FPDF_CreateClipPath(float left, 218 DLLEXPORT FPDF_CLIPPATH STDCALL FPDF_CreateClipPath(float left,
219 float bottom, 219 float bottom,
220 float right, 220 float right,
221 float top) { 221 float top) {
222 CPDF_Path Path; 222 CPDF_Path Path;
223 Path.AppendRect(left, bottom, right, top); 223 Path.AppendRect(left, bottom, right, top);
224 224
225 CPDF_ClipPath* pNewClipPath = new CPDF_ClipPath(); 225 CPDF_ClipPath* pNewClipPath = new CPDF_ClipPath();
226 pNewClipPath->GetPrivateCopy();
227 pNewClipPath->AppendPath(Path, FXFILL_ALTERNATE, FALSE); 226 pNewClipPath->AppendPath(Path, FXFILL_ALTERNATE, FALSE);
228 return pNewClipPath; 227 return pNewClipPath;
229 } 228 }
230 229
231 DLLEXPORT void STDCALL FPDF_DestroyClipPath(FPDF_CLIPPATH clipPath) { 230 DLLEXPORT void STDCALL FPDF_DestroyClipPath(FPDF_CLIPPATH clipPath) {
232 delete (CPDF_ClipPath*)clipPath; 231 delete (CPDF_ClipPath*)clipPath;
233 } 232 }
234 233
235 void OutputPath(CFX_ByteTextBuf& buf, CPDF_Path path) { 234 void OutputPath(CFX_ByteTextBuf& buf, CPDF_Path path) {
236 const CFX_PathData* pPathData = path.GetObject(); 235 const CFX_PathData* pPathData = path.GetObject();
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
326 } else if (pDirectObj->IsStream()) { 325 } else if (pDirectObj->IsStream()) {
327 pContentArray = new CPDF_Array(); 326 pContentArray = new CPDF_Array();
328 pContentArray->AddReference(pDoc, pStream->GetObjNum()); 327 pContentArray->AddReference(pDoc, pStream->GetObjNum());
329 pContentArray->AddReference(pDoc, pDirectObj->GetObjNum()); 328 pContentArray->AddReference(pDoc, pDirectObj->GetObjNum());
330 pPageDic->SetAtReference("Contents", pDoc, 329 pPageDic->SetAtReference("Contents", pDoc,
331 pDoc->AddIndirectObject(pContentArray)); 330 pDoc->AddIndirectObject(pContentArray));
332 } 331 }
333 } 332 }
334 } 333 }
335 } 334 }
OLDNEW
« no previous file with comments | « core/fxcrt/include/cfx_count_ref.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698