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_FXGE_SKIA_FX_SKIA_DEVICE_H_ | 5 #ifndef CORE_FXGE_SKIA_FX_SKIA_DEVICE_H_ |
6 #define CORE_FXGE_SKIA_FX_SKIA_DEVICE_H_ | 6 #define CORE_FXGE_SKIA_FX_SKIA_DEVICE_H_ |
7 | 7 |
8 #if defined(_SKIA_SUPPORT_) | 8 #if defined(_SKIA_SUPPORT_) |
9 | 9 |
10 class SkCanvas; | 10 class SkCanvas; |
11 class SkMatrix; | |
11 class SkPaint; | 12 class SkPaint; |
12 class SkPath; | 13 class SkPath; |
13 class SkPictureRecorder; | 14 class SkPictureRecorder; |
14 struct SkIRect; | 15 struct SkIRect; |
15 | 16 |
16 class CFX_SkiaDeviceDriver : public IFX_RenderDeviceDriver { | 17 class CFX_SkiaDeviceDriver : public IFX_RenderDeviceDriver { |
17 public: | 18 public: |
18 CFX_SkiaDeviceDriver(CFX_DIBitmap* pBitmap, | 19 CFX_SkiaDeviceDriver(CFX_DIBitmap* pBitmap, |
19 int dither_bits, | 20 int dither_bits, |
20 FX_BOOL bRgbByteOrder, | 21 FX_BOOL bRgbByteOrder, |
(...skipping 28 matching lines...) Expand all Loading... | |
49 FX_BOOL DrawPath(const CFX_PathData* pPathData, | 50 FX_BOOL DrawPath(const CFX_PathData* pPathData, |
50 const CFX_Matrix* pObject2Device, | 51 const CFX_Matrix* pObject2Device, |
51 const CFX_GraphStateData* pGraphState, | 52 const CFX_GraphStateData* pGraphState, |
52 FX_DWORD fill_color, | 53 FX_DWORD fill_color, |
53 FX_DWORD stroke_color, | 54 FX_DWORD stroke_color, |
54 int fill_mode, | 55 int fill_mode, |
55 int alpha_flag = 0, | 56 int alpha_flag = 0, |
56 void* pIccTransform = NULL, | 57 void* pIccTransform = NULL, |
57 int blend_type = FXDIB_BLEND_NORMAL) override; | 58 int blend_type = FXDIB_BLEND_NORMAL) override; |
58 | 59 |
59 FX_BOOL SetPixel(int x, | |
60 int y, | |
61 FX_DWORD color, | |
62 int alpha_flag = 0, | |
63 void* pIccTransform = NULL) override; | |
64 | |
65 FX_BOOL FillRect(const FX_RECT* pRect, | 60 FX_BOOL FillRect(const FX_RECT* pRect, |
66 FX_DWORD fill_color, | 61 FX_DWORD fill_color, |
67 int alpha_flag = 0, | 62 int alpha_flag = 0, |
68 void* pIccTransform = NULL, | 63 void* pIccTransform = NULL, |
69 int blend_type = FXDIB_BLEND_NORMAL) override; | 64 int blend_type = FXDIB_BLEND_NORMAL) override; |
70 | 65 |
71 /** Draw a single pixel (device dependant) line */ | 66 /** Draw a single pixel (device dependant) line */ |
72 FX_BOOL DrawCosmeticLine(FX_FLOAT x1, | 67 FX_BOOL DrawCosmeticLine(FX_FLOAT x1, |
73 FX_FLOAT y1, | 68 FX_FLOAT y1, |
74 FX_FLOAT x2, | 69 FX_FLOAT x2, |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
126 FX_BOOL DrawDeviceText(int nChars, | 121 FX_BOOL DrawDeviceText(int nChars, |
127 const FXTEXT_CHARPOS* pCharPos, | 122 const FXTEXT_CHARPOS* pCharPos, |
128 CFX_Font* pFont, | 123 CFX_Font* pFont, |
129 CFX_FontCache* pCache, | 124 CFX_FontCache* pCache, |
130 const CFX_Matrix* pObject2Device, | 125 const CFX_Matrix* pObject2Device, |
131 FX_FLOAT font_size, | 126 FX_FLOAT font_size, |
132 FX_DWORD color, | 127 FX_DWORD color, |
133 int alpha_flag = 0, | 128 int alpha_flag = 0, |
134 void* pIccTransform = NULL) override; | 129 void* pIccTransform = NULL) override; |
135 | 130 |
136 FX_BOOL RenderRasterizer(agg::rasterizer_scanline_aa& rasterizer, | |
137 FX_DWORD color, | |
138 FX_BOOL bFullCover, | |
139 FX_BOOL bGroupKnockout, | |
140 int alpha_flag, | |
141 void* pIccTransform); | |
142 void SetClipMask(agg::rasterizer_scanline_aa& rasterizer); | |
143 void SetClipMask(SkPath& skPath, SkPaint* spaint); | |
144 virtual uint8_t* GetBuffer() const { return m_pAggDriver->GetBuffer(); } | 131 virtual uint8_t* GetBuffer() const { return m_pAggDriver->GetBuffer(); } |
145 void PaintStroke(SkPaint* spaint, const CFX_GraphStateData* pGraphState); | 132 void PaintStroke(SkPaint* spaint, const CFX_GraphStateData* pGraphState, const SkMatrix& matrix); |
Tom Sepez
2016/03/17 16:05:50
nit: 80 cols.
caryclark
2016/03/18 18:22:12
Done.
| |
146 SkPictureRecorder* GetRecorder() const { return m_pRecorder; } | 133 SkPictureRecorder* GetRecorder() const { return m_pRecorder; } |
147 | 134 |
148 private: | 135 private: |
149 CFX_AggDeviceDriver* m_pAggDriver; | 136 CFX_AggDeviceDriver* m_pAggDriver; |
150 SkCanvas* m_pCanvas; | 137 SkCanvas* m_pCanvas; |
151 SkPictureRecorder* const m_pRecorder; | 138 SkPictureRecorder* const m_pRecorder; |
152 int m_ditherBits; | 139 int m_ditherBits; |
153 }; | 140 }; |
154 #endif // defined(_SKIA_SUPPORT_) | 141 #endif // defined(_SKIA_SUPPORT_) |
155 | 142 |
156 #endif // CORE_FXGE_SKIA_FX_SKIA_DEVICE_H_ | 143 #endif // CORE_FXGE_SKIA_FX_SKIA_DEVICE_H_ |
OLD | NEW |