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

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

Issue 2206773004: Generate default AP stream for squiggly annotation. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Generate default AP stream for squiggly annotation. Created 4 years, 4 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 | « DEPS ('k') | core/fpdfdoc/cpvt_generateap.h » ('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 #include "core/fpdfdoc/include/cpdf_annot.h" 7 #include "core/fpdfdoc/include/cpdf_annot.h"
8 8
9 #include "core/fpdfapi/fpdf_page/include/cpdf_form.h" 9 #include "core/fpdfapi/fpdf_page/include/cpdf_form.h"
10 #include "core/fpdfapi/fpdf_page/include/cpdf_page.h" 10 #include "core/fpdfapi/fpdf_page/include/cpdf_page.h"
11 #include "core/fpdfapi/fpdf_parser/include/cpdf_array.h" 11 #include "core/fpdfapi/fpdf_parser/include/cpdf_array.h"
12 #include "core/fpdfapi/fpdf_parser/include/cpdf_document.h" 12 #include "core/fpdfapi/fpdf_parser/include/cpdf_document.h"
13 #include "core/fpdfapi/fpdf_render/include/cpdf_rendercontext.h" 13 #include "core/fpdfapi/fpdf_render/include/cpdf_rendercontext.h"
14 #include "core/fpdfapi/fpdf_render/include/cpdf_renderoptions.h" 14 #include "core/fpdfapi/fpdf_render/include/cpdf_renderoptions.h"
15 #include "core/fpdfdoc/cpvt_generateap.h" 15 #include "core/fpdfdoc/cpvt_generateap.h"
16 #include "core/fxcrt/include/fx_memory.h" 16 #include "core/fxcrt/include/fx_memory.h"
17 #include "core/fxge/include/fx_ge.h" 17 #include "core/fxge/include/fx_ge.h"
18 18
19 CPDF_Annot::CPDF_Annot(CPDF_Dictionary* pDict, CPDF_Document* pDocument) 19 CPDF_Annot::CPDF_Annot(CPDF_Dictionary* pDict, CPDF_Document* pDocument)
20 : m_pAnnotDict(pDict), 20 : m_pAnnotDict(pDict),
21 m_pDocument(pDocument), 21 m_pDocument(pDocument),
22 m_sSubtype(m_pAnnotDict->GetStringBy("Subtype")) { 22 m_sSubtype(m_pAnnotDict->GetStringBy("Subtype")) {
23 if (m_sSubtype == "Highlight") 23 if (m_sSubtype == "Highlight")
24 CPVT_GenerateAP::GenerateHighlightAP(m_pDocument, m_pAnnotDict); 24 CPVT_GenerateAP::GenerateHighlightAP(m_pDocument, m_pAnnotDict);
25 else if (m_sSubtype == "Squiggly")
26 CPVT_GenerateAP::GenerateSquigglyAP(m_pDocument, m_pAnnotDict);
25 else if (m_sSubtype == "StrikeOut") 27 else if (m_sSubtype == "StrikeOut")
26 CPVT_GenerateAP::GenerateStrikeOutAP(m_pDocument, m_pAnnotDict); 28 CPVT_GenerateAP::GenerateStrikeOutAP(m_pDocument, m_pAnnotDict);
27 else if (m_sSubtype == "Underline") 29 else if (m_sSubtype == "Underline")
28 CPVT_GenerateAP::GenerateUnderlineAP(m_pDocument, m_pAnnotDict); 30 CPVT_GenerateAP::GenerateUnderlineAP(m_pDocument, m_pAnnotDict);
29 } 31 }
30 32
31 CPDF_Annot::~CPDF_Annot() { 33 CPDF_Annot::~CPDF_Annot() {
32 ClearCachedAP(); 34 ClearCachedAP();
33 } 35 }
34 36
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 CFX_PathData path; 247 CFX_PathData path;
246 width /= 2; 248 width /= 2;
247 path.AppendRect(rect.left + width, rect.bottom + width, rect.right - width, 249 path.AppendRect(rect.left + width, rect.bottom + width, rect.right - width,
248 rect.top - width); 250 rect.top - width);
249 int fill_type = 0; 251 int fill_type = 0;
250 if (pOptions && (pOptions->m_Flags & RENDER_NOPATHSMOOTH)) { 252 if (pOptions && (pOptions->m_Flags & RENDER_NOPATHSMOOTH)) {
251 fill_type |= FXFILL_NOPATHSMOOTH; 253 fill_type |= FXFILL_NOPATHSMOOTH;
252 } 254 }
253 pDevice->DrawPath(&path, pUser2Device, &graph_state, argb, argb, fill_type); 255 pDevice->DrawPath(&path, pUser2Device, &graph_state, argb, argb, fill_type);
254 } 256 }
OLDNEW
« no previous file with comments | « DEPS ('k') | core/fpdfdoc/cpvt_generateap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698