summaryrefslogtreecommitdiff
path: root/fpdfsdk/fpdfview.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-10-05 11:14:12 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-10-05 17:22:58 +0000
commit921fe6bfde3b4cf3da4b55fab77103af3a65cab4 (patch)
tree2587bf5ab7c8d72a085137c9986235c0c1514b2c /fpdfsdk/fpdfview.cpp
parent023d645733cddcf026897c51f3d4c34090eb4b2d (diff)
downloadpdfium-921fe6bfde3b4cf3da4b55fab77103af3a65cab4.tar.xz
Move CPDF_RenderOptions members to private
This CL moves the members of CPDF_RenderOptions to be private members and adds accessor methods as needed. Change-Id: Ie91665ff53ae00cc4c53741d089d375503fabe11 Reviewed-on: https://pdfium-review.googlesource.com/15531 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'fpdfsdk/fpdfview.cpp')
-rw-r--r--fpdfsdk/fpdfview.cpp34
1 files changed, 21 insertions, 13 deletions
diff --git a/fpdfsdk/fpdfview.cpp b/fpdfsdk/fpdfview.cpp
index 40851176e2..af1d0db1af 100644
--- a/fpdfsdk/fpdfview.cpp
+++ b/fpdfsdk/fpdfview.cpp
@@ -80,34 +80,36 @@ void RenderPageImpl(CPDF_PageRenderContext* pContext,
if (!pContext->m_pOptions)
pContext->m_pOptions = pdfium::MakeUnique<CPDF_RenderOptions>();
+ uint32_t option_flags = pContext->m_pOptions->GetFlags();
if (flags & FPDF_LCD_TEXT)
- pContext->m_pOptions->m_Flags |= RENDER_CLEARTYPE;
+ option_flags |= RENDER_CLEARTYPE;
else
- pContext->m_pOptions->m_Flags &= ~RENDER_CLEARTYPE;
+ option_flags &= ~RENDER_CLEARTYPE;
if (flags & FPDF_NO_NATIVETEXT)
- pContext->m_pOptions->m_Flags |= RENDER_NO_NATIVETEXT;
+ option_flags |= RENDER_NO_NATIVETEXT;
if (flags & FPDF_RENDER_LIMITEDIMAGECACHE)
- pContext->m_pOptions->m_Flags |= RENDER_LIMITEDIMAGECACHE;
+ option_flags |= RENDER_LIMITEDIMAGECACHE;
if (flags & FPDF_RENDER_FORCEHALFTONE)
- pContext->m_pOptions->m_Flags |= RENDER_FORCE_HALFTONE;
+ option_flags |= RENDER_FORCE_HALFTONE;
#ifndef PDF_ENABLE_XFA
if (flags & FPDF_RENDER_NO_SMOOTHTEXT)
- pContext->m_pOptions->m_Flags |= RENDER_NOTEXTSMOOTH;
+ option_flags |= RENDER_NOTEXTSMOOTH;
if (flags & FPDF_RENDER_NO_SMOOTHIMAGE)
- pContext->m_pOptions->m_Flags |= RENDER_NOIMAGESMOOTH;
+ option_flags |= RENDER_NOIMAGESMOOTH;
if (flags & FPDF_RENDER_NO_SMOOTHPATH)
- pContext->m_pOptions->m_Flags |= RENDER_NOPATHSMOOTH;
+ option_flags |= RENDER_NOPATHSMOOTH;
#endif // PDF_ENABLE_XFA
+ pContext->m_pOptions->SetFlags(option_flags);
// Grayscale output
if (flags & FPDF_GRAYSCALE)
- pContext->m_pOptions->m_ColorMode = CPDF_RenderOptions::kGray;
+ pContext->m_pOptions->SetColorMode(CPDF_RenderOptions::kGray);
const CPDF_OCContext::UsageType usage =
(flags & FPDF_PRINTING) ? CPDF_OCContext::Print : CPDF_OCContext::View;
- pContext->m_pOptions->m_pOCContext =
- pdfium::MakeRetain<CPDF_OCContext>(pPage->m_pDocument.Get(), usage);
+ pContext->m_pOptions->SetOCContext(
+ pdfium::MakeRetain<CPDF_OCContext>(pPage->m_pDocument.Get(), usage));
pContext->m_pDevice->SaveState();
pContext->m_pDevice->SetClip_Rect(clipping_rect);
@@ -881,7 +883,9 @@ FPDF_EXPORT void FPDF_CALLCONV FPDF_RenderPage(HDC dc,
pDevice->Attach(pBitmap, false, nullptr, false);
if (bHasMask) {
pContext->m_pOptions = pdfium::MakeUnique<CPDF_RenderOptions>();
- pContext->m_pOptions->m_Flags |= RENDER_BREAKFORMASKS;
+ uint32_t option_flags = pContext->m_pOptions->GetFlags();
+ option_flags |= RENDER_BREAKFORMASKS;
+ pContext->m_pOptions->SetFlags(option_flags);
}
} else {
pContext->m_pDevice = pdfium::MakeUnique<CFX_WindowsRenderDevice>(dc);
@@ -913,7 +917,11 @@ FPDF_EXPORT void FPDF_CALLCONV FPDF_RenderPage(HDC dc,
pContext = pPage->GetRenderContext();
pContext->m_pDevice = pdfium::MakeUnique<CFX_WindowsRenderDevice>(dc);
pContext->m_pOptions = pdfium::MakeUnique<CPDF_RenderOptions>();
- pContext->m_pOptions->m_Flags |= RENDER_BREAKFORMASKS;
+
+ uint32_t option_flags = pContext->m_pOptions->GetFlags();
+ option_flags |= RENDER_BREAKFORMASKS;
+ pContext->m_pOptions->SetFlags(option_flags);
+
FPDF_RenderPage_Retail(pContext, page, start_x, start_y, size_x, size_y,
rotate, flags, true, nullptr);