| 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_WIN32_WIN32_INT_H_ | 7 #ifndef CORE_FXGE_WIN32_WIN32_INT_H_ |
| 8 #define CORE_FXGE_WIN32_WIN32_INT_H_ | 8 #define CORE_FXGE_WIN32_WIN32_INT_H_ |
| 9 | 9 |
| 10 #include "core/fxge/include/fx_ge.h" | 10 #include "core/fxge/include/fx_ge.h" |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 class CWin32Platform { | 101 class CWin32Platform { |
| 102 public: | 102 public: |
| 103 FX_BOOL m_bHalfTone; | 103 FX_BOOL m_bHalfTone; |
| 104 CGdiplusExt m_GdiplusExt; | 104 CGdiplusExt m_GdiplusExt; |
| 105 CDWriteExt m_DWriteExt; | 105 CDWriteExt m_DWriteExt; |
| 106 }; | 106 }; |
| 107 | 107 |
| 108 class CGdiDeviceDriver : public IFX_RenderDeviceDriver { | 108 class CGdiDeviceDriver : public IFX_RenderDeviceDriver { |
| 109 protected: | 109 protected: |
| 110 CGdiDeviceDriver(HDC hDC, int device_class); | 110 CGdiDeviceDriver(HDC hDC, int device_class); |
| 111 ~CGdiDeviceDriver() override {} | 111 ~CGdiDeviceDriver() override; |
| 112 | 112 |
| 113 // IFX_RenderDeviceDriver | 113 // IFX_RenderDeviceDriver |
| 114 int GetDeviceCaps(int caps_id) override; | 114 int GetDeviceCaps(int caps_id) override; |
| 115 void SaveState() override; | 115 void SaveState() override; |
| 116 void RestoreState(bool bKeepSaved) override; | 116 void RestoreState(bool bKeepSaved) override; |
| 117 FX_BOOL SetClip_PathFill(const CFX_PathData* pPathData, | 117 FX_BOOL SetClip_PathFill(const CFX_PathData* pPathData, |
| 118 const CFX_Matrix* pObject2Device, | 118 const CFX_Matrix* pObject2Device, |
| 119 int fill_mode) override; | 119 int fill_mode) override; |
| 120 FX_BOOL SetClip_PathStroke(const CFX_PathData* pPathData, | 120 FX_BOOL SetClip_PathStroke(const CFX_PathData* pPathData, |
| 121 const CFX_Matrix* pObject2Device, | 121 const CFX_Matrix* pObject2Device, |
| 122 const CFX_GraphStateData* pGraphState) override; | 122 const CFX_GraphStateData* pGraphState) override; |
| 123 FX_BOOL DrawPath(const CFX_PathData* pPathData, | 123 FX_BOOL DrawPath(const CFX_PathData* pPathData, |
| 124 const CFX_Matrix* pObject2Device, | 124 const CFX_Matrix* pObject2Device, |
| 125 const CFX_GraphStateData* pGraphState, | 125 const CFX_GraphStateData* pGraphState, |
| 126 uint32_t fill_color, | 126 uint32_t fill_color, |
| 127 uint32_t stroke_color, | 127 uint32_t stroke_color, |
| 128 int fill_mode, | 128 int fill_mode, |
| 129 int alpha_flag, | |
| 130 void* pIccTransform, | |
| 131 int blend_type) override; | 129 int blend_type) override; |
| 132 FX_BOOL FillRect(const FX_RECT* pRect, | 130 FX_BOOL FillRectWithBlend(const FX_RECT* pRect, |
| 133 uint32_t fill_color, | 131 uint32_t fill_color, |
| 134 int alpha_flag, | 132 int blend_type) override; |
| 135 void* pIccTransform, | |
| 136 int blend_type) override; | |
| 137 FX_BOOL DrawCosmeticLine(FX_FLOAT x1, | 133 FX_BOOL DrawCosmeticLine(FX_FLOAT x1, |
| 138 FX_FLOAT y1, | 134 FX_FLOAT y1, |
| 139 FX_FLOAT x2, | 135 FX_FLOAT x2, |
| 140 FX_FLOAT y2, | 136 FX_FLOAT y2, |
| 141 uint32_t color, | 137 uint32_t color, |
| 142 int alpha_flag, | |
| 143 void* pIccTransform, | |
| 144 int blend_type) override; | 138 int blend_type) override; |
| 145 FX_BOOL GetClipBox(FX_RECT* pRect) override; | 139 FX_BOOL GetClipBox(FX_RECT* pRect) override; |
| 146 void* GetPlatformSurface() const override { return (void*)m_hDC; } | 140 void* GetPlatformSurface() const override { return (void*)m_hDC; } |
| 147 | 141 |
| 148 virtual void* GetClipRgn(); | 142 virtual void* GetClipRgn(); |
| 149 virtual FX_BOOL SetClipRgn(void* pRgn); | 143 virtual FX_BOOL SetClipRgn(void* pRgn); |
| 150 virtual FX_BOOL DeleteDeviceRgn(void* pRgn); | 144 virtual FX_BOOL DeleteDeviceRgn(void* pRgn); |
| 151 virtual void DrawLine(FX_FLOAT x1, FX_FLOAT y1, FX_FLOAT x2, FX_FLOAT y2); | 145 virtual void DrawLine(FX_FLOAT x1, FX_FLOAT y1, FX_FLOAT x2, FX_FLOAT y2); |
| 152 | 146 |
| 153 FX_BOOL GDI_SetDIBits(CFX_DIBitmap* pBitmap, | 147 FX_BOOL GDI_SetDIBits(CFX_DIBitmap* pBitmap, |
| (...skipping 21 matching lines...) Expand all Loading... |
| 175 HDC m_hDC; | 169 HDC m_hDC; |
| 176 int m_Width; | 170 int m_Width; |
| 177 int m_Height; | 171 int m_Height; |
| 178 int m_nBitsPerPixel; | 172 int m_nBitsPerPixel; |
| 179 int m_DeviceClass; | 173 int m_DeviceClass; |
| 180 int m_RenderCaps; | 174 int m_RenderCaps; |
| 181 }; | 175 }; |
| 182 | 176 |
| 183 class CGdiDisplayDriver : public CGdiDeviceDriver { | 177 class CGdiDisplayDriver : public CGdiDeviceDriver { |
| 184 public: | 178 public: |
| 185 CGdiDisplayDriver(HDC hDC); | 179 explicit CGdiDisplayDriver(HDC hDC); |
| 180 ~CGdiDisplayDriver() override; |
| 186 | 181 |
| 187 protected: | 182 protected: |
| 188 FX_BOOL GetDIBits(CFX_DIBitmap* pBitmap, | 183 FX_BOOL GetDIBits(CFX_DIBitmap* pBitmap, int left, int top) override; |
| 189 int left, | |
| 190 int top, | |
| 191 void* pIccTransform = nullptr, | |
| 192 FX_BOOL bDEdge = FALSE) override; | |
| 193 FX_BOOL SetDIBits(const CFX_DIBSource* pBitmap, | 184 FX_BOOL SetDIBits(const CFX_DIBSource* pBitmap, |
| 194 uint32_t color, | 185 uint32_t color, |
| 195 const FX_RECT* pSrcRect, | 186 const FX_RECT* pSrcRect, |
| 196 int left, | 187 int left, |
| 197 int top, | 188 int top, |
| 198 int blend_type, | 189 int blend_type) override; |
| 199 int alpha_flag, | |
| 200 void* pIccTransform) override; | |
| 201 FX_BOOL StretchDIBits(const CFX_DIBSource* pBitmap, | 190 FX_BOOL StretchDIBits(const CFX_DIBSource* pBitmap, |
| 202 uint32_t color, | 191 uint32_t color, |
| 203 int dest_left, | 192 int dest_left, |
| 204 int dest_top, | 193 int dest_top, |
| 205 int dest_width, | 194 int dest_width, |
| 206 int dest_height, | 195 int dest_height, |
| 207 const FX_RECT* pClipRect, | 196 const FX_RECT* pClipRect, |
| 208 uint32_t flags, | 197 uint32_t flags, |
| 209 int alpha_flag, | |
| 210 void* pIccTransform, | |
| 211 int blend_type) override; | 198 int blend_type) override; |
| 212 FX_BOOL StartDIBits(const CFX_DIBSource* pBitmap, | 199 FX_BOOL StartDIBits(const CFX_DIBSource* pBitmap, |
| 213 int bitmap_alpha, | 200 int bitmap_alpha, |
| 214 uint32_t color, | 201 uint32_t color, |
| 215 const CFX_Matrix* pMatrix, | 202 const CFX_Matrix* pMatrix, |
| 216 uint32_t render_flags, | 203 uint32_t render_flags, |
| 217 void*& handle, | 204 void*& handle, |
| 218 int alpha_flag, | |
| 219 void* pIccTransform, | |
| 220 int blend_type) override { | 205 int blend_type) override { |
| 221 return FALSE; | 206 return FALSE; |
| 222 } | 207 } |
| 223 FX_BOOL UseFoxitStretchEngine(const CFX_DIBSource* pSource, | 208 FX_BOOL UseFoxitStretchEngine(const CFX_DIBSource* pSource, |
| 224 uint32_t color, | 209 uint32_t color, |
| 225 int dest_left, | 210 int dest_left, |
| 226 int dest_top, | 211 int dest_top, |
| 227 int dest_width, | 212 int dest_width, |
| 228 int dest_height, | 213 int dest_height, |
| 229 const FX_RECT* pClipRect, | 214 const FX_RECT* pClipRect, |
| 230 int render_flags, | 215 int render_flags); |
| 231 int alpha_flag = 0, | |
| 232 void* pIccTransform = nullptr, | |
| 233 int blend_type = FXDIB_BLEND_NORMAL); | |
| 234 }; | 216 }; |
| 235 | 217 |
| 236 class CGdiPrinterDriver : public CGdiDeviceDriver { | 218 class CGdiPrinterDriver : public CGdiDeviceDriver { |
| 237 public: | 219 public: |
| 238 explicit CGdiPrinterDriver(HDC hDC); | 220 explicit CGdiPrinterDriver(HDC hDC); |
| 239 ~CGdiPrinterDriver() override; | 221 ~CGdiPrinterDriver() override; |
| 240 | 222 |
| 241 protected: | 223 protected: |
| 242 int GetDeviceCaps(int caps_id) override; | 224 int GetDeviceCaps(int caps_id) override; |
| 243 FX_BOOL SetDIBits(const CFX_DIBSource* pBitmap, | 225 FX_BOOL SetDIBits(const CFX_DIBSource* pBitmap, |
| 244 uint32_t color, | 226 uint32_t color, |
| 245 const FX_RECT* pSrcRect, | 227 const FX_RECT* pSrcRect, |
| 246 int left, | 228 int left, |
| 247 int top, | 229 int top, |
| 248 int blend_type, | 230 int blend_type) override; |
| 249 int alpha_flag, | |
| 250 void* pIccTransform) override; | |
| 251 FX_BOOL StretchDIBits(const CFX_DIBSource* pBitmap, | 231 FX_BOOL StretchDIBits(const CFX_DIBSource* pBitmap, |
| 252 uint32_t color, | 232 uint32_t color, |
| 253 int dest_left, | 233 int dest_left, |
| 254 int dest_top, | 234 int dest_top, |
| 255 int dest_width, | 235 int dest_width, |
| 256 int dest_height, | 236 int dest_height, |
| 257 const FX_RECT* pClipRect, | 237 const FX_RECT* pClipRect, |
| 258 uint32_t flags, | 238 uint32_t flags, |
| 259 int alpha_flag, | |
| 260 void* pIccTransform, | |
| 261 int blend_type) override; | 239 int blend_type) override; |
| 262 FX_BOOL StartDIBits(const CFX_DIBSource* pBitmap, | 240 FX_BOOL StartDIBits(const CFX_DIBSource* pBitmap, |
| 263 int bitmap_alpha, | 241 int bitmap_alpha, |
| 264 uint32_t color, | 242 uint32_t color, |
| 265 const CFX_Matrix* pMatrix, | 243 const CFX_Matrix* pMatrix, |
| 266 uint32_t render_flags, | 244 uint32_t render_flags, |
| 267 void*& handle, | 245 void*& handle, |
| 268 int alpha_flag, | |
| 269 void* pIccTransform, | |
| 270 int blend_type) override; | 246 int blend_type) override; |
| 271 | 247 |
| 272 const int m_HorzSize; | 248 const int m_HorzSize; |
| 273 const int m_VertSize; | 249 const int m_VertSize; |
| 274 }; | 250 }; |
| 275 | 251 |
| 276 #endif // CORE_FXGE_WIN32_WIN32_INT_H_ | 252 #endif // CORE_FXGE_WIN32_WIN32_INT_H_ |
| OLD | NEW |