blob: 9232d83edd3b9e110fc1df03ac593ccf0120f001 [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"
10
Nico Weber9d8ec5a2015-08-04 13:00:21 -070011void CRenderContext::Clear() {
12 m_pDevice = NULL;
13 m_pContext = NULL;
14 m_pRenderer = NULL;
15 m_pAnnots = NULL;
16 m_pOptions = NULL;
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -070017#ifdef _WIN32_WCE
Nico Weber9d8ec5a2015-08-04 13:00:21 -070018 m_pBitmap = NULL;
19 m_hBitmap = NULL;
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -070020#endif
21}
22
Nico Weber9d8ec5a2015-08-04 13:00:21 -070023CRenderContext::~CRenderContext() {
24 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
Nico Weber9d8ec5a2015-08-04 13:00:21 -070031 delete m_pBitmap;
32 if (m_hBitmap)
33 DeleteObject(m_hBitmap);
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -070034#endif
35}
36
Nico Weber9d8ec5a2015-08-04 13:00:21 -070037IFSDK_PAUSE_Adapter::IFSDK_PAUSE_Adapter(IFSDK_PAUSE* IPause) {
38 m_IPause = IPause;
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -070039}
40
Dan Sinclairf766ad22016-03-14 13:51:24 -040041IFSDK_PAUSE_Adapter::~IFSDK_PAUSE_Adapter() {}
Lei Zhang2b1a2d52015-08-14 22:16:22 -070042
Nico Weber9d8ec5a2015-08-04 13:00:21 -070043FX_BOOL IFSDK_PAUSE_Adapter::NeedToPauseNow() {
44 if (m_IPause->NeedToPauseNow) {
45 return m_IPause->NeedToPauseNow(m_IPause);
46 }
47 return FALSE;
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -070048}