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; |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 override; | 46 override; |
47 | 47 |
48 /** Draw a path */ | 48 /** Draw a path */ |
49 FX_BOOL DrawPath(const CFX_PathData* pPathData, | 49 FX_BOOL DrawPath(const CFX_PathData* pPathData, |
50 const CFX_Matrix* pObject2Device, | 50 const CFX_Matrix* pObject2Device, |
51 const CFX_GraphStateData* pGraphState, | 51 const CFX_GraphStateData* pGraphState, |
52 uint32_t fill_color, | 52 uint32_t fill_color, |
53 uint32_t stroke_color, | 53 uint32_t stroke_color, |
54 int fill_mode, | 54 int fill_mode, |
55 int alpha_flag = 0, | 55 int alpha_flag = 0, |
56 void* pIccTransform = NULL, | 56 void* pIccTransform = nullptr, |
57 int blend_type = FXDIB_BLEND_NORMAL) override; | 57 int blend_type = FXDIB_BLEND_NORMAL) override; |
58 | 58 |
59 FX_BOOL FillRect(const FX_RECT* pRect, | 59 FX_BOOL FillRect(const FX_RECT* pRect, |
60 uint32_t fill_color, | 60 uint32_t fill_color, |
61 int alpha_flag = 0, | 61 int alpha_flag = 0, |
62 void* pIccTransform = NULL, | 62 void* pIccTransform = nullptr, |
63 int blend_type = FXDIB_BLEND_NORMAL) override; | 63 int blend_type = FXDIB_BLEND_NORMAL) override; |
64 | 64 |
65 /** Draw a single pixel (device dependant) line */ | 65 /** Draw a single pixel (device dependant) line */ |
66 FX_BOOL DrawCosmeticLine(FX_FLOAT x1, | 66 FX_BOOL DrawCosmeticLine(FX_FLOAT x1, |
67 FX_FLOAT y1, | 67 FX_FLOAT y1, |
68 FX_FLOAT x2, | 68 FX_FLOAT x2, |
69 FX_FLOAT y2, | 69 FX_FLOAT y2, |
70 uint32_t color, | 70 uint32_t color, |
71 int alpha_flag = 0, | 71 int alpha_flag = 0, |
72 void* pIccTransform = NULL, | 72 void* pIccTransform = nullptr, |
73 int blend_type = FXDIB_BLEND_NORMAL) override { | 73 int blend_type = FXDIB_BLEND_NORMAL) override { |
74 return FALSE; | 74 return FALSE; |
75 } | 75 } |
76 | 76 |
77 FX_BOOL GetClipBox(FX_RECT* pRect) override; | 77 FX_BOOL GetClipBox(FX_RECT* pRect) override; |
78 | 78 |
79 /** Load device buffer into a DIB */ | 79 /** Load device buffer into a DIB */ |
80 FX_BOOL GetDIBits(CFX_DIBitmap* pBitmap, | 80 FX_BOOL GetDIBits(CFX_DIBitmap* pBitmap, |
81 int left, | 81 int left, |
82 int top, | 82 int top, |
83 void* pIccTransform = NULL, | 83 void* pIccTransform = nullptr, |
84 FX_BOOL bDEdge = FALSE) override; | 84 FX_BOOL bDEdge = FALSE) override; |
85 | 85 |
86 CFX_DIBitmap* GetBackDrop() override { return m_pOriDevice; } | 86 CFX_DIBitmap* GetBackDrop() override { return m_pOriDevice; } |
87 | 87 |
88 FX_BOOL SetDIBits(const CFX_DIBSource* pBitmap, | 88 FX_BOOL SetDIBits(const CFX_DIBSource* pBitmap, |
89 uint32_t color, | 89 uint32_t color, |
90 const FX_RECT* pSrcRect, | 90 const FX_RECT* pSrcRect, |
91 int dest_left, | 91 int dest_left, |
92 int dest_top, | 92 int dest_top, |
93 int blend_type, | 93 int blend_type, |
94 int alpha_flag = 0, | 94 int alpha_flag = 0, |
95 void* pIccTransform = NULL) override; | 95 void* pIccTransform = nullptr) override; |
96 FX_BOOL StretchDIBits(const CFX_DIBSource* pBitmap, | 96 FX_BOOL StretchDIBits(const CFX_DIBSource* pBitmap, |
97 uint32_t color, | 97 uint32_t color, |
98 int dest_left, | 98 int dest_left, |
99 int dest_top, | 99 int dest_top, |
100 int dest_width, | 100 int dest_width, |
101 int dest_height, | 101 int dest_height, |
102 const FX_RECT* pClipRect, | 102 const FX_RECT* pClipRect, |
103 uint32_t flags, | 103 uint32_t flags, |
104 int alpha_flag = 0, | 104 int alpha_flag = 0, |
105 void* pIccTransform = NULL, | 105 void* pIccTransform = nullptr, |
106 int blend_type = FXDIB_BLEND_NORMAL) override; | 106 int blend_type = FXDIB_BLEND_NORMAL) override; |
107 | 107 |
108 FX_BOOL StartDIBits(const CFX_DIBSource* pBitmap, | 108 FX_BOOL StartDIBits(const CFX_DIBSource* pBitmap, |
109 int bitmap_alpha, | 109 int bitmap_alpha, |
110 uint32_t color, | 110 uint32_t color, |
111 const CFX_Matrix* pMatrix, | 111 const CFX_Matrix* pMatrix, |
112 uint32_t flags, | 112 uint32_t flags, |
113 void*& handle, | 113 void*& handle, |
114 int alpha_flag = 0, | 114 int alpha_flag = 0, |
115 void* pIccTransform = NULL, | 115 void* pIccTransform = nullptr, |
116 int blend_type = FXDIB_BLEND_NORMAL) override; | 116 int blend_type = FXDIB_BLEND_NORMAL) override; |
117 | 117 |
118 FX_BOOL ContinueDIBits(void* handle, IFX_Pause* pPause) override { | 118 FX_BOOL ContinueDIBits(void* handle, IFX_Pause* pPause) override { |
119 return FALSE; | 119 return FALSE; |
120 } | 120 } |
121 | 121 |
122 void CancelDIBits(void* handle) override {} | 122 void CancelDIBits(void* handle) override {} |
123 | 123 |
124 FX_BOOL DrawDeviceText(int nChars, | 124 FX_BOOL DrawDeviceText(int nChars, |
125 const FXTEXT_CHARPOS* pCharPos, | 125 const FXTEXT_CHARPOS* pCharPos, |
126 CFX_Font* pFont, | 126 CFX_Font* pFont, |
127 CFX_FontCache* pCache, | 127 CFX_FontCache* pCache, |
128 const CFX_Matrix* pObject2Device, | 128 const CFX_Matrix* pObject2Device, |
129 FX_FLOAT font_size, | 129 FX_FLOAT font_size, |
130 uint32_t color, | 130 uint32_t color, |
131 int alpha_flag = 0, | 131 int alpha_flag = 0, |
132 void* pIccTransform = NULL) override; | 132 void* pIccTransform = nullptr) override; |
133 | 133 |
134 FX_BOOL DrawShading(const CPDF_ShadingPattern* pPattern, | 134 FX_BOOL DrawShading(const CPDF_ShadingPattern* pPattern, |
135 const CFX_Matrix* pMatrix, | 135 const CFX_Matrix* pMatrix, |
136 const FX_RECT& clip_rect, | 136 const FX_RECT& clip_rect, |
137 int alpha, | 137 int alpha, |
138 FX_BOOL bAlphaMode) override; | 138 FX_BOOL bAlphaMode) override; |
139 | 139 |
140 virtual uint8_t* GetBuffer() const { return m_pBitmap->GetBuffer(); } | 140 virtual uint8_t* GetBuffer() const { return m_pBitmap->GetBuffer(); } |
141 void PaintStroke(SkPaint* spaint, | 141 void PaintStroke(SkPaint* spaint, |
142 const CFX_GraphStateData* pGraphState, | 142 const CFX_GraphStateData* pGraphState, |
143 const SkMatrix& matrix); | 143 const SkMatrix& matrix); |
144 SkPictureRecorder* GetRecorder() const { return m_pRecorder; } | 144 SkPictureRecorder* GetRecorder() const { return m_pRecorder; } |
145 void PreMultiply(); | 145 void PreMultiply(); |
146 | 146 |
147 private: | 147 private: |
148 CFX_DIBitmap* m_pBitmap; | 148 CFX_DIBitmap* m_pBitmap; |
149 CFX_DIBitmap* m_pOriDevice; | 149 CFX_DIBitmap* m_pOriDevice; |
150 SkCanvas* m_pCanvas; | 150 SkCanvas* m_pCanvas; |
151 SkPictureRecorder* const m_pRecorder; | 151 SkPictureRecorder* const m_pRecorder; |
152 FX_BOOL m_bRgbByteOrder; | 152 FX_BOOL m_bRgbByteOrder; |
153 FX_BOOL m_bGroupKnockout; | 153 FX_BOOL m_bGroupKnockout; |
154 }; | 154 }; |
155 #endif // defined(_SKIA_SUPPORT_) | 155 #endif // defined(_SKIA_SUPPORT_) |
156 | 156 |
157 #endif // CORE_FXGE_SKIA_FX_SKIA_DEVICE_H_ | 157 #endif // CORE_FXGE_SKIA_FX_SKIA_DEVICE_H_ |
OLD | NEW |