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 #ifndef CORE_SRC_FXGE_SKIA_FX_SKIA_DEVICE_H_ | 5 #ifndef CORE_SRC_FXGE_SKIA_FX_SKIA_DEVICE_H_ |
6 #define CORE_SRC_FXGE_SKIA_FX_SKIA_DEVICE_H_ | 6 #define CORE_SRC_FXGE_SKIA_FX_SKIA_DEVICE_H_ |
7 | 7 |
8 #if defined(_SKIA_SUPPORT_) | 8 #if defined(_SKIA_SUPPORT_) |
| 9 |
| 10 class SkCanvas; |
| 11 class SkPaint; |
| 12 class SkPath; |
| 13 struct SkIRect; |
| 14 |
9 class CFX_SkiaDeviceDriver : public IFX_RenderDeviceDriver { | 15 class CFX_SkiaDeviceDriver : public IFX_RenderDeviceDriver { |
10 public: | 16 public: |
11 CFX_SkiaDeviceDriver(CFX_DIBitmap* pBitmap, | 17 CFX_SkiaDeviceDriver(CFX_DIBitmap* pBitmap, |
12 int dither_bits, | 18 int dither_bits, |
13 FX_BOOL bRgbByteOrder, | 19 FX_BOOL bRgbByteOrder, |
14 CFX_DIBitmap* pOriDevice, | 20 CFX_DIBitmap* pOriDevice, |
15 FX_BOOL bGroupKnockout); | 21 FX_BOOL bGroupKnockout); |
16 ~CFX_SkiaDeviceDriver() override; | 22 ~CFX_SkiaDeviceDriver() override; |
17 | 23 |
18 /** Options */ | 24 /** Options */ |
(...skipping 17 matching lines...) Expand all Loading... |
36 pGraphState); // graphic state, for pen attributes | 42 pGraphState); // graphic state, for pen attributes |
37 | 43 |
38 /** Draw a path */ | 44 /** Draw a path */ |
39 virtual FX_BOOL DrawPath(const CFX_PathData* pPathData, | 45 virtual FX_BOOL DrawPath(const CFX_PathData* pPathData, |
40 const CFX_Matrix* pObject2Device, | 46 const CFX_Matrix* pObject2Device, |
41 const CFX_GraphStateData* pGraphState, | 47 const CFX_GraphStateData* pGraphState, |
42 FX_DWORD fill_color, | 48 FX_DWORD fill_color, |
43 FX_DWORD stroke_color, | 49 FX_DWORD stroke_color, |
44 int fill_mode, | 50 int fill_mode, |
45 int alpha_flag = 0, | 51 int alpha_flag = 0, |
46 void* pIccTransform = NULL); | 52 void* pIccTransform = NULL, |
| 53 int blend_type = FXDIB_BLEND_NORMAL); |
47 | 54 |
48 virtual FX_BOOL SetPixel(int x, | 55 virtual FX_BOOL SetPixel(int x, |
49 int y, | 56 int y, |
50 FX_DWORD color, | 57 FX_DWORD color, |
51 int alpha_flag = 0, | 58 int alpha_flag = 0, |
52 void* pIccTransform = NULL); | 59 void* pIccTransform = NULL); |
53 | 60 |
54 virtual FX_BOOL FillRect(const FX_RECT* pRect, | 61 virtual FX_BOOL FillRect(const FX_RECT* pRect, |
55 FX_DWORD fill_color, | 62 FX_DWORD fill_color, |
56 int alpha_flag = 0, | 63 int alpha_flag = 0, |
57 void* pIccTransform = NULL); | 64 void* pIccTransform = NULL, |
| 65 int blend_type = FXDIB_BLEND_NORMAL); |
58 | 66 |
59 /** Draw a single pixel (device dependant) line */ | 67 /** Draw a single pixel (device dependant) line */ |
60 virtual FX_BOOL DrawCosmeticLine(FX_FIXFLOAT x1, | 68 virtual FX_BOOL DrawCosmeticLine(FX_FLOAT x1, |
61 FX_FIXFLOAT y1, | 69 FX_FLOAT y1, |
62 FX_FIXFLOAT x2, | 70 FX_FLOAT x2, |
63 FX_FIXFLOAT y2, | 71 FX_FLOAT y2, |
64 FX_DWORD color, | 72 FX_DWORD color, |
65 int alpha_flag, | 73 int alpha_flag = 0, |
66 void* pIccTransform, | 74 void* pIccTransform = NULL, |
67 int blend_type) { | 75 int blend_type = FXDIB_BLEND_NORMAL) { |
68 return FALSE; | 76 return FALSE; |
69 } | 77 } |
70 | 78 |
71 virtual FX_BOOL GetClipBox(FX_RECT* pRect); | 79 virtual FX_BOOL GetClipBox(FX_RECT* pRect); |
72 | 80 |
73 /** Load device buffer into a DIB */ | 81 /** Load device buffer into a DIB */ |
74 virtual FX_BOOL GetDIBits(CFX_DIBitmap* pBitmap, | 82 virtual FX_BOOL GetDIBits(CFX_DIBitmap* pBitmap, |
75 int left, | 83 int left, |
76 int top, | 84 int top, |
77 void* pIccTransform = NULL, | 85 void* pIccTransform = NULL, |
(...skipping 11 matching lines...) Expand all Loading... |
89 void* pIccTransform = NULL); | 97 void* pIccTransform = NULL); |
90 virtual FX_BOOL StretchDIBits(const CFX_DIBSource* pBitmap, | 98 virtual FX_BOOL StretchDIBits(const CFX_DIBSource* pBitmap, |
91 FX_DWORD color, | 99 FX_DWORD color, |
92 int dest_left, | 100 int dest_left, |
93 int dest_top, | 101 int dest_top, |
94 int dest_width, | 102 int dest_width, |
95 int dest_height, | 103 int dest_height, |
96 const FX_RECT* pClipRect, | 104 const FX_RECT* pClipRect, |
97 FX_DWORD flags, | 105 FX_DWORD flags, |
98 int alpha_flag = 0, | 106 int alpha_flag = 0, |
99 void* pIccTransform = NULL); | 107 void* pIccTransform = NULL, |
| 108 int blend_type = FXDIB_BLEND_NORMAL); |
100 | 109 |
101 virtual FX_BOOL StartDIBits(const CFX_DIBSource* pBitmap, | 110 virtual FX_BOOL StartDIBits(const CFX_DIBSource* pBitmap, |
102 int bitmap_alpha, | 111 int bitmap_alpha, |
103 FX_DWORD color, | 112 FX_DWORD color, |
104 const CFX_Matrix* pMatrix, | 113 const CFX_Matrix* pMatrix, |
105 FX_DWORD flags, | 114 FX_DWORD flags, |
106 void*& handle, | 115 void*& handle, |
107 int alpha_flag = 0, | 116 int alpha_flag = 0, |
108 void* pIccTransform = NULL); | 117 void* pIccTransform = NULL, |
| 118 int blend_type = FXDIB_BLEND_NORMAL); |
109 virtual FX_BOOL ContinueDIBits(void* handle, IFX_Pause* pPause); | 119 virtual FX_BOOL ContinueDIBits(void* handle, IFX_Pause* pPause); |
110 virtual void CancelDIBits(void* handle); | 120 virtual void CancelDIBits(void* handle); |
111 | 121 |
112 virtual FX_BOOL DrawDeviceText(int nChars, | 122 virtual FX_BOOL DrawDeviceText(int nChars, |
113 const FXTEXT_CHARPOS* pCharPos, | 123 const FXTEXT_CHARPOS* pCharPos, |
114 CFX_Font* pFont, | 124 CFX_Font* pFont, |
115 CFX_FontCache* pCache, | 125 CFX_FontCache* pCache, |
116 const CFX_Matrix* pObject2Device, | 126 const CFX_Matrix* pObject2Device, |
117 FX_FIXFLOAT font_size, | 127 FX_FLOAT font_size, |
118 FX_DWORD color, | 128 FX_DWORD color, |
119 int alpha_flag = 0, | 129 int alpha_flag = 0, |
120 void* pIccTransform = NULL); | 130 void* pIccTransform = NULL); |
121 | 131 |
122 virtual FX_BOOL RenderRasterizer(rasterizer_scanline_aa& rasterizer, | 132 virtual FX_BOOL RenderRasterizer(agg::rasterizer_scanline_aa& rasterizer, |
123 FX_DWORD color, | 133 FX_DWORD color, |
124 FX_BOOL bFullCover, | 134 FX_BOOL bFullCover, |
125 FX_BOOL bGroupKnockout, | 135 FX_BOOL bGroupKnockout, |
126 int alpha_flag, | 136 int alpha_flag, |
127 void* pIccTransform); | 137 void* pIccTransform); |
128 virtual FX_BOOL RenderRasterizerSkia(SkPath& skPath, | 138 void SetClipMask(agg::rasterizer_scanline_aa& rasterizer); |
129 const SkPaint& origPaint, | |
130 SkIRect& rect, | |
131 FX_DWORD color, | |
132 FX_BOOL bFullCover, | |
133 FX_BOOL bGroupKnockout, | |
134 int alpha_flag, | |
135 void* pIccTransform, | |
136 FX_BOOL bFill = TRUE); | |
137 void SetClipMask(rasterizer_scanline_aa& rasterizer); | |
138 void SetClipMask(SkPath& skPath, SkPaint* spaint); | 139 void SetClipMask(SkPath& skPath, SkPaint* spaint); |
139 virtual uint8_t* GetBuffer() const { return m_pAggDriver->GetBuffer(); } | 140 virtual uint8_t* GetBuffer() const { return m_pAggDriver->GetBuffer(); } |
| 141 void PaintStroke(SkPaint* spaint, const CFX_GraphStateData* pGraphState); |
140 | 142 |
| 143 private: |
141 CFX_AggDeviceDriver* m_pAggDriver; | 144 CFX_AggDeviceDriver* m_pAggDriver; |
| 145 SkCanvas* m_canvas; |
142 }; | 146 }; |
143 #endif // defined(_SKIA_SUPPORT_) | 147 #endif // defined(_SKIA_SUPPORT_) |
144 | 148 |
145 #endif // CORE_SRC_FXGE_SKIA_FX_SKIA_DEVICE_H_ | 149 #endif // CORE_SRC_FXGE_SKIA_FX_SKIA_DEVICE_H_ |
OLD | NEW |