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

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

Issue 2323203002: Define behaviors of FPDF_RenderPageBitmap_Retail and FPDF_FFLDraw. (Closed)
Patch Set: Created 4 years, 3 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
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"
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after
315 } 315 }
316 CPDF_RenderContext context(pPage); 316 CPDF_RenderContext context(pPage);
317 context.AppendLayer(pForm, &matrix); 317 context.AppendLayer(pForm, &matrix);
318 context.Render(pDevice, pOptions, nullptr); 318 context.Render(pDevice, pOptions, nullptr);
319 return TRUE; 319 return TRUE;
320 } 320 }
321 FX_BOOL CPDF_Annot::DrawInContext(const CPDF_Page* pPage, 321 FX_BOOL CPDF_Annot::DrawInContext(const CPDF_Page* pPage,
322 CPDF_RenderContext* pContext, 322 CPDF_RenderContext* pContext,
323 const CFX_Matrix* pUser2Device, 323 const CFX_Matrix* pUser2Device,
324 AppearanceMode mode) { 324 AppearanceMode mode) {
325 if (IsAnnotationHidden(m_pAnnotDict))
Lei Zhang 2016/09/09 07:09:01 The newly added code is the same as the code in Dr
jaepark 2016/09/09 18:44:32 Done.
326 return FALSE;
327
328 if (m_nSubtype == CPDF_Annot::Subtype::POPUP && !m_bOpenState)
329 return FALSE;
330
331 // It might happen that by the time this annotation instance was created,
332 // it was flagged as "hidden" (e.g. /F 2), and hence CPVT_GenerateAP decided
333 // to not "generate" its AP.
334 // If for a reason the object is no longer hidden, but still does not have
335 // its "AP" generated, generate it now.
336 GenerateAPIfNeeded();
337
325 CFX_Matrix matrix; 338 CFX_Matrix matrix;
326 CPDF_Form* pForm = 339 CPDF_Form* pForm =
327 FPDFDOC_Annot_GetMatrix(pPage, this, mode, pUser2Device, matrix); 340 FPDFDOC_Annot_GetMatrix(pPage, this, mode, pUser2Device, matrix);
328 if (!pForm) { 341 if (!pForm) {
329 return FALSE; 342 return FALSE;
330 } 343 }
331 pContext->AppendLayer(pForm, &matrix); 344 pContext->AppendLayer(pForm, &matrix);
332 return TRUE; 345 return TRUE;
333 } 346 }
334 void CPDF_Annot::DrawBorder(CFX_RenderDevice* pDevice, 347 void CPDF_Annot::DrawBorder(CFX_RenderDevice* pDevice,
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
423 CFX_PathData path; 436 CFX_PathData path;
424 width /= 2; 437 width /= 2;
425 path.AppendRect(rect.left + width, rect.bottom + width, rect.right - width, 438 path.AppendRect(rect.left + width, rect.bottom + width, rect.right - width,
426 rect.top - width); 439 rect.top - width);
427 int fill_type = 0; 440 int fill_type = 0;
428 if (pOptions && (pOptions->m_Flags & RENDER_NOPATHSMOOTH)) { 441 if (pOptions && (pOptions->m_Flags & RENDER_NOPATHSMOOTH)) {
429 fill_type |= FXFILL_NOPATHSMOOTH; 442 fill_type |= FXFILL_NOPATHSMOOTH;
430 } 443 }
431 pDevice->DrawPath(&path, pUser2Device, &graph_state, argb, argb, fill_type); 444 pDevice->DrawPath(&path, pUser2Device, &graph_state, argb, argb, fill_type);
432 } 445 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698