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_ || defined _SKIA_SUPPORT_PATHS_ | 8 #if defined _SKIA_SUPPORT_ || defined _SKIA_SUPPORT_PATHS_ |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 const FX_RECT& clip_rect, | 145 const FX_RECT& clip_rect, |
146 int alpha, | 146 int alpha, |
147 bool bAlphaMode) override; | 147 bool bAlphaMode) override; |
148 | 148 |
149 virtual uint8_t* GetBuffer() const; | 149 virtual uint8_t* GetBuffer() const; |
150 | 150 |
151 void PaintStroke(SkPaint* spaint, | 151 void PaintStroke(SkPaint* spaint, |
152 const CFX_GraphStateData* pGraphState, | 152 const CFX_GraphStateData* pGraphState, |
153 const SkMatrix& matrix); | 153 const SkMatrix& matrix); |
154 void Clear(uint32_t color); | 154 void Clear(uint32_t color); |
155 void Flush(); | 155 void Flush() override; |
156 SkPictureRecorder* GetRecorder() const { return m_pRecorder; } | 156 SkPictureRecorder* GetRecorder() const { return m_pRecorder; } |
| 157 void PreMultiply() { m_pBitmap->PreMultiply(); } |
157 static void PreMultiply(CFX_DIBitmap* pDIBitmap); | 158 static void PreMultiply(CFX_DIBitmap* pDIBitmap); |
158 SkCanvas* SkiaCanvas() { return m_pCanvas; } | 159 SkCanvas* SkiaCanvas() { return m_pCanvas; } |
159 void DebugVerifyBitmapIsPreMultiplied() const; | 160 void DebugVerifyBitmapIsPreMultiplied() const; |
160 void Dump() const; | 161 void Dump() const; |
161 | 162 |
162 private: | 163 private: |
163 friend class SkiaState; | 164 friend class SkiaState; |
164 | 165 |
165 CFX_DIBitmap* m_pBitmap; | 166 CFX_DIBitmap* m_pBitmap; |
166 CFX_DIBitmap* m_pOriDevice; | 167 CFX_DIBitmap* m_pOriDevice; |
167 SkCanvas* m_pCanvas; | 168 SkCanvas* m_pCanvas; |
168 SkPictureRecorder* const m_pRecorder; | 169 SkPictureRecorder* const m_pRecorder; |
169 #ifdef _SKIA_SUPPORT_ | |
170 std::unique_ptr<SkiaState> m_pCache; | 170 std::unique_ptr<SkiaState> m_pCache; |
171 #endif | |
172 #ifdef _SKIA_SUPPORT_PATHS_ | 171 #ifdef _SKIA_SUPPORT_PATHS_ |
173 std::unique_ptr<CFX_ClipRgn> m_pClipRgn; | 172 std::unique_ptr<CFX_ClipRgn> m_pClipRgn; |
174 std::vector<std::unique_ptr<CFX_ClipRgn>> m_StateStack; | 173 std::vector<std::unique_ptr<CFX_ClipRgn>> m_StateStack; |
175 int m_FillFlags; | 174 int m_FillFlags; |
176 bool m_bRgbByteOrder; | 175 bool m_bRgbByteOrder; |
177 #endif | 176 #endif |
178 bool m_bGroupKnockout; | 177 bool m_bGroupKnockout; |
179 }; | 178 }; |
180 #endif // defined(_SKIA_SUPPORT_) | 179 #endif // defined _SKIA_SUPPORT_ || defined _SKIA_SUPPORT_PATHS_ |
181 | 180 |
182 #endif // CORE_FXGE_SKIA_FX_SKIA_DEVICE_H_ | 181 #endif // CORE_FXGE_SKIA_FX_SKIA_DEVICE_H_ |
OLD | NEW |