7#include "fpdfsdk/cpdfsdk_renderpage.h"
12#include "core/fpdfapi/page/cpdf_pageimagecache.h"
13#include "core/fpdfapi/render/cpdf_pagerendercontext.h"
14#include "core/fpdfapi/render/cpdf_progressiverenderer.h"
15#include "core/fpdfapi/render/cpdf_renderoptions.h"
16#include "core/fpdfdoc/cpdf_annotlist.h"
17#include "core/fxge/cfx_renderdevice.h"
18#include "fpdfsdk/cpdfsdk_helpers.h"
19#include "fpdfsdk/cpdfsdk_pauseadapter.h"
23void RenderPageImpl(CPDF_PageRenderContext* pContext,
28 const FPDF_COLORSCHEME* color_scheme,
30 CPDFSDK_PauseAdapter* pause) {
31 if (!pContext->m_pOptions)
34 auto& options = pContext->m_pOptions->GetOptions();
49 SetColorFromScheme(color_scheme, pContext->m_pOptions.get());
55 pContext->m_pOptions->SetOCContext(
58 pContext->m_pDevice->SaveState();
59 pContext->m_pDevice->SetBaseClip(clipping_rect);
60 pContext->m_pDevice->SetClip_Rect(clipping_rect);
65 pContext->m_pContext->AppendLayer(pPage, matrix);
68 auto pOwnedList =
std::make_unique<CPDF_AnnotList>(pPage);
69 CPDF_AnnotList* pList = pOwnedList.get();
70 pContext->m_pAnnots =
std::move(pOwnedList);
76 const bool bShowWidget =
false;
78 pContext->m_pContext.get()
, bPrinting
, matrix
,
83 pContext->m_pContext.get(), pContext->m_pDevice.get(),
84 pContext->m_pOptions.get());
85 pContext->m_pRenderer->Start(pause);
87 pContext->m_pDevice->RestoreState(
false);
97 const FPDF_COLORSCHEME* color_scheme) {
98 RenderPageImpl(pContext, pPage, matrix, clipping_rect, flags, color_scheme,
110 const FPDF_COLORSCHEME* color_scheme,
111 bool need_to_restore,
112 CPDFSDK_PauseAdapter* pause) {
113 const FX_RECT rect
(start_x
, start_y
, start_x + size_x
, start_y + size_y
);
115 flags, color_scheme, need_to_restore, pause);
void DisplayAnnots(CPDF_Page *pPage, CFX_RenderDevice *pDevice, CPDF_RenderContext *pContext, bool bPrinting, const CFX_Matrix &mtUser2Device, bool bShowWidget)
CPDF_Document * GetDocument() const override
CFX_Matrix GetDisplayMatrix(const FX_RECT &rect, int iRotate) const override
CPDF_PageImageCache * GetPageImageCache()
void CPDFSDK_RenderPageWithContext(CPDF_PageRenderContext *pContext, CPDF_Page *pPage, int start_x, int start_y, int size_x, int size_y, int rotate, int flags, const FPDF_COLORSCHEME *color_scheme, bool need_to_restore, CPDFSDK_PauseAdapter *pause)
void CPDFSDK_RenderPage(CPDF_PageRenderContext *pContext, CPDF_Page *pPage, const CFX_Matrix &matrix, const FX_RECT &clipping_rect, int flags, const FPDF_COLORSCHEME *color_scheme)
#define FPDF_RENDER_LIMITEDIMAGECACHE
#define FPDF_RENDER_NO_SMOOTHTEXT
#define FPDF_RENDER_NO_SMOOTHIMAGE
#define FPDF_CONVERT_FILL_TO_STROKE
#define FPDF_RENDER_FORCEHALFTONE
#define FPDF_NO_NATIVETEXT
#define FPDF_RENDER_NO_SMOOTHPATH
constexpr FX_RECT(int l, int t, int r, int b)