diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2017-05-04 14:08:01 -0400 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-05-04 18:34:17 +0000 |
commit | cf53b788ca1c097c0cbbca3dee048520eb9dabd4 (patch) | |
tree | 907214b67e73326c9c52648c20b97d31c80a993b /fpdfsdk/cpdfsdk_pageview.cpp | |
parent | c0aefd45c89a2980de8965f12bc80db408dfa78c (diff) | |
download | pdfium-cf53b788ca1c097c0cbbca3dee048520eb9dabd4.tar.xz |
Cleanup CXFA_RenderContext
Move StartRender into the constructor, remove StopRender as it will be
handled by the destructor. Remove RenderOptions as they are always set
the same way.
Change-Id: Iddbd6849199cbe255a5e1694164de5556a34f57c
Reviewed-on: https://pdfium-review.googlesource.com/4876
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'fpdfsdk/cpdfsdk_pageview.cpp')
-rw-r--r-- | fpdfsdk/cpdfsdk_pageview.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/fpdfsdk/cpdfsdk_pageview.cpp b/fpdfsdk/cpdfsdk_pageview.cpp index 946dd84163..2dd8e309cf 100644 --- a/fpdfsdk/cpdfsdk_pageview.cpp +++ b/fpdfsdk/cpdfsdk_pageview.cpp @@ -95,18 +95,17 @@ void CPDFSDK_PageView::PageView_OnDraw(CFX_RenderDevice* pDevice, return; if (pPage->GetContext()->GetDocType() == XFA_DocType::Dynamic) { - CFX_Graphics gs(pDevice); CFX_RectF rectClip( static_cast<float>(pClip.left), static_cast<float>(pClip.top), static_cast<float>(pClip.Width()), static_cast<float>(pClip.Height())); + + CFX_Graphics gs(pDevice); gs.SetClipRect(rectClip); - auto pRenderContext = pdfium::MakeUnique<CXFA_RenderContext>(); - CXFA_RenderOptions renderOptions; - renderOptions.m_bHighlight = true; + CXFA_FFPageView* xfaView = pPage->GetXFAPageView(); - pRenderContext->StartRender(xfaView, &gs, *pUser2Device, renderOptions); - pRenderContext->DoRender(); - pRenderContext->StopRender(); + CXFA_RenderContext renderContext(xfaView, rectClip, *pUser2Device); + renderContext.DoRender(&gs); + CXFA_FFDocView* docView = xfaView->GetDocView(); if (!docView) return; |