| 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 #include "core/fxge/include/cfx_pathdata.h" | 10 #include "core/fxge/include/cfx_pathdata.h" |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 FX_BOOL GetDIBits(CFX_DIBitmap* pBitmap, int left, int top) override; | 77 FX_BOOL GetDIBits(CFX_DIBitmap* pBitmap, int left, int top) override; |
| 78 | 78 |
| 79 CFX_DIBitmap* GetBackDrop() override; | 79 CFX_DIBitmap* GetBackDrop() override; |
| 80 | 80 |
| 81 FX_BOOL SetDIBits(const CFX_DIBSource* pBitmap, | 81 FX_BOOL SetDIBits(const CFX_DIBSource* pBitmap, |
| 82 uint32_t color, | 82 uint32_t color, |
| 83 const FX_RECT* pSrcRect, | 83 const FX_RECT* pSrcRect, |
| 84 int dest_left, | 84 int dest_left, |
| 85 int dest_top, | 85 int dest_top, |
| 86 int blend_type) override; | 86 int blend_type) override; |
| 87 bool SetBitsWithMask(const CFX_DIBSource* pBitmap, |
| 88 const CFX_DIBSource* pMask, |
| 89 int dest_left, |
| 90 int dest_top, |
| 91 int bitmap_alpha, |
| 92 int blend_type) override; |
| 87 FX_BOOL StretchDIBits(const CFX_DIBSource* pBitmap, | 93 FX_BOOL StretchDIBits(const CFX_DIBSource* pBitmap, |
| 88 uint32_t color, | 94 uint32_t color, |
| 89 int dest_left, | 95 int dest_left, |
| 90 int dest_top, | 96 int dest_top, |
| 91 int dest_width, | 97 int dest_width, |
| 92 int dest_height, | 98 int dest_height, |
| 93 const FX_RECT* pClipRect, | 99 const FX_RECT* pClipRect, |
| 94 uint32_t flags, | 100 uint32_t flags, |
| 95 int blend_type) override; | 101 int blend_type) override; |
| 96 | 102 |
| 97 FX_BOOL StartDIBits(const CFX_DIBSource* pBitmap, | 103 FX_BOOL StartDIBits(const CFX_DIBSource* pBitmap, |
| 98 int bitmap_alpha, | 104 int bitmap_alpha, |
| 99 uint32_t color, | 105 uint32_t color, |
| 100 const CFX_Matrix* pMatrix, | 106 const CFX_Matrix* pMatrix, |
| 101 uint32_t flags, | 107 uint32_t flags, |
| 102 void*& handle, | 108 void*& handle, |
| 103 int blend_type) override; | 109 int blend_type) override; |
| 104 | 110 |
| 105 FX_BOOL ContinueDIBits(void* handle, IFX_Pause* pPause) override; | 111 FX_BOOL ContinueDIBits(void* handle, IFX_Pause* pPause) override; |
| 106 | 112 |
| 107 void CancelDIBits(void* handle) override {} | 113 void CancelDIBits(void* handle) override {} |
| 108 | 114 |
| 115 bool DrawBitsWithMask(const CFX_DIBSource* pBitmap, |
| 116 const CFX_DIBSource* pMask, |
| 117 int bitmap_alpha, |
| 118 const CFX_Matrix* pMatrix, |
| 119 int blend_type); |
| 120 |
| 109 FX_BOOL DrawDeviceText(int nChars, | 121 FX_BOOL DrawDeviceText(int nChars, |
| 110 const FXTEXT_CHARPOS* pCharPos, | 122 const FXTEXT_CHARPOS* pCharPos, |
| 111 CFX_Font* pFont, | 123 CFX_Font* pFont, |
| 112 CFX_FontCache* pCache, | 124 CFX_FontCache* pCache, |
| 113 const CFX_Matrix* pObject2Device, | 125 const CFX_Matrix* pObject2Device, |
| 114 FX_FLOAT font_size, | 126 FX_FLOAT font_size, |
| 115 uint32_t color) override; | 127 uint32_t color) override; |
| 116 | 128 |
| 117 FX_BOOL DrawShading(const CPDF_ShadingPattern* pPattern, | 129 FX_BOOL DrawShading(const CPDF_ShadingPattern* pPattern, |
| 118 const CFX_Matrix* pMatrix, | 130 const CFX_Matrix* pMatrix, |
| 119 const FX_RECT& clip_rect, | 131 const FX_RECT& clip_rect, |
| 120 int alpha, | 132 int alpha, |
| 121 FX_BOOL bAlphaMode) override; | 133 FX_BOOL bAlphaMode) override; |
| 122 | 134 |
| 123 virtual uint8_t* GetBuffer() const; | 135 virtual uint8_t* GetBuffer() const; |
| 124 | 136 |
| 125 void PaintStroke(SkPaint* spaint, | 137 void PaintStroke(SkPaint* spaint, |
| 126 const CFX_GraphStateData* pGraphState, | 138 const CFX_GraphStateData* pGraphState, |
| 127 const SkMatrix& matrix); | 139 const SkMatrix& matrix); |
| 140 void Clear(uint32_t color); |
| 128 void Flush(); | 141 void Flush(); |
| 129 SkPictureRecorder* GetRecorder() const { return m_pRecorder; } | 142 SkPictureRecorder* GetRecorder() const { return m_pRecorder; } |
| 130 static void PreMultiply(CFX_DIBitmap* pDIBitmap); | 143 static void PreMultiply(CFX_DIBitmap* pDIBitmap); |
| 131 SkCanvas* SkiaCanvas() { return m_pCanvas; } | 144 SkCanvas* SkiaCanvas() { return m_pCanvas; } |
| 132 void DebugVerifyBitmapIsPreMultiplied() const; | 145 void DebugVerifyBitmapIsPreMultiplied() const; |
| 133 void Dump() const; | 146 void Dump() const; |
| 134 | 147 |
| 135 private: | 148 private: |
| 136 friend class SkiaState; | 149 friend class SkiaState; |
| 137 | 150 |
| 138 CFX_DIBitmap* m_pBitmap; | 151 CFX_DIBitmap* m_pBitmap; |
| 139 CFX_DIBitmap* m_pOriDevice; | 152 CFX_DIBitmap* m_pOriDevice; |
| 140 SkCanvas* m_pCanvas; | 153 SkCanvas* m_pCanvas; |
| 141 SkPictureRecorder* const m_pRecorder; | 154 SkPictureRecorder* const m_pRecorder; |
| 142 std::unique_ptr<SkiaState> m_pCache; | 155 std::unique_ptr<SkiaState> m_pCache; |
| 143 FX_BOOL m_bGroupKnockout; | 156 FX_BOOL m_bGroupKnockout; |
| 144 }; | 157 }; |
| 145 #endif // defined(_SKIA_SUPPORT_) | 158 #endif // defined(_SKIA_SUPPORT_) |
| 146 | 159 |
| 147 #endif // CORE_FXGE_SKIA_FX_SKIA_DEVICE_H_ | 160 #endif // CORE_FXGE_SKIA_FX_SKIA_DEVICE_H_ |
| OLD | NEW |