blob: 3ba60778a7401ef4956c5045e50297a1cfac045a [file] [log] [blame]
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001// Copyright 2014 PDFium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
Lei Zhanga6d9f0e2015-06-13 00:48:38 -07004
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07005// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6
Lei Zhangbde53d22015-11-12 22:21:30 -08007#include "fpdfsdk/include/fsdk_rendercontext.h"
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07008
Dan Sinclairaa403d32016-03-15 14:57:22 -04009#include "core/fpdfapi/fpdf_render/include/cpdf_renderoptions.h"
thestig25fa42f2016-05-25 21:39:46 -070010#include "core/fxge/include/fx_ge.h"
Dan Sinclairaa403d32016-03-15 14:57:22 -040011
Nico Weber9d8ec5a2015-08-04 13:00:21 -070012void CRenderContext::Clear() {
13 m_pDevice = NULL;
14 m_pContext = NULL;
15 m_pRenderer = NULL;
16 m_pAnnots = NULL;
17 m_pOptions = NULL;
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -070018}
19
Nico Weber9d8ec5a2015-08-04 13:00:21 -070020CRenderContext::~CRenderContext() {
21 delete m_pRenderer;
22 delete m_pContext;
23 delete m_pDevice;
24 delete m_pAnnots;
25 delete m_pOptions->m_pOCContext;
26 delete m_pOptions;
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -070027}
28
Nico Weber9d8ec5a2015-08-04 13:00:21 -070029IFSDK_PAUSE_Adapter::IFSDK_PAUSE_Adapter(IFSDK_PAUSE* IPause) {
30 m_IPause = IPause;
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -070031}
32
Dan Sinclairf766ad22016-03-14 13:51:24 -040033IFSDK_PAUSE_Adapter::~IFSDK_PAUSE_Adapter() {}
Lei Zhang2b1a2d52015-08-14 22:16:22 -070034
Nico Weber9d8ec5a2015-08-04 13:00:21 -070035FX_BOOL IFSDK_PAUSE_Adapter::NeedToPauseNow() {
thestig3bd38412016-05-26 16:33:01 -070036 return m_IPause->NeedToPauseNow && m_IPause->NeedToPauseNow(m_IPause);
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -070037}