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