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/cpdf_annotlist.h" | 7 #include "core/fpdfdoc/cpdf_annotlist.h" |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 #include <utility> | 10 #include <utility> |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 m_AnnotList.push_back(std::move(pPopupAnnot)); | 99 m_AnnotList.push_back(std::move(pPopupAnnot)); |
100 } | 100 } |
101 } | 101 } |
102 | 102 |
103 CPDF_AnnotList::~CPDF_AnnotList() {} | 103 CPDF_AnnotList::~CPDF_AnnotList() {} |
104 | 104 |
105 void CPDF_AnnotList::DisplayPass(CPDF_Page* pPage, | 105 void CPDF_AnnotList::DisplayPass(CPDF_Page* pPage, |
106 CFX_RenderDevice* pDevice, | 106 CFX_RenderDevice* pDevice, |
107 CPDF_RenderContext* pContext, | 107 CPDF_RenderContext* pContext, |
108 bool bPrinting, | 108 bool bPrinting, |
109 CFX_Matrix* pMatrix, | 109 const CFX_Matrix* pMatrix, |
110 bool bWidgetPass, | 110 bool bWidgetPass, |
111 CPDF_RenderOptions* pOptions, | 111 CPDF_RenderOptions* pOptions, |
112 FX_RECT* clip_rect) { | 112 FX_RECT* clip_rect) { |
113 for (const auto& pAnnot : m_AnnotList) { | 113 for (const auto& pAnnot : m_AnnotList) { |
114 bool bWidget = pAnnot->GetSubtype() == CPDF_Annot::Subtype::WIDGET; | 114 bool bWidget = pAnnot->GetSubtype() == CPDF_Annot::Subtype::WIDGET; |
115 if ((bWidgetPass && !bWidget) || (!bWidgetPass && bWidget)) | 115 if ((bWidgetPass && !bWidget) || (!bWidgetPass && bWidget)) |
116 continue; | 116 continue; |
117 | 117 |
118 uint32_t annot_flags = pAnnot->GetFlags(); | 118 uint32_t annot_flags = pAnnot->GetFlags(); |
119 if (annot_flags & ANNOTFLAG_HIDDEN) | 119 if (annot_flags & ANNOTFLAG_HIDDEN) |
(...skipping 29 matching lines...) Expand all Loading... |
149 CPDF_Annot::Normal, pOptions)) { | 149 CPDF_Annot::Normal, pOptions)) { |
150 pAnnot->DrawBorder(pDevice, &matrix, pOptions); | 150 pAnnot->DrawBorder(pDevice, &matrix, pOptions); |
151 } | 151 } |
152 } | 152 } |
153 } | 153 } |
154 | 154 |
155 void CPDF_AnnotList::DisplayAnnots(CPDF_Page* pPage, | 155 void CPDF_AnnotList::DisplayAnnots(CPDF_Page* pPage, |
156 CFX_RenderDevice* pDevice, | 156 CFX_RenderDevice* pDevice, |
157 CPDF_RenderContext* pContext, | 157 CPDF_RenderContext* pContext, |
158 bool bPrinting, | 158 bool bPrinting, |
159 CFX_Matrix* pUser2Device, | 159 const CFX_Matrix* pUser2Device, |
160 uint32_t dwAnnotFlags, | 160 uint32_t dwAnnotFlags, |
161 CPDF_RenderOptions* pOptions, | 161 CPDF_RenderOptions* pOptions, |
162 FX_RECT* pClipRect) { | 162 FX_RECT* pClipRect) { |
163 if (dwAnnotFlags & ANNOTFLAG_INVISIBLE) { | 163 if (dwAnnotFlags & ANNOTFLAG_INVISIBLE) { |
164 DisplayPass(pPage, pDevice, pContext, bPrinting, pUser2Device, false, | 164 DisplayPass(pPage, pDevice, pContext, bPrinting, pUser2Device, false, |
165 pOptions, pClipRect); | 165 pOptions, pClipRect); |
166 } | 166 } |
167 if (dwAnnotFlags & ANNOTFLAG_HIDDEN) { | 167 if (dwAnnotFlags & ANNOTFLAG_HIDDEN) { |
168 DisplayPass(pPage, pDevice, pContext, bPrinting, pUser2Device, true, | 168 DisplayPass(pPage, pDevice, pContext, bPrinting, pUser2Device, true, |
169 pOptions, pClipRect); | 169 pOptions, pClipRect); |
170 } | 170 } |
171 } | 171 } |
172 | 172 |
173 void CPDF_AnnotList::DisplayAnnots(CPDF_Page* pPage, | 173 void CPDF_AnnotList::DisplayAnnots(CPDF_Page* pPage, |
174 CPDF_RenderContext* pContext, | 174 CPDF_RenderContext* pContext, |
175 bool bPrinting, | 175 bool bPrinting, |
176 CFX_Matrix* pMatrix, | 176 const CFX_Matrix* pMatrix, |
177 bool bShowWidget, | 177 bool bShowWidget, |
178 CPDF_RenderOptions* pOptions) { | 178 CPDF_RenderOptions* pOptions) { |
179 uint32_t dwAnnotFlags = bShowWidget ? ANNOTFLAG_INVISIBLE | ANNOTFLAG_HIDDEN | 179 uint32_t dwAnnotFlags = bShowWidget ? ANNOTFLAG_INVISIBLE | ANNOTFLAG_HIDDEN |
180 : ANNOTFLAG_INVISIBLE; | 180 : ANNOTFLAG_INVISIBLE; |
181 DisplayAnnots(pPage, nullptr, pContext, bPrinting, pMatrix, dwAnnotFlags, | 181 DisplayAnnots(pPage, nullptr, pContext, bPrinting, pMatrix, dwAnnotFlags, |
182 pOptions, nullptr); | 182 pOptions, nullptr); |
183 } | 183 } |
OLD | NEW |