blob: e282d01db7bf516bdbfcd712b6fc8d2efac93738 [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
7#include "../include/fsdk_rendercontext.h"
8
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
Lei Zhang2b1a2d52015-08-14 22:16:22 -070039IFSDK_PAUSE_Adapter::~IFSDK_PAUSE_Adapter() {
40}
41
Nico Weber9d8ec5a2015-08-04 13:00:21 -070042FX_BOOL IFSDK_PAUSE_Adapter::NeedToPauseNow() {
43 if (m_IPause->NeedToPauseNow) {
44 return m_IPause->NeedToPauseNow(m_IPause);
45 }
46 return FALSE;
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -070047}