| 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 "core/fxcrt/include/fx_ext.h" | 7 #include "core/fxcrt/include/fx_ext.h" |
| 8 | 8 |
| 9 #ifndef _SKIA_SUPPORT_ | 9 #ifndef _SKIA_SUPPORT_ |
| 10 #include "core/fxge/agg/fx_agg_driver.h" | 10 #include "core/fxge/agg/fx_agg_driver.h" |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 CFX_QuartzDeviceDriver::~CFX_QuartzDeviceDriver() { | 183 CFX_QuartzDeviceDriver::~CFX_QuartzDeviceDriver() { |
| 184 CGContextRestoreGState(m_context); | 184 CGContextRestoreGState(m_context); |
| 185 m_saveCount--; | 185 m_saveCount--; |
| 186 for (int i = 0; i < m_saveCount; ++i) { | 186 for (int i = 0; i < m_saveCount; ++i) { |
| 187 CGContextRestoreGState(m_context); | 187 CGContextRestoreGState(m_context); |
| 188 } | 188 } |
| 189 if (m_context) { | 189 if (m_context) { |
| 190 CGContextRelease(m_context); | 190 CGContextRelease(m_context); |
| 191 } | 191 } |
| 192 } | 192 } |
| 193 int CFX_QuartzDeviceDriver::GetDeviceCaps(int capsID) { | 193 int CFX_QuartzDeviceDriver::GetDeviceCaps(int capsID) const { |
| 194 switch (capsID) { | 194 switch (capsID) { |
| 195 case FXDC_DEVICE_CLASS: { | 195 case FXDC_DEVICE_CLASS: |
| 196 return m_deviceClass; | 196 return m_deviceClass; |
| 197 } | 197 case FXDC_PIXEL_WIDTH: |
| 198 case FXDC_PIXEL_WIDTH: { | |
| 199 return m_width; | 198 return m_width; |
| 200 } | 199 case FXDC_PIXEL_HEIGHT: |
| 201 case FXDC_PIXEL_HEIGHT: { | |
| 202 return m_height; | 200 return m_height; |
| 203 } | 201 case FXDC_BITS_PIXEL: |
| 204 case FXDC_BITS_PIXEL: { | |
| 205 return 32; | 202 return 32; |
| 206 } | 203 case FXDC_RENDER_CAPS: |
| 207 case FXDC_RENDER_CAPS: { | |
| 208 return m_renderCaps; | 204 return m_renderCaps; |
| 209 } | 205 default: |
| 210 default: { return 0; } | 206 return 0; |
| 211 } | 207 } |
| 212 } | 208 } |
| 213 CFX_Matrix CFX_QuartzDeviceDriver::GetCTM() const { | 209 CFX_Matrix CFX_QuartzDeviceDriver::GetCTM() const { |
| 214 CGAffineTransform ctm = CGContextGetCTM(m_context); | 210 CGAffineTransform ctm = CGContextGetCTM(m_context); |
| 215 return CFX_Matrix(ctm.a, ctm.b, ctm.c, ctm.d, ctm.tx, ctm.ty); | 211 return CFX_Matrix(ctm.a, ctm.b, ctm.c, ctm.d, ctm.tx, ctm.ty); |
| 216 } | 212 } |
| 217 void CFX_QuartzDeviceDriver::SaveState() { | 213 void CFX_QuartzDeviceDriver::SaveState() { |
| 218 CGContextSaveGState(m_context); | 214 CGContextSaveGState(m_context); |
| 219 m_saveCount++; | 215 m_saveCount++; |
| 220 } | 216 } |
| (...skipping 825 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1046 } | 1042 } |
| 1047 CFX_DIBitmap* pBitmap = new CFX_DIBitmap; | 1043 CFX_DIBitmap* pBitmap = new CFX_DIBitmap; |
| 1048 if (!pBitmap->Create(width, height, format)) { | 1044 if (!pBitmap->Create(width, height, format)) { |
| 1049 delete pBitmap; | 1045 delete pBitmap; |
| 1050 return FALSE; | 1046 return FALSE; |
| 1051 } | 1047 } |
| 1052 m_bOwnedBitmap = TRUE; | 1048 m_bOwnedBitmap = TRUE; |
| 1053 return Attach(pBitmap); | 1049 return Attach(pBitmap); |
| 1054 } | 1050 } |
| 1055 #endif // _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ | 1051 #endif // _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ |
| OLD | NEW |