OLD | NEW |
1 // Copyright 2016 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_IFX_RENDERDEVICEDRIVER_H_ | 7 #ifndef CORE_FXGE_IFX_RENDERDEVICEDRIVER_H_ |
8 #define CORE_FXGE_IFX_RENDERDEVICEDRIVER_H_ | 8 #define CORE_FXGE_IFX_RENDERDEVICEDRIVER_H_ |
9 | 9 |
10 #include "core/fxcrt/fx_system.h" | 10 #include "core/fxcrt/fx_system.h" |
11 | 11 |
12 class CFX_DIBitmap; | 12 class CFX_DIBitmap; |
13 class CFX_DIBSource; | 13 class CFX_DIBSource; |
14 class CFX_Font; | 14 class CFX_Font; |
15 class CFX_GraphStateData; | 15 class CFX_GraphStateData; |
16 class CFX_Matrix; | 16 class CFX_Matrix; |
17 class CFX_PathData; | 17 class CFX_PathData; |
18 class CPDF_ShadingPattern; | 18 class CPDF_ShadingPattern; |
19 class IFX_Pause; | 19 class IFX_Pause; |
20 struct FXTEXT_CHARPOS; | 20 struct FXTEXT_CHARPOS; |
21 struct FX_RECT; | 21 struct FX_RECT; |
22 | 22 |
23 class IFX_RenderDeviceDriver { | 23 class IFX_RenderDeviceDriver { |
24 public: | 24 public: |
25 virtual ~IFX_RenderDeviceDriver(); | 25 virtual ~IFX_RenderDeviceDriver(); |
26 | 26 |
27 virtual int GetDeviceCaps(int caps_id) const = 0; | 27 virtual int GetDeviceCaps(int caps_id) const = 0; |
28 virtual CFX_Matrix GetCTM() const; | 28 virtual CFX_Matrix GetCTM() const; |
29 | 29 |
30 virtual FX_BOOL StartRendering(); | 30 virtual bool StartRendering(); |
31 virtual void EndRendering(); | 31 virtual void EndRendering(); |
32 virtual void SaveState() = 0; | 32 virtual void SaveState() = 0; |
33 virtual void RestoreState(bool bKeepSaved) = 0; | 33 virtual void RestoreState(bool bKeepSaved) = 0; |
34 | 34 |
35 virtual FX_BOOL SetClip_PathFill(const CFX_PathData* pPathData, | 35 virtual bool SetClip_PathFill(const CFX_PathData* pPathData, |
36 const CFX_Matrix* pObject2Device, | 36 const CFX_Matrix* pObject2Device, |
37 int fill_mode) = 0; | 37 int fill_mode) = 0; |
38 virtual FX_BOOL SetClip_PathStroke(const CFX_PathData* pPathData, | 38 virtual bool SetClip_PathStroke(const CFX_PathData* pPathData, |
39 const CFX_Matrix* pObject2Device, | 39 const CFX_Matrix* pObject2Device, |
40 const CFX_GraphStateData* pGraphState); | 40 const CFX_GraphStateData* pGraphState); |
41 virtual FX_BOOL DrawPath(const CFX_PathData* pPathData, | 41 virtual bool DrawPath(const CFX_PathData* pPathData, |
42 const CFX_Matrix* pObject2Device, | 42 const CFX_Matrix* pObject2Device, |
43 const CFX_GraphStateData* pGraphState, | 43 const CFX_GraphStateData* pGraphState, |
44 uint32_t fill_color, | 44 uint32_t fill_color, |
45 uint32_t stroke_color, | 45 uint32_t stroke_color, |
46 int fill_mode, | 46 int fill_mode, |
| 47 int blend_type) = 0; |
| 48 virtual bool SetPixel(int x, int y, uint32_t color); |
| 49 virtual bool FillRectWithBlend(const FX_RECT* pRect, |
| 50 uint32_t fill_color, |
| 51 int blend_type); |
| 52 virtual bool DrawCosmeticLine(FX_FLOAT x1, |
| 53 FX_FLOAT y1, |
| 54 FX_FLOAT x2, |
| 55 FX_FLOAT y2, |
| 56 uint32_t color, |
| 57 int blend_type); |
| 58 |
| 59 virtual bool GetClipBox(FX_RECT* pRect) = 0; |
| 60 virtual bool GetDIBits(CFX_DIBitmap* pBitmap, int left, int top); |
| 61 virtual CFX_DIBitmap* GetBackDrop(); |
| 62 virtual bool SetDIBits(const CFX_DIBSource* pBitmap, |
| 63 uint32_t color, |
| 64 const FX_RECT* pSrcRect, |
| 65 int dest_left, |
| 66 int dest_top, |
| 67 int blend_type) = 0; |
| 68 virtual bool StretchDIBits(const CFX_DIBSource* pBitmap, |
| 69 uint32_t color, |
| 70 int dest_left, |
| 71 int dest_top, |
| 72 int dest_width, |
| 73 int dest_height, |
| 74 const FX_RECT* pClipRect, |
| 75 uint32_t flags, |
| 76 int blend_type) = 0; |
| 77 virtual bool StartDIBits(const CFX_DIBSource* pBitmap, |
| 78 int bitmap_alpha, |
| 79 uint32_t color, |
| 80 const CFX_Matrix* pMatrix, |
| 81 uint32_t flags, |
| 82 void*& handle, |
47 int blend_type) = 0; | 83 int blend_type) = 0; |
48 virtual FX_BOOL SetPixel(int x, int y, uint32_t color); | 84 virtual bool ContinueDIBits(void* handle, IFX_Pause* pPause); |
49 virtual FX_BOOL FillRectWithBlend(const FX_RECT* pRect, | |
50 uint32_t fill_color, | |
51 int blend_type); | |
52 virtual FX_BOOL DrawCosmeticLine(FX_FLOAT x1, | |
53 FX_FLOAT y1, | |
54 FX_FLOAT x2, | |
55 FX_FLOAT y2, | |
56 uint32_t color, | |
57 int blend_type); | |
58 | |
59 virtual FX_BOOL GetClipBox(FX_RECT* pRect) = 0; | |
60 virtual FX_BOOL GetDIBits(CFX_DIBitmap* pBitmap, int left, int top); | |
61 virtual CFX_DIBitmap* GetBackDrop(); | |
62 virtual FX_BOOL SetDIBits(const CFX_DIBSource* pBitmap, | |
63 uint32_t color, | |
64 const FX_RECT* pSrcRect, | |
65 int dest_left, | |
66 int dest_top, | |
67 int blend_type) = 0; | |
68 virtual FX_BOOL StretchDIBits(const CFX_DIBSource* pBitmap, | |
69 uint32_t color, | |
70 int dest_left, | |
71 int dest_top, | |
72 int dest_width, | |
73 int dest_height, | |
74 const FX_RECT* pClipRect, | |
75 uint32_t flags, | |
76 int blend_type) = 0; | |
77 virtual FX_BOOL StartDIBits(const CFX_DIBSource* pBitmap, | |
78 int bitmap_alpha, | |
79 uint32_t color, | |
80 const CFX_Matrix* pMatrix, | |
81 uint32_t flags, | |
82 void*& handle, | |
83 int blend_type) = 0; | |
84 virtual FX_BOOL ContinueDIBits(void* handle, IFX_Pause* pPause); | |
85 virtual void CancelDIBits(void* handle); | 85 virtual void CancelDIBits(void* handle); |
86 virtual FX_BOOL DrawDeviceText(int nChars, | 86 virtual bool DrawDeviceText(int nChars, |
87 const FXTEXT_CHARPOS* pCharPos, | 87 const FXTEXT_CHARPOS* pCharPos, |
88 CFX_Font* pFont, | 88 CFX_Font* pFont, |
89 const CFX_Matrix* pObject2Device, | 89 const CFX_Matrix* pObject2Device, |
90 FX_FLOAT font_size, | 90 FX_FLOAT font_size, |
91 uint32_t color); | 91 uint32_t color); |
92 virtual void* GetPlatformSurface() const; | 92 virtual void* GetPlatformSurface() const; |
93 virtual int GetDriverType() const; | 93 virtual int GetDriverType() const; |
94 virtual void ClearDriver(); | 94 virtual void ClearDriver(); |
95 virtual FX_BOOL DrawShading(const CPDF_ShadingPattern* pPattern, | 95 virtual bool DrawShading(const CPDF_ShadingPattern* pPattern, |
96 const CFX_Matrix* pMatrix, | 96 const CFX_Matrix* pMatrix, |
97 const FX_RECT& clip_rect, | 97 const FX_RECT& clip_rect, |
98 int alpha, | 98 int alpha, |
99 FX_BOOL bAlphaMode); | 99 bool bAlphaMode); |
100 virtual bool SetBitsWithMask(const CFX_DIBSource* pBitmap, | 100 virtual bool SetBitsWithMask(const CFX_DIBSource* pBitmap, |
101 const CFX_DIBSource* pMask, | 101 const CFX_DIBSource* pMask, |
102 int left, | 102 int left, |
103 int top, | 103 int top, |
104 int bitmap_alpha, | 104 int bitmap_alpha, |
105 int blend_type); | 105 int blend_type); |
106 }; | 106 }; |
107 | 107 |
108 #endif // CORE_FXGE_IFX_RENDERDEVICEDRIVER_H_ | 108 #endif // CORE_FXGE_IFX_RENDERDEVICEDRIVER_H_ |
OLD | NEW |