OLD | NEW |
1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2016 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_INCLUDE_FX_GE_H_ | 7 #ifndef CORE_FXGE_INCLUDE_CFX_RENDERDEVICE_H_ |
8 #define CORE_FXGE_INCLUDE_FX_GE_H_ | 8 #define CORE_FXGE_INCLUDE_CFX_RENDERDEVICE_H_ |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
11 | 11 |
12 #include "core/fxge/include/cfx_fontmgr.h" | 12 #include "core/fxge/include/cfx_gemodule.h" |
13 #include "core/fxge/include/fx_dib.h" | 13 #include "core/fxge/include/fx_dib.h" |
14 #include "core/fxge/include/fx_font.h" | 14 #include "core/fxge/include/fx_font.h" |
15 | 15 |
16 class CCodec_ModuleMgr; | |
17 class CFX_FaceCache; | |
18 class CFX_Font; | 16 class CFX_Font; |
19 class CFX_FontCache; | 17 class CFX_FontCache; |
20 class CFX_FontMgr; | 18 class CFX_GraphStateData; |
21 class CPDF_ShadingPattern; | |
22 class IFX_RenderDeviceDriver; | 19 class IFX_RenderDeviceDriver; |
23 class SkPictureRecorder; | |
24 | |
25 class CFX_GraphStateData { | |
26 public: | |
27 enum LineCap { LineCapButt = 0, LineCapRound = 1, LineCapSquare = 2 }; | |
28 | |
29 CFX_GraphStateData(); | |
30 CFX_GraphStateData(const CFX_GraphStateData& src); | |
31 ~CFX_GraphStateData(); | |
32 | |
33 void Copy(const CFX_GraphStateData& src); | |
34 void SetDashCount(int count); | |
35 | |
36 LineCap m_LineCap; | |
37 int m_DashCount; | |
38 FX_FLOAT* m_DashArray; | |
39 FX_FLOAT m_DashPhase; | |
40 | |
41 enum LineJoin { | |
42 LineJoinMiter = 0, | |
43 LineJoinRound = 1, | |
44 LineJoinBevel = 2, | |
45 }; | |
46 LineJoin m_LineJoin; | |
47 FX_FLOAT m_MiterLimit; | |
48 FX_FLOAT m_LineWidth; | |
49 }; | |
50 | 20 |
51 #define FXDC_DEVICE_CLASS 1 | 21 #define FXDC_DEVICE_CLASS 1 |
52 #define FXDC_PIXEL_WIDTH 2 | 22 #define FXDC_PIXEL_WIDTH 2 |
53 #define FXDC_PIXEL_HEIGHT 3 | 23 #define FXDC_PIXEL_HEIGHT 3 |
54 #define FXDC_BITS_PIXEL 4 | 24 #define FXDC_BITS_PIXEL 4 |
55 #define FXDC_HORZ_SIZE 5 | 25 #define FXDC_HORZ_SIZE 5 |
56 #define FXDC_VERT_SIZE 6 | 26 #define FXDC_VERT_SIZE 6 |
57 #define FXDC_RENDER_CAPS 7 | 27 #define FXDC_RENDER_CAPS 7 |
58 #define FXDC_DISPLAY 1 | 28 #define FXDC_DISPLAY 1 |
59 #define FXDC_PRINTER 2 | 29 #define FXDC_PRINTER 2 |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
300 CFX_DIBitmap* m_pBitmap; | 270 CFX_DIBitmap* m_pBitmap; |
301 int m_Width; | 271 int m_Width; |
302 int m_Height; | 272 int m_Height; |
303 int m_bpp; | 273 int m_bpp; |
304 int m_RenderCaps; | 274 int m_RenderCaps; |
305 int m_DeviceClass; | 275 int m_DeviceClass; |
306 FX_RECT m_ClipBox; | 276 FX_RECT m_ClipBox; |
307 std::unique_ptr<IFX_RenderDeviceDriver> m_pDeviceDriver; | 277 std::unique_ptr<IFX_RenderDeviceDriver> m_pDeviceDriver; |
308 }; | 278 }; |
309 | 279 |
310 class CFX_FxgeDevice : public CFX_RenderDevice { | 280 #endif // CORE_FXGE_INCLUDE_CFX_RENDERDEVICE_H_ |
311 public: | |
312 CFX_FxgeDevice(); | |
313 ~CFX_FxgeDevice() override; | |
314 | |
315 bool Attach(CFX_DIBitmap* pBitmap, | |
316 bool bRgbByteOrder, | |
317 CFX_DIBitmap* pOriDevice, | |
318 bool bGroupKnockout); | |
319 bool Create(int width, | |
320 int height, | |
321 FXDIB_Format format, | |
322 CFX_DIBitmap* pOriDevice); | |
323 | |
324 #ifdef _SKIA_SUPPORT_ | |
325 bool AttachRecorder(SkPictureRecorder* recorder); | |
326 SkPictureRecorder* CreateRecorder(int size_x, int size_y); | |
327 void DebugVerifyBitmapIsPreMultiplied() const override; | |
328 #endif | |
329 | |
330 protected: | |
331 bool m_bOwnedBitmap; | |
332 }; | |
333 | |
334 #endif // CORE_FXGE_INCLUDE_FX_GE_H_ | |
OLD | NEW |