Chromium Code Reviews| 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 #ifndef CORE_FXGE_APPLE_APPLE_INT_H_ | 7 #ifndef CORE_FXGE_APPLE_APPLE_INT_H_ |
| 8 #define CORE_FXGE_APPLE_APPLE_INT_H_ | 8 #define CORE_FXGE_APPLE_APPLE_INT_H_ |
| 9 | 9 |
| 10 #include "core/fxcrt/fx_system.h" | 10 #include "core/fxcrt/fx_system.h" |
| 11 | 11 |
| 12 #if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ | 12 #if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ |
|
dsinclair
2016/11/07 14:25:03
nit: Can this be removed and done in the BUILD fil
npm
2016/11/07 16:02:38
Done.
| |
| 13 | 13 |
| 14 #include "core/fxge/cfx_graphstatedata.h" | 14 #include "core/fxge/cfx_graphstatedata.h" |
| 15 #include "core/fxge/cfx_pathdata.h" | 15 #include "core/fxge/cfx_pathdata.h" |
| 16 #include "core/fxge/cfx_renderdevice.h" | 16 #include "core/fxge/cfx_renderdevice.h" |
| 17 #include "core/fxge/fx_dib.h" | 17 #include "core/fxge/fx_dib.h" |
| 18 #include "core/fxge/ifx_renderdevicedriver.h" | 18 #include "core/fxge/ifx_renderdevicedriver.h" |
| 19 | 19 |
| 20 #if _FX_OS_ == _FX_MACOSX_ | 20 #if _FX_OS_ == _FX_MACOSX_ |
| 21 #include <Carbon/Carbon.h> | 21 #include <Carbon/Carbon.h> |
| 22 #endif | 22 #endif |
| (...skipping 18 matching lines...) Expand all Loading... | |
| 41 void restoreGraphicsState(void* graphics); | 41 void restoreGraphicsState(void* graphics); |
| 42 }; | 42 }; |
| 43 | 43 |
| 44 class CApplePlatform { | 44 class CApplePlatform { |
| 45 public: | 45 public: |
| 46 CApplePlatform() {} | 46 CApplePlatform() {} |
| 47 ~CApplePlatform() {} | 47 ~CApplePlatform() {} |
| 48 | 48 |
| 49 CQuartz2D m_quartz2d; | 49 CQuartz2D m_quartz2d; |
| 50 }; | 50 }; |
| 51 | |
| 52 class CFX_QuartzDeviceDriver : public IFX_RenderDeviceDriver { | |
| 53 public: | |
| 54 CFX_QuartzDeviceDriver(CGContextRef context, int32_t deviceClass); | |
| 55 ~CFX_QuartzDeviceDriver() override; | |
| 56 | |
| 57 // IFX_RenderDeviceDriver | |
| 58 int GetDeviceCaps(int caps_id) const override; | |
| 59 CFX_Matrix GetCTM() const override; | |
| 60 void SaveState() override; | |
| 61 void RestoreState(bool bKeepSaved) override; | |
| 62 bool SetClip_PathFill(const CFX_PathData* pPathData, | |
| 63 const CFX_Matrix* pObject2Device, | |
| 64 int fill_mode) override; | |
| 65 bool SetClip_PathStroke(const CFX_PathData* pPathData, | |
| 66 const CFX_Matrix* pObject2Device, | |
| 67 const CFX_GraphStateData* pGraphState) override; | |
| 68 bool DrawPath(const CFX_PathData* pPathData, | |
| 69 const CFX_Matrix* pObject2Device, | |
| 70 const CFX_GraphStateData* pGraphState, | |
| 71 uint32_t fill_color, | |
| 72 uint32_t stroke_color, | |
| 73 int fill_mode, | |
| 74 int blend_type) override; | |
| 75 bool FillRectWithBlend(const FX_RECT* pRect, | |
| 76 uint32_t fill_color, | |
| 77 int blend_type) override; | |
| 78 bool DrawCosmeticLine(FX_FLOAT x1, | |
| 79 FX_FLOAT y1, | |
| 80 FX_FLOAT x2, | |
| 81 FX_FLOAT y2, | |
| 82 uint32_t color, | |
| 83 int blend_type) override; | |
| 84 bool GetClipBox(FX_RECT* pRect) override; | |
| 85 bool GetDIBits(CFX_DIBitmap* pBitmap, int left, int top) override; | |
| 86 bool SetDIBits(const CFX_DIBSource* pBitmap, | |
| 87 uint32_t color, | |
| 88 const FX_RECT* pSrcRect, | |
| 89 int dest_left, | |
| 90 int dest_top, | |
| 91 int blend_type) override; | |
| 92 bool StretchDIBits(const CFX_DIBSource* pBitmap, | |
| 93 uint32_t color, | |
| 94 int dest_left, | |
| 95 int dest_top, | |
| 96 int dest_width, | |
| 97 int dest_height, | |
| 98 const FX_RECT* pClipRect, | |
| 99 uint32_t flags, | |
| 100 int blend_type) override; | |
| 101 bool StartDIBits(const CFX_DIBSource* pBitmap, | |
| 102 int bitmap_alpha, | |
| 103 uint32_t color, | |
| 104 const CFX_Matrix* pMatrix, | |
| 105 uint32_t flags, | |
| 106 void*& handle, | |
| 107 int blend_type) override; | |
| 108 bool DrawDeviceText(int nChars, | |
| 109 const FXTEXT_CHARPOS* pCharPos, | |
| 110 CFX_Font* pFont, | |
| 111 const CFX_Matrix* pObject2Device, | |
| 112 FX_FLOAT font_size, | |
| 113 uint32_t color) override; | |
| 114 void ClearDriver() override; | |
| 115 | |
| 116 protected: | |
| 117 void setStrokeInfo(const CFX_GraphStateData* graphState, | |
| 118 FX_ARGB argb, | |
| 119 FX_FLOAT lineWidth); | |
| 120 void setFillInfo(FX_ARGB argb); | |
| 121 void setPathToContext(const CFX_PathData* pathData); | |
| 122 FX_FLOAT getLineWidth(const CFX_GraphStateData* graphState, | |
| 123 CGAffineTransform ctm); | |
| 124 bool CG_DrawGlyphRun(int nChars, | |
| 125 const FXTEXT_CHARPOS* pCharPos, | |
| 126 CFX_Font* pFont, | |
| 127 const CFX_Matrix* pGlyphMatrix, | |
| 128 const CFX_Matrix* pObject2Device, | |
| 129 FX_FLOAT font_size, | |
| 130 uint32_t argb); | |
| 131 void CG_SetImageTransform(int dest_left, | |
| 132 int dest_top, | |
| 133 int dest_width, | |
| 134 int dest_height, | |
| 135 CGRect* rect); | |
| 136 | |
| 137 CGContextRef m_context; | |
| 138 CGAffineTransform m_foxitDevice2User; | |
| 139 CGAffineTransform m_user2FoxitDevice; | |
| 140 int32_t m_saveCount; | |
| 141 | |
| 142 int32_t m_width; | |
| 143 int32_t m_height; | |
| 144 int32_t m_bitsPerPixel; | |
| 145 int32_t m_deviceClass; | |
| 146 int32_t m_renderCaps; | |
| 147 int32_t m_horzSize; | |
| 148 int32_t m_vertSize; | |
| 149 }; | |
| 150 #endif // _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ | 51 #endif // _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ |
| 151 | 52 |
| 152 #endif // CORE_FXGE_APPLE_APPLE_INT_H_ | 53 #endif // CORE_FXGE_APPLE_APPLE_INT_H_ |
| OLD | NEW |