OLD | NEW |
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_annotlist.h" | 7 #include "core/fpdfdoc/include/cpdf_annotlist.h" |
8 | 8 |
9 #include "core/fpdfapi/fpdf_page/include/cpdf_page.h" | 9 #include "core/fpdfapi/fpdf_page/include/cpdf_page.h" |
10 #include "core/fpdfapi/fpdf_parser/include/cpdf_document.h" | 10 #include "core/fpdfapi/fpdf_parser/include/cpdf_document.h" |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 if (pOCContext && pAnnotDict && | 81 if (pOCContext && pAnnotDict && |
82 !pOCContext->CheckOCGVisible(pAnnotDict->GetDictBy("OC"))) { | 82 !pOCContext->CheckOCGVisible(pAnnotDict->GetDictBy("OC"))) { |
83 continue; | 83 continue; |
84 } | 84 } |
85 } | 85 } |
86 CFX_FloatRect annot_rect_f; | 86 CFX_FloatRect annot_rect_f; |
87 pAnnot->GetRect(annot_rect_f); | 87 pAnnot->GetRect(annot_rect_f); |
88 CFX_Matrix matrix = *pMatrix; | 88 CFX_Matrix matrix = *pMatrix; |
89 if (clip_rect) { | 89 if (clip_rect) { |
90 annot_rect_f.Transform(&matrix); | 90 annot_rect_f.Transform(&matrix); |
91 FX_RECT annot_rect = annot_rect_f.GetOutterRect(); | 91 FX_RECT annot_rect = annot_rect_f.GetOuterRect(); |
92 annot_rect.Intersect(*clip_rect); | 92 annot_rect.Intersect(*clip_rect); |
93 if (annot_rect.IsEmpty()) { | 93 if (annot_rect.IsEmpty()) { |
94 continue; | 94 continue; |
95 } | 95 } |
96 } | 96 } |
97 if (pContext) { | 97 if (pContext) { |
98 pAnnot->DrawInContext(pPage, pContext, &matrix, CPDF_Annot::Normal); | 98 pAnnot->DrawInContext(pPage, pContext, &matrix, CPDF_Annot::Normal); |
99 } else if (!pAnnot->DrawAppearance(pPage, pDevice, &matrix, | 99 } else if (!pAnnot->DrawAppearance(pPage, pDevice, &matrix, |
100 CPDF_Annot::Normal, pOptions)) { | 100 CPDF_Annot::Normal, pOptions)) { |
101 pAnnot->DrawBorder(pDevice, &matrix, pOptions); | 101 pAnnot->DrawBorder(pDevice, &matrix, pOptions); |
(...skipping 23 matching lines...) Expand all Loading... |
125 CPDF_RenderContext* pContext, | 125 CPDF_RenderContext* pContext, |
126 FX_BOOL bPrinting, | 126 FX_BOOL bPrinting, |
127 CFX_Matrix* pMatrix, | 127 CFX_Matrix* pMatrix, |
128 FX_BOOL bShowWidget, | 128 FX_BOOL bShowWidget, |
129 CPDF_RenderOptions* pOptions) { | 129 CPDF_RenderOptions* pOptions) { |
130 uint32_t dwAnnotFlags = bShowWidget ? ANNOTFLAG_INVISIBLE | ANNOTFLAG_HIDDEN | 130 uint32_t dwAnnotFlags = bShowWidget ? ANNOTFLAG_INVISIBLE | ANNOTFLAG_HIDDEN |
131 : ANNOTFLAG_INVISIBLE; | 131 : ANNOTFLAG_INVISIBLE; |
132 DisplayAnnots(pPage, nullptr, pContext, bPrinting, pMatrix, dwAnnotFlags, | 132 DisplayAnnots(pPage, nullptr, pContext, bPrinting, pMatrix, dwAnnotFlags, |
133 pOptions, nullptr); | 133 pOptions, nullptr); |
134 } | 134 } |
OLD | NEW |