blob: f96db9415032564604f42c737d93ed0c9280601a [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
9void CRenderContext::Clear()
10{
Tom Sepez2f2ffec2015-07-23 14:42:09 -070011 m_pDevice = NULL;
12 m_pContext = NULL;
13 m_pRenderer = NULL;
14 m_pAnnots = NULL;
15 m_pOptions = NULL;
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -070016#ifdef _WIN32_WCE
Tom Sepez2f2ffec2015-07-23 14:42:09 -070017 m_pBitmap = NULL;
18 m_hBitmap = NULL;
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -070019#endif
20}
21
22CRenderContext::~CRenderContext()
23{
Lei Zhang6d8b1c22015-06-19 17:26:17 -070024 delete m_pRenderer;
25 delete m_pContext;
26 delete m_pDevice;
27 delete m_pAnnots;
28 delete m_pOptions->m_pOCContext;
29 delete m_pOptions;
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -070030#ifdef _WIN32_WCE
Lei Zhang6d8b1c22015-06-19 17:26:17 -070031 delete m_pBitmap;
32 if (m_hBitmap) DeleteObject(m_hBitmap);
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -070033#endif
34}
35
36IFSDK_PAUSE_Adapter::IFSDK_PAUSE_Adapter(IFSDK_PAUSE* IPause )
37{
Tom Sepez2f2ffec2015-07-23 14:42:09 -070038 m_IPause = IPause;
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -070039}
40
41FX_BOOL IFSDK_PAUSE_Adapter::NeedToPauseNow()
42{
Tom Sepez2f2ffec2015-07-23 14:42:09 -070043 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}