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

Side by Side Diff: core/fpdfdoc/doc_annot.cpp

Issue 1918113002: Clean up CPDF_Page. (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: more Created 4 years, 7 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/ipdf_rendermodule.h ('k') | core/fpdfdoc/doc_formcontrol.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 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 "core/fpdfapi/fpdf_page/include/cpdf_form.h" 7 #include "core/fpdfapi/fpdf_page/include/cpdf_form.h"
8 #include "core/fpdfapi/fpdf_page/include/cpdf_page.h" 8 #include "core/fpdfapi/fpdf_page/include/cpdf_page.h"
9 #include "core/fpdfapi/fpdf_parser/include/cpdf_array.h" 9 #include "core/fpdfapi/fpdf_parser/include/cpdf_array.h"
10 #include "core/fpdfapi/fpdf_parser/include/cpdf_document.h" 10 #include "core/fpdfapi/fpdf_parser/include/cpdf_document.h"
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 CPDF_Stream* pStream = FPDFDOC_GetAnnotAP(m_pAnnotDict, mode); 197 CPDF_Stream* pStream = FPDFDOC_GetAnnotAP(m_pAnnotDict, mode);
198 if (!pStream) 198 if (!pStream)
199 return nullptr; 199 return nullptr;
200 200
201 auto it = m_APMap.find(pStream); 201 auto it = m_APMap.find(pStream);
202 if (it != m_APMap.end()) 202 if (it != m_APMap.end())
203 return it->second; 203 return it->second;
204 204
205 CPDF_Form* pNewForm = 205 CPDF_Form* pNewForm =
206 new CPDF_Form(m_pList->GetDocument(), pPage->m_pResources, pStream); 206 new CPDF_Form(m_pList->GetDocument(), pPage->m_pResources, pStream);
207 pNewForm->ParseContent(nullptr, nullptr, nullptr, nullptr); 207 pNewForm->ParseContent(nullptr, nullptr, nullptr);
208 m_APMap[pStream] = pNewForm; 208 m_APMap[pStream] = pNewForm;
209 return pNewForm; 209 return pNewForm;
210 } 210 }
211 211
212 static CPDF_Form* FPDFDOC_Annot_GetMatrix(const CPDF_Page* pPage, 212 static CPDF_Form* FPDFDOC_Annot_GetMatrix(const CPDF_Page* pPage,
213 CPDF_Annot* pAnnot, 213 CPDF_Annot* pAnnot,
214 CPDF_Annot::AppearanceMode mode, 214 CPDF_Annot::AppearanceMode mode,
215 const CFX_Matrix* pUser2Device, 215 const CFX_Matrix* pUser2Device,
216 CFX_Matrix& matrix) { 216 CFX_Matrix& matrix) {
217 CPDF_Form* pForm = pAnnot->GetAPForm(pPage, mode); 217 CPDF_Form* pForm = pAnnot->GetAPForm(pPage, mode);
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
349 CFX_PathData path; 349 CFX_PathData path;
350 width /= 2; 350 width /= 2;
351 path.AppendRect(rect.left + width, rect.bottom + width, rect.right - width, 351 path.AppendRect(rect.left + width, rect.bottom + width, rect.right - width,
352 rect.top - width); 352 rect.top - width);
353 int fill_type = 0; 353 int fill_type = 0;
354 if (pOptions && (pOptions->m_Flags & RENDER_NOPATHSMOOTH)) { 354 if (pOptions && (pOptions->m_Flags & RENDER_NOPATHSMOOTH)) {
355 fill_type |= FXFILL_NOPATHSMOOTH; 355 fill_type |= FXFILL_NOPATHSMOOTH;
356 } 356 }
357 pDevice->DrawPath(&path, pUser2Device, &graph_state, argb, argb, fill_type); 357 pDevice->DrawPath(&path, pUser2Device, &graph_state, argb, argb, fill_type);
358 } 358 }
OLDNEW
« no previous file with comments | « core/fpdfapi/ipdf_rendermodule.h ('k') | core/fpdfdoc/doc_formcontrol.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698