OLD | NEW |
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/include/fpdfapi/fpdf_pageobj.h" | 7 #include "core/include/fpdfapi/fpdf_pageobj.h" |
8 #include "core/include/fpdfdoc/fpdf_doc.h" | 8 #include "core/include/fpdfdoc/fpdf_doc.h" |
9 | 9 |
10 CPDF_AnnotList::CPDF_AnnotList(CPDF_Page* pPage) | 10 CPDF_AnnotList::CPDF_AnnotList(CPDF_Page* pPage) |
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 const CFX_Matrix* pUser2Device, | 220 const CFX_Matrix* pUser2Device, |
221 AppearanceMode mode, | 221 AppearanceMode mode, |
222 const CPDF_RenderOptions* pOptions) { | 222 const CPDF_RenderOptions* pOptions) { |
223 CFX_Matrix matrix; | 223 CFX_Matrix matrix; |
224 CPDF_Form* pForm = | 224 CPDF_Form* pForm = |
225 FPDFDOC_Annot_GetMatrix(pPage, this, mode, pUser2Device, matrix); | 225 FPDFDOC_Annot_GetMatrix(pPage, this, mode, pUser2Device, matrix); |
226 if (!pForm) { | 226 if (!pForm) { |
227 return FALSE; | 227 return FALSE; |
228 } | 228 } |
229 CPDF_RenderContext context(pPage); | 229 CPDF_RenderContext context(pPage); |
230 context.DrawObjectList(pDevice, pForm, &matrix, pOptions); | 230 context.AppendLayer(pForm, &matrix); |
| 231 context.Render(pDevice, pOptions, nullptr); |
231 return TRUE; | 232 return TRUE; |
232 } | 233 } |
233 FX_BOOL CPDF_Annot::DrawInContext(const CPDF_Page* pPage, | 234 FX_BOOL CPDF_Annot::DrawInContext(const CPDF_Page* pPage, |
234 CPDF_RenderContext* pContext, | 235 CPDF_RenderContext* pContext, |
235 const CFX_Matrix* pUser2Device, | 236 const CFX_Matrix* pUser2Device, |
236 AppearanceMode mode) { | 237 AppearanceMode mode) { |
237 CFX_Matrix matrix; | 238 CFX_Matrix matrix; |
238 CPDF_Form* pForm = | 239 CPDF_Form* pForm = |
239 FPDFDOC_Annot_GetMatrix(pPage, this, mode, pUser2Device, matrix); | 240 FPDFDOC_Annot_GetMatrix(pPage, this, mode, pUser2Device, matrix); |
240 if (!pForm) { | 241 if (!pForm) { |
241 return FALSE; | 242 return FALSE; |
242 } | 243 } |
243 pContext->AppendObjectList(pForm, &matrix); | 244 pContext->AppendLayer(pForm, &matrix); |
244 return TRUE; | 245 return TRUE; |
245 } | 246 } |
246 void CPDF_Annot::DrawBorder(CFX_RenderDevice* pDevice, | 247 void CPDF_Annot::DrawBorder(CFX_RenderDevice* pDevice, |
247 const CFX_Matrix* pUser2Device, | 248 const CFX_Matrix* pUser2Device, |
248 const CPDF_RenderOptions* pOptions) { | 249 const CPDF_RenderOptions* pOptions) { |
249 if (GetSubType() == "Popup") { | 250 if (GetSubType() == "Popup") { |
250 return; | 251 return; |
251 } | 252 } |
252 FX_DWORD annot_flags = GetFlags(); | 253 FX_DWORD annot_flags = GetFlags(); |
253 if (annot_flags & ANNOTFLAG_HIDDEN) { | 254 if (annot_flags & ANNOTFLAG_HIDDEN) { |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
336 CPDF_PathData path; | 337 CPDF_PathData path; |
337 width /= 2; | 338 width /= 2; |
338 path.AppendRect(rect.left + width, rect.bottom + width, rect.right - width, | 339 path.AppendRect(rect.left + width, rect.bottom + width, rect.right - width, |
339 rect.top - width); | 340 rect.top - width); |
340 int fill_type = 0; | 341 int fill_type = 0; |
341 if (pOptions && (pOptions->m_Flags & RENDER_NOPATHSMOOTH)) { | 342 if (pOptions && (pOptions->m_Flags & RENDER_NOPATHSMOOTH)) { |
342 fill_type |= FXFILL_NOPATHSMOOTH; | 343 fill_type |= FXFILL_NOPATHSMOOTH; |
343 } | 344 } |
344 pDevice->DrawPath(&path, pUser2Device, &graph_state, argb, argb, fill_type); | 345 pDevice->DrawPath(&path, pUser2Device, &graph_state, argb, argb, fill_type); |
345 } | 346 } |
OLD | NEW |