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

Unified Diff: fpdfsdk/src/fsdk_mgr.cpp

Issue 1417983006: XFA: Simplify CPDFSDK_PageView::PageView_OnDraw(). (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: rebase Created 5 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « fpdfsdk/src/fpdfformfill.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/src/fsdk_mgr.cpp
diff --git a/fpdfsdk/src/fsdk_mgr.cpp b/fpdfsdk/src/fsdk_mgr.cpp
index f12e8fb59565013df6f2ad1752413002d3242ccb..1b09714dfafd1c62b1ad684df0b98d2b3ee119cf 100644
--- a/fpdfsdk/src/fsdk_mgr.cpp
+++ b/fpdfsdk/src/fsdk_mgr.cpp
@@ -654,7 +654,7 @@ CPDFSDK_PageView::~CPDFSDK_PageView() {
void CPDFSDK_PageView::PageView_OnDraw(CFX_RenderDevice* pDevice,
CPDF_Matrix* pUser2Device,
CPDF_RenderOptions* pOptions,
- FX_RECT* pClip) {
+ const FX_RECT& pClip) {
m_curMatrix = *pUser2Device;
CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv();
CPDFXFA_Page* pPage = GetPDFXFAPage();
@@ -666,14 +666,12 @@ void CPDFSDK_PageView::PageView_OnDraw(CFX_RenderDevice* pDevice,
if (pPage->GetDocument()->GetDocType() == DOCTYPE_DYNIMIC_XFA) {
CFX_Graphics gs;
gs.Create(pDevice);
- if (pClip) {
- CFX_RectF rectClip;
- rectClip.Set(static_cast<FX_FLOAT>(pClip->left),
- static_cast<FX_FLOAT>(pClip->top),
- static_cast<FX_FLOAT>(pClip->Width()),
- static_cast<FX_FLOAT>(pClip->Height()));
- gs.SetClipRect(rectClip);
- }
+ CFX_RectF rectClip;
+ rectClip.Set(static_cast<FX_FLOAT>(pClip.left),
+ static_cast<FX_FLOAT>(pClip.top),
+ static_cast<FX_FLOAT>(pClip.Width()),
+ static_cast<FX_FLOAT>(pClip.Height()));
+ gs.SetClipRect(rectClip);
IXFA_RenderContext* pRenderContext = XFA_RenderContext_Create();
if (!pRenderContext)
return;
« no previous file with comments | « fpdfsdk/src/fpdfformfill.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698