John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 1 | // 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 Zhang | a6d9f0e | 2015-06-13 00:48:38 -0700 | [diff] [blame] | 4 | |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 5 | // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
| 6 | |
Lei Zhang | bde53d2 | 2015-11-12 22:21:30 -0800 | [diff] [blame] | 7 | #include "fpdfsdk/include/fsdk_rendercontext.h" |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 8 | |
Dan Sinclair | aa403d3 | 2016-03-15 14:57:22 -0400 | [diff] [blame] | 9 | #include "core/fpdfapi/fpdf_render/include/cpdf_renderoptions.h" |
thestig | 25fa42f | 2016-05-25 21:39:46 -0700 | [diff] [blame] | 10 | #include "core/fxge/include/fx_ge.h" |
Dan Sinclair | aa403d3 | 2016-03-15 14:57:22 -0400 | [diff] [blame] | 11 | |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 12 | void 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-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 18 | } |
| 19 | |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 20 | CRenderContext::~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-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 27 | } |
| 28 | |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 29 | IFSDK_PAUSE_Adapter::IFSDK_PAUSE_Adapter(IFSDK_PAUSE* IPause) { |
| 30 | m_IPause = IPause; |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 31 | } |
| 32 | |
Dan Sinclair | f766ad2 | 2016-03-14 13:51:24 -0400 | [diff] [blame] | 33 | IFSDK_PAUSE_Adapter::~IFSDK_PAUSE_Adapter() {} |
Lei Zhang | 2b1a2d5 | 2015-08-14 22:16:22 -0700 | [diff] [blame] | 34 | |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 35 | FX_BOOL IFSDK_PAUSE_Adapter::NeedToPauseNow() { |
thestig | 3bd3841 | 2016-05-26 16:33:01 -0700 | [diff] [blame^] | 36 | return m_IPause->NeedToPauseNow && m_IPause->NeedToPauseNow(m_IPause); |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 37 | } |