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 _FX_AGG_DEVICE_DRIVER_ | 7 #ifndef _FX_AGG_DEVICE_DRIVER_ |
8 #define _FX_AGG_DEVICE_DRIVER_ | 8 #define _FX_AGG_DEVICE_DRIVER_ |
9 #include "fxfx_agg_path_storage.h" | 9 #include "fxfx_agg_path_storage.h" |
10 #include "fxfx_agg_rasterizer_scanline_aa.h" | 10 #include "fxfx_agg_rasterizer_scanline_aa.h" |
11 class CAgg_PathData : public CFX_Object | 11 class CAgg_PathData : public CFX_Object { |
12 { | 12 public: |
13 public: | 13 CAgg_PathData() {} |
14 CAgg_PathData() {} | 14 ~CAgg_PathData() {} |
15 ~CAgg_PathData() {} | 15 FX_NAMESPACE_DECLARE(agg, path_storage) m_PathData; |
16 FX_NAMESPACE_DECLARE(agg, path_storage)» m_PathData; | 16 void BuildPath(const CFX_PathData* pPathData, |
17 void» » » BuildPath(const CFX_PathData* pPathData, const C
FX_AffineMatrix* pObject2Device); | 17 const CFX_AffineMatrix* pObject2Device); |
18 }; | 18 }; |
19 class CFX_AggDeviceDriver : public IFX_RenderDeviceDriver | 19 class CFX_AggDeviceDriver : public IFX_RenderDeviceDriver { |
20 { | 20 public: |
21 public: | 21 CFX_AggDeviceDriver(CFX_DIBitmap* pBitmap, |
22 CFX_AggDeviceDriver(CFX_DIBitmap* pBitmap, int dither_bits, FX_BOOL bRgbByte
Order, CFX_DIBitmap* pOriDevice, FX_BOOL bGroupKnockout); | 22 int dither_bits, |
23 virtual ~CFX_AggDeviceDriver(); | 23 FX_BOOL bRgbByteOrder, |
24 void» » » » InitPlatform(); | 24 CFX_DIBitmap* pOriDevice, |
25 void» » » » DestroyPlatform(); | 25 FX_BOOL bGroupKnockout); |
| 26 virtual ~CFX_AggDeviceDriver(); |
| 27 void InitPlatform(); |
| 28 void DestroyPlatform(); |
26 | 29 |
| 30 virtual int GetDeviceCaps(int caps_id); |
27 | 31 |
28 virtual int»» » GetDeviceCaps(int caps_id); | 32 virtual void SaveState(); |
| 33 virtual void RestoreState(FX_BOOL bKeepSaved); |
29 | 34 |
| 35 virtual FX_BOOL SetClip_PathFill(const CFX_PathData* pPathData, |
| 36 const CFX_AffineMatrix* pObject2Device, |
| 37 int fill_mode); |
30 | 38 |
31 virtual void» » SaveState(); | 39 virtual FX_BOOL SetClip_PathStroke(const CFX_PathData* pPathData, |
32 virtual void» » RestoreState(FX_BOOL bKeepSaved); | 40 const CFX_AffineMatrix* pObject2Device, |
| 41 const CFX_GraphStateData* pGraphState); |
33 | 42 |
| 43 virtual FX_BOOL DrawPath(const CFX_PathData* pPathData, |
| 44 const CFX_AffineMatrix* pObject2Device, |
| 45 const CFX_GraphStateData* pGraphState, |
| 46 FX_DWORD fill_color, |
| 47 FX_DWORD stroke_color, |
| 48 int fill_mode, |
| 49 int alpha_flag, |
| 50 void* pIccTransform, |
| 51 int blend_type); |
34 | 52 |
35 virtual FX_BOOL» » SetClip_PathFill(const CFX_PathData* pPathData, | 53 virtual FX_BOOL SetPixel(int x, |
36 const CFX_AffineMatrix* pObject2Device, | 54 int y, |
37 int fill_mode | 55 FX_DWORD color, |
38 ); | 56 int alpha_flag, |
| 57 void* pIccTransform); |
39 | 58 |
| 59 virtual FX_BOOL FillRect(const FX_RECT* pRect, |
| 60 FX_DWORD fill_color, |
| 61 int alpha_flag, |
| 62 void* pIccTransform, |
| 63 int blend_type); |
40 | 64 |
41 virtual FX_BOOL» » SetClip_PathStroke(const CFX_PathData* pPathData
, | 65 virtual FX_BOOL DrawCosmeticLine(FX_FLOAT x1, |
42 const CFX_AffineMatrix* pObject2Devic
e, | 66 FX_FLOAT y1, |
43 const CFX_GraphStateData* pGraphState | 67 FX_FLOAT x2, |
44 ); | 68 FX_FLOAT y2, |
| 69 FX_DWORD color, |
| 70 int alpha_flag, |
| 71 void* pIccTransform, |
| 72 int blend_type) { |
| 73 return FALSE; |
| 74 } |
45 | 75 |
| 76 virtual FX_BOOL GetClipBox(FX_RECT* pRect); |
46 | 77 |
47 virtual FX_BOOL» » DrawPath(const CFX_PathData* pPathData, | 78 virtual FX_BOOL GetDIBits(CFX_DIBitmap* pBitmap, |
| 79 int left, |
| 80 int top, |
| 81 void* pIccTransform = NULL, |
| 82 FX_BOOL bDEdge = FALSE); |
| 83 virtual CFX_DIBitmap* GetBackDrop() { return m_pOriDevice; } |
| 84 |
| 85 virtual FX_BOOL SetDIBits(const CFX_DIBSource* pBitmap, |
| 86 FX_DWORD color, |
| 87 const FX_RECT* pSrcRect, |
| 88 int left, |
| 89 int top, |
| 90 int blend_type, |
| 91 int alpha_flag, |
| 92 void* pIccTransform); |
| 93 virtual FX_BOOL StretchDIBits(const CFX_DIBSource* pBitmap, |
| 94 FX_DWORD color, |
| 95 int dest_left, |
| 96 int dest_top, |
| 97 int dest_width, |
| 98 int dest_height, |
| 99 const FX_RECT* pClipRect, |
| 100 FX_DWORD flags, |
| 101 int alpha_flag, |
| 102 void* pIccTransform, |
| 103 int blend_type); |
| 104 |
| 105 virtual FX_BOOL StartDIBits(const CFX_DIBSource* pBitmap, |
| 106 int bitmap_alpha, |
| 107 FX_DWORD color, |
| 108 const CFX_AffineMatrix* pMatrix, |
| 109 FX_DWORD flags, |
| 110 FX_LPVOID& handle, |
| 111 int alpha_flag, |
| 112 void* pIccTransform, |
| 113 int blend_type); |
| 114 virtual FX_BOOL ContinueDIBits(FX_LPVOID handle, IFX_Pause* pPause); |
| 115 virtual void CancelDIBits(FX_LPVOID handle); |
| 116 |
| 117 virtual FX_BOOL DrawDeviceText(int nChars, |
| 118 const FXTEXT_CHARPOS* pCharPos, |
| 119 CFX_Font* pFont, |
| 120 CFX_FontCache* pCache, |
48 const CFX_AffineMatrix* pObject2Device, | 121 const CFX_AffineMatrix* pObject2Device, |
49 const CFX_GraphStateData* pGraphState, | 122 FX_FLOAT font_size, |
50 FX_DWORD fill_color, | 123 FX_DWORD color, |
51 FX_DWORD stroke_color, | |
52 int fill_mode, | |
53 int alpha_flag, | 124 int alpha_flag, |
54 void* pIccTransform, | 125 void* pIccTransform); |
55 int blend_type | 126 virtual FX_BOOL RenderRasterizer( |
56 ); | 127 FX_NAMESPACE_DECLARE(agg, rasterizer_scanline_aa) & rasterizer, |
| 128 FX_DWORD color, |
| 129 FX_BOOL bFullCover, |
| 130 FX_BOOL bGroupKnockout, |
| 131 int alpha_flag, |
| 132 void* pIccTransform); |
57 | 133 |
58 virtual FX_BOOL» » SetPixel(int x, int y, FX_DWORD color, | 134 void SetClipMask(FX_NAMESPACE_DECLARE(agg, rasterizer_scanline_aa) & |
59 int alpha_flag, void* pIccTransform); | 135 rasterizer); |
60 | 136 |
61 virtual FX_BOOL» » FillRect(const FX_RECT* pRect, | 137 virtual FX_LPBYTE GetBuffer() const { return m_pBitmap->GetBuffer(); } |
62 FX_DWORD fill_color, int alpha_flag, void* pIcc
Transform, int blend_type); | 138 virtual int GetDriverType() { return 1; } |
63 | 139 |
64 | 140 CFX_DIBitmap* m_pBitmap; |
65 virtual FX_BOOL» » DrawCosmeticLine(FX_FLOAT x1, FX_FLOAT y1, FX_FL
OAT x2, FX_FLOAT y2, FX_DWORD color, | 141 CFX_ClipRgn* m_pClipRgn; |
66 int alpha_flag, void* pIccTransform, in
t blend_type) | 142 CFX_PtrArray m_StateStack; |
67 { | 143 void* m_pPlatformGraphics; |
68 return FALSE; | 144 void* m_pPlatformBitmap; |
69 } | 145 void* m_pDwRenderTartget; |
70 | 146 int m_FillFlags; |
71 virtual FX_BOOL» » GetClipBox(FX_RECT* pRect); | 147 int m_DitherBits; |
72 | 148 FX_BOOL m_bRgbByteOrder; |
73 | 149 CFX_DIBitmap* m_pOriDevice; |
74 virtual FX_BOOL» » GetDIBits(CFX_DIBitmap* pBitmap, int left, int t
op, void* pIccTransform = NULL, FX_BOOL bDEdge = FALSE); | 150 FX_BOOL m_bGroupKnockout; |
75 virtual CFX_DIBitmap* GetBackDrop() | |
76 { | |
77 return m_pOriDevice; | |
78 } | |
79 | |
80 virtual FX_BOOL» » SetDIBits(const CFX_DIBSource* pBitmap, FX_DWORD
color, const FX_RECT* pSrcRect, int left, int top, int blend_type, | |
81 int alpha_flag, void* pIccTransform); | |
82 virtual FX_BOOL» » StretchDIBits(const CFX_DIBSource* pBitmap, FX_D
WORD color, int dest_left, int dest_top, | |
83 int dest_width, int dest_height, const FX_
RECT* pClipRect, FX_DWORD flags, | |
84 int alpha_flag, void* pIccTransform, int b
lend_type); | |
85 | |
86 virtual FX_BOOL» » StartDIBits(const CFX_DIBSource* pBitmap, int bi
tmap_alpha, FX_DWORD color, | |
87 const CFX_AffineMatrix* pMatrix, FX_DWORD fl
ags, FX_LPVOID& handle, | |
88 int alpha_flag, void* pIccTransform, int ble
nd_type); | |
89 virtual FX_BOOL» » ContinueDIBits(FX_LPVOID handle, IFX_Pause* pPau
se); | |
90 virtual void» » CancelDIBits(FX_LPVOID handle); | |
91 | |
92 virtual FX_BOOL DrawDeviceText(int nChars, const FXTEXT_CHARPOS* pCharPo
s, CFX_Font* pFont, | |
93 CFX_FontCache* pCache, const CFX_AffineMa
trix* pObject2Device, FX_FLOAT font_size, FX_DWORD color, | |
94 int alpha_flag, void* pIccTransform); | |
95 virtual FX_BOOL» » RenderRasterizer(FX_NAMESPACE_DECLARE(agg, raste
rizer_scanline_aa)& rasterizer, FX_DWORD color, FX_BOOL bFullCover, FX_BOOL bGro
upKnockout, | |
96 int alpha_flag, void* pIccTransform); | |
97 | |
98 void» » » » SetClipMask(FX_NAMESPACE_DECLARE(agg, ra
sterizer_scanline_aa)& rasterizer); | |
99 | |
100 virtual» FX_LPBYTE» GetBuffer() const | |
101 { | |
102 return m_pBitmap->GetBuffer(); | |
103 } | |
104 virtual int»» » GetDriverType() | |
105 { | |
106 return 1; | |
107 } | |
108 | |
109 CFX_DIBitmap*» » m_pBitmap; | |
110 CFX_ClipRgn*» » m_pClipRgn; | |
111 CFX_PtrArray» » m_StateStack; | |
112 void*» » » » m_pPlatformGraphics; | |
113 void*» » » » m_pPlatformBitmap; | |
114 void*» » » » m_pDwRenderTartget; | |
115 int»» » » » m_FillFlags; | |
116 int»» » » » m_DitherBits; | |
117 FX_BOOL» » » » m_bRgbByteOrder; | |
118 CFX_DIBitmap* m_pOriDevice; | |
119 FX_BOOL m_bGroupKnockout; | |
120 }; | 151 }; |
121 #endif | 152 #endif |
OLD | NEW |