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_SRC_FXGE_AGG_INCLUDE_FX_AGG_DRIVER_H_ | 7 #ifndef CORE_SRC_FXGE_AGG_INCLUDE_FX_AGG_DRIVER_H_ |
8 #define CORE_SRC_FXGE_AGG_INCLUDE_FX_AGG_DRIVER_H_ | 8 #define CORE_SRC_FXGE_AGG_INCLUDE_FX_AGG_DRIVER_H_ |
9 | 9 |
10 #include "core/include/fxge/fx_ge.h" | 10 #include "core/include/fxge/fx_ge.h" |
11 #include "third_party/agg23/agg_clip_liang_barsky.h" | 11 #include "third_party/agg23/agg_clip_liang_barsky.h" |
12 #include "third_party/agg23/agg_path_storage.h" | 12 #include "third_party/agg23/agg_path_storage.h" |
13 #include "third_party/agg23/agg_rasterizer_scanline_aa.h" | 13 #include "third_party/agg23/agg_rasterizer_scanline_aa.h" |
14 | 14 |
15 class CFX_AffineMatrix; | 15 class CFX_Matrix; |
16 class CFX_PathData; | 16 class CFX_PathData; |
17 | 17 |
18 class CAgg_PathData { | 18 class CAgg_PathData { |
19 public: | 19 public: |
20 CAgg_PathData() {} | 20 CAgg_PathData() {} |
21 ~CAgg_PathData() {} | 21 ~CAgg_PathData() {} |
22 FX_NAMESPACE_DECLARE(agg, path_storage) m_PathData; | 22 FX_NAMESPACE_DECLARE(agg, path_storage) m_PathData; |
23 void BuildPath(const CFX_PathData* pPathData, | 23 void BuildPath(const CFX_PathData* pPathData, |
24 const CFX_AffineMatrix* pObject2Device); | 24 const CFX_Matrix* pObject2Device); |
25 }; | 25 }; |
26 class CFX_AggDeviceDriver : public IFX_RenderDeviceDriver { | 26 class CFX_AggDeviceDriver : public IFX_RenderDeviceDriver { |
27 public: | 27 public: |
28 CFX_AggDeviceDriver(CFX_DIBitmap* pBitmap, | 28 CFX_AggDeviceDriver(CFX_DIBitmap* pBitmap, |
29 int dither_bits, | 29 int dither_bits, |
30 FX_BOOL bRgbByteOrder, | 30 FX_BOOL bRgbByteOrder, |
31 CFX_DIBitmap* pOriDevice, | 31 CFX_DIBitmap* pOriDevice, |
32 FX_BOOL bGroupKnockout); | 32 FX_BOOL bGroupKnockout); |
33 ~CFX_AggDeviceDriver() override; | 33 ~CFX_AggDeviceDriver() override; |
34 | 34 |
35 void InitPlatform(); | 35 void InitPlatform(); |
36 void DestroyPlatform(); | 36 void DestroyPlatform(); |
37 | 37 |
38 // IFX_RenderDeviceDriver | 38 // IFX_RenderDeviceDriver |
39 int GetDeviceCaps(int caps_id) override; | 39 int GetDeviceCaps(int caps_id) override; |
40 void SaveState() override; | 40 void SaveState() override; |
41 void RestoreState(FX_BOOL bKeepSaved) override; | 41 void RestoreState(FX_BOOL bKeepSaved) override; |
42 FX_BOOL SetClip_PathFill(const CFX_PathData* pPathData, | 42 FX_BOOL SetClip_PathFill(const CFX_PathData* pPathData, |
43 const CFX_AffineMatrix* pObject2Device, | 43 const CFX_Matrix* pObject2Device, |
44 int fill_mode) override; | 44 int fill_mode) override; |
45 FX_BOOL SetClip_PathStroke(const CFX_PathData* pPathData, | 45 FX_BOOL SetClip_PathStroke(const CFX_PathData* pPathData, |
46 const CFX_AffineMatrix* pObject2Device, | 46 const CFX_Matrix* pObject2Device, |
47 const CFX_GraphStateData* pGraphState) override; | 47 const CFX_GraphStateData* pGraphState) override; |
48 FX_BOOL DrawPath(const CFX_PathData* pPathData, | 48 FX_BOOL DrawPath(const CFX_PathData* pPathData, |
49 const CFX_AffineMatrix* pObject2Device, | 49 const CFX_Matrix* pObject2Device, |
50 const CFX_GraphStateData* pGraphState, | 50 const CFX_GraphStateData* pGraphState, |
51 FX_DWORD fill_color, | 51 FX_DWORD fill_color, |
52 FX_DWORD stroke_color, | 52 FX_DWORD stroke_color, |
53 int fill_mode, | 53 int fill_mode, |
54 int alpha_flag, | 54 int alpha_flag, |
55 void* pIccTransform, | 55 void* pIccTransform, |
56 int blend_type) override; | 56 int blend_type) override; |
57 FX_BOOL SetPixel(int x, | 57 FX_BOOL SetPixel(int x, |
58 int y, | 58 int y, |
59 FX_DWORD color, | 59 FX_DWORD color, |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 int dest_width, | 96 int dest_width, |
97 int dest_height, | 97 int dest_height, |
98 const FX_RECT* pClipRect, | 98 const FX_RECT* pClipRect, |
99 FX_DWORD flags, | 99 FX_DWORD flags, |
100 int alpha_flag, | 100 int alpha_flag, |
101 void* pIccTransform, | 101 void* pIccTransform, |
102 int blend_type) override; | 102 int blend_type) override; |
103 FX_BOOL StartDIBits(const CFX_DIBSource* pBitmap, | 103 FX_BOOL StartDIBits(const CFX_DIBSource* pBitmap, |
104 int bitmap_alpha, | 104 int bitmap_alpha, |
105 FX_DWORD color, | 105 FX_DWORD color, |
106 const CFX_AffineMatrix* pMatrix, | 106 const CFX_Matrix* pMatrix, |
107 FX_DWORD flags, | 107 FX_DWORD flags, |
108 void*& handle, | 108 void*& handle, |
109 int alpha_flag, | 109 int alpha_flag, |
110 void* pIccTransform, | 110 void* pIccTransform, |
111 int blend_type) override; | 111 int blend_type) override; |
112 FX_BOOL ContinueDIBits(void* handle, IFX_Pause* pPause) override; | 112 FX_BOOL ContinueDIBits(void* handle, IFX_Pause* pPause) override; |
113 void CancelDIBits(void* handle) override; | 113 void CancelDIBits(void* handle) override; |
114 FX_BOOL DrawDeviceText(int nChars, | 114 FX_BOOL DrawDeviceText(int nChars, |
115 const FXTEXT_CHARPOS* pCharPos, | 115 const FXTEXT_CHARPOS* pCharPos, |
116 CFX_Font* pFont, | 116 CFX_Font* pFont, |
117 CFX_FontCache* pCache, | 117 CFX_FontCache* pCache, |
118 const CFX_AffineMatrix* pObject2Device, | 118 const CFX_Matrix* pObject2Device, |
119 FX_FLOAT font_size, | 119 FX_FLOAT font_size, |
120 FX_DWORD color, | 120 FX_DWORD color, |
121 int alpha_flag, | 121 int alpha_flag, |
122 void* pIccTransform) override; | 122 void* pIccTransform) override; |
123 int GetDriverType() override { return 1; } | 123 int GetDriverType() override { return 1; } |
124 | 124 |
125 FX_BOOL RenderRasterizer(FX_NAMESPACE_DECLARE(agg, rasterizer_scanline_aa) & | 125 FX_BOOL RenderRasterizer(FX_NAMESPACE_DECLARE(agg, rasterizer_scanline_aa) & |
126 rasterizer, | 126 rasterizer, |
127 FX_DWORD color, | 127 FX_DWORD color, |
128 FX_BOOL bFullCover, | 128 FX_BOOL bFullCover, |
(...skipping 13 matching lines...) Expand all Loading... |
142 void* m_pPlatformBitmap; | 142 void* m_pPlatformBitmap; |
143 void* m_pDwRenderTartget; | 143 void* m_pDwRenderTartget; |
144 int m_FillFlags; | 144 int m_FillFlags; |
145 int m_DitherBits; | 145 int m_DitherBits; |
146 FX_BOOL m_bRgbByteOrder; | 146 FX_BOOL m_bRgbByteOrder; |
147 CFX_DIBitmap* m_pOriDevice; | 147 CFX_DIBitmap* m_pOriDevice; |
148 FX_BOOL m_bGroupKnockout; | 148 FX_BOOL m_bGroupKnockout; |
149 }; | 149 }; |
150 | 150 |
151 #endif // CORE_SRC_FXGE_AGG_INCLUDE_FX_AGG_DRIVER_H_ | 151 #endif // CORE_SRC_FXGE_AGG_INCLUDE_FX_AGG_DRIVER_H_ |
OLD | NEW |