blob: c91772d41ce28183660731ba662c05e77bae7e98 [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
Nico Weber9d8ec5a2015-08-04 13:00:21 -07009void CRenderContext::Clear() {
10 m_pDevice = NULL;
11 m_pContext = NULL;
12 m_pRenderer = NULL;
13 m_pAnnots = NULL;
14 m_pOptions = NULL;
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -070015#ifdef _WIN32_WCE
Nico Weber9d8ec5a2015-08-04 13:00:21 -070016 m_pBitmap = NULL;
17 m_hBitmap = NULL;
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -070018#endif
19}
20
Nico Weber9d8ec5a2015-08-04 13:00:21 -070021CRenderContext::~CRenderContext() {
22 delete m_pRenderer;
23 delete m_pContext;
24 delete m_pDevice;
25 delete m_pAnnots;
26 delete m_pOptions->m_pOCContext;
27 delete m_pOptions;
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -070028#ifdef _WIN32_WCE
Nico Weber9d8ec5a2015-08-04 13:00:21 -070029 delete m_pBitmap;
30 if (m_hBitmap)
31 DeleteObject(m_hBitmap);
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -070032#endif
33}
34
Nico Weber9d8ec5a2015-08-04 13:00:21 -070035IFSDK_PAUSE_Adapter::IFSDK_PAUSE_Adapter(IFSDK_PAUSE* IPause) {
36 m_IPause = IPause;
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -070037}
38
Dan Sinclairf766ad22016-03-14 13:51:24 -040039IFSDK_PAUSE_Adapter::~IFSDK_PAUSE_Adapter() {}
Lei Zhang2b1a2d52015-08-14 22:16:22 -070040
Nico Weber9d8ec5a2015-08-04 13:00:21 -070041FX_BOOL IFSDK_PAUSE_Adapter::NeedToPauseNow() {
42 if (m_IPause->NeedToPauseNow) {
43 return m_IPause->NeedToPauseNow(m_IPause);
44 }
45 return FALSE;
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -070046}