OLD | NEW |
1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
6 | 6 |
7 #include "../../../include/fxcrt/fx_ext.h" | 7 #include "../../../include/fxcrt/fx_ext.h" |
8 #include "../../../include/fxge/fx_freetype.h" | 8 #include "../../../include/fxge/fx_freetype.h" |
9 #include "../../../include/fxge/fx_ge.h" | 9 #include "../../../include/fxge/fx_ge.h" |
10 #include "../agg/include/fx_agg_driver.h" | 10 #include "../agg/include/fx_agg_driver.h" |
(...skipping 1064 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1075 CFX_QuartzDevice::CFX_QuartzDevice() | 1075 CFX_QuartzDevice::CFX_QuartzDevice() |
1076 { | 1076 { |
1077 m_bOwnedBitmap = FALSE; | 1077 m_bOwnedBitmap = FALSE; |
1078 m_pContext = NULL; | 1078 m_pContext = NULL; |
1079 } | 1079 } |
1080 CFX_QuartzDevice::~CFX_QuartzDevice() | 1080 CFX_QuartzDevice::~CFX_QuartzDevice() |
1081 { | 1081 { |
1082 if (m_pContext) { | 1082 if (m_pContext) { |
1083 CGContextRelease(m_pContext); | 1083 CGContextRelease(m_pContext); |
1084 } | 1084 } |
1085 if (GetBitmap() && m_bOwnedBitmap) { | 1085 if (m_bOwnedBitmap) { |
1086 delete GetBitmap(); | 1086 delete GetBitmap(); |
1087 } | 1087 } |
1088 } | 1088 } |
1089 CGContextRef CFX_QuartzDevice::GetContext() | 1089 CGContextRef CFX_QuartzDevice::GetContext() |
1090 { | 1090 { |
1091 return m_pContext; | 1091 return m_pContext; |
1092 } | 1092 } |
1093 FX_BOOL CFX_QuartzDevice::Attach(CGContextRef context, int32_t nDeviceClass) | 1093 FX_BOOL CFX_QuartzDevice::Attach(CGContextRef context, int32_t nDeviceClass) |
1094 { | 1094 { |
1095 if (m_pContext) { | 1095 if (m_pContext) { |
(...skipping 23 matching lines...) Expand all Loading... |
1119 } | 1119 } |
1120 CFX_DIBitmap* pBitmap = new CFX_DIBitmap; | 1120 CFX_DIBitmap* pBitmap = new CFX_DIBitmap; |
1121 if (!pBitmap->Create(width, height, format)) { | 1121 if (!pBitmap->Create(width, height, format)) { |
1122 delete pBitmap; | 1122 delete pBitmap; |
1123 return FALSE; | 1123 return FALSE; |
1124 } | 1124 } |
1125 m_bOwnedBitmap = TRUE; | 1125 m_bOwnedBitmap = TRUE; |
1126 return Attach(pBitmap); | 1126 return Attach(pBitmap); |
1127 } | 1127 } |
1128 #endif // _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ | 1128 #endif // _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ |
OLD | NEW |