| 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 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
| 6 | 6 |
| 7 #ifndef CORE_FXGE_AGG_FX_AGG_DRIVER_H_ | 7 #ifndef CORE_FXGE_AGG_FX_AGG_DRIVER_H_ |
| 8 #define CORE_FXGE_AGG_FX_AGG_DRIVER_H_ | 8 #define CORE_FXGE_AGG_FX_AGG_DRIVER_H_ |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 ~CAgg_PathData() {} | 26 ~CAgg_PathData() {} |
| 27 void BuildPath(const CFX_PathData* pPathData, | 27 void BuildPath(const CFX_PathData* pPathData, |
| 28 const CFX_Matrix* pObject2Device); | 28 const CFX_Matrix* pObject2Device); |
| 29 | 29 |
| 30 agg::path_storage m_PathData; | 30 agg::path_storage m_PathData; |
| 31 }; | 31 }; |
| 32 | 32 |
| 33 class CFX_AggDeviceDriver : public IFX_RenderDeviceDriver { | 33 class CFX_AggDeviceDriver : public IFX_RenderDeviceDriver { |
| 34 public: | 34 public: |
| 35 CFX_AggDeviceDriver(CFX_DIBitmap* pBitmap, | 35 CFX_AggDeviceDriver(CFX_DIBitmap* pBitmap, |
| 36 FX_BOOL bRgbByteOrder, | 36 bool bRgbByteOrder, |
| 37 CFX_DIBitmap* pOriDevice, | 37 CFX_DIBitmap* pOriDevice, |
| 38 FX_BOOL bGroupKnockout); | 38 bool bGroupKnockout); |
| 39 ~CFX_AggDeviceDriver() override; | 39 ~CFX_AggDeviceDriver() override; |
| 40 | 40 |
| 41 void InitPlatform(); | 41 void InitPlatform(); |
| 42 void DestroyPlatform(); | 42 void DestroyPlatform(); |
| 43 | 43 |
| 44 // IFX_RenderDeviceDriver | 44 // IFX_RenderDeviceDriver |
| 45 int GetDeviceCaps(int caps_id) const override; | 45 int GetDeviceCaps(int caps_id) const override; |
| 46 void SaveState() override; | 46 void SaveState() override; |
| 47 void RestoreState(bool bKeepSaved) override; | 47 void RestoreState(bool bKeepSaved) override; |
| 48 FX_BOOL SetClip_PathFill(const CFX_PathData* pPathData, | 48 bool SetClip_PathFill(const CFX_PathData* pPathData, |
| 49 const CFX_Matrix* pObject2Device, | 49 const CFX_Matrix* pObject2Device, |
| 50 int fill_mode) override; | 50 int fill_mode) override; |
| 51 FX_BOOL SetClip_PathStroke(const CFX_PathData* pPathData, | 51 bool SetClip_PathStroke(const CFX_PathData* pPathData, |
| 52 const CFX_Matrix* pObject2Device, | 52 const CFX_Matrix* pObject2Device, |
| 53 const CFX_GraphStateData* pGraphState) override; | 53 const CFX_GraphStateData* pGraphState) override; |
| 54 FX_BOOL DrawPath(const CFX_PathData* pPathData, | 54 bool DrawPath(const CFX_PathData* pPathData, |
| 55 const CFX_Matrix* pObject2Device, | 55 const CFX_Matrix* pObject2Device, |
| 56 const CFX_GraphStateData* pGraphState, | 56 const CFX_GraphStateData* pGraphState, |
| 57 uint32_t fill_color, | 57 uint32_t fill_color, |
| 58 uint32_t stroke_color, | 58 uint32_t stroke_color, |
| 59 int fill_mode, | 59 int fill_mode, |
| 60 int blend_type) override; |
| 61 bool SetPixel(int x, int y, uint32_t color) override; |
| 62 bool FillRectWithBlend(const FX_RECT* pRect, |
| 63 uint32_t fill_color, |
| 64 int blend_type) override; |
| 65 bool GetClipBox(FX_RECT* pRect) override; |
| 66 bool GetDIBits(CFX_DIBitmap* pBitmap, int left, int top) override; |
| 67 CFX_DIBitmap* GetBackDrop() override; |
| 68 bool SetDIBits(const CFX_DIBSource* pBitmap, |
| 69 uint32_t color, |
| 70 const FX_RECT* pSrcRect, |
| 71 int left, |
| 72 int top, |
| 73 int blend_type) override; |
| 74 bool StretchDIBits(const CFX_DIBSource* pBitmap, |
| 75 uint32_t color, |
| 76 int dest_left, |
| 77 int dest_top, |
| 78 int dest_width, |
| 79 int dest_height, |
| 80 const FX_RECT* pClipRect, |
| 81 uint32_t flags, |
| 82 int blend_type) override; |
| 83 bool StartDIBits(const CFX_DIBSource* pBitmap, |
| 84 int bitmap_alpha, |
| 85 uint32_t color, |
| 86 const CFX_Matrix* pMatrix, |
| 87 uint32_t flags, |
| 88 void*& handle, |
| 60 int blend_type) override; | 89 int blend_type) override; |
| 61 FX_BOOL SetPixel(int x, int y, uint32_t color) override; | 90 bool ContinueDIBits(void* handle, IFX_Pause* pPause) override; |
| 62 FX_BOOL FillRectWithBlend(const FX_RECT* pRect, | |
| 63 uint32_t fill_color, | |
| 64 int blend_type) override; | |
| 65 FX_BOOL GetClipBox(FX_RECT* pRect) override; | |
| 66 FX_BOOL GetDIBits(CFX_DIBitmap* pBitmap, int left, int top) override; | |
| 67 CFX_DIBitmap* GetBackDrop() override; | |
| 68 FX_BOOL SetDIBits(const CFX_DIBSource* pBitmap, | |
| 69 uint32_t color, | |
| 70 const FX_RECT* pSrcRect, | |
| 71 int left, | |
| 72 int top, | |
| 73 int blend_type) override; | |
| 74 FX_BOOL StretchDIBits(const CFX_DIBSource* pBitmap, | |
| 75 uint32_t color, | |
| 76 int dest_left, | |
| 77 int dest_top, | |
| 78 int dest_width, | |
| 79 int dest_height, | |
| 80 const FX_RECT* pClipRect, | |
| 81 uint32_t flags, | |
| 82 int blend_type) override; | |
| 83 FX_BOOL StartDIBits(const CFX_DIBSource* pBitmap, | |
| 84 int bitmap_alpha, | |
| 85 uint32_t color, | |
| 86 const CFX_Matrix* pMatrix, | |
| 87 uint32_t flags, | |
| 88 void*& handle, | |
| 89 int blend_type) override; | |
| 90 FX_BOOL ContinueDIBits(void* handle, IFX_Pause* pPause) override; | |
| 91 void CancelDIBits(void* handle) override; | 91 void CancelDIBits(void* handle) override; |
| 92 FX_BOOL DrawDeviceText(int nChars, | 92 bool DrawDeviceText(int nChars, |
| 93 const FXTEXT_CHARPOS* pCharPos, | 93 const FXTEXT_CHARPOS* pCharPos, |
| 94 CFX_Font* pFont, | 94 CFX_Font* pFont, |
| 95 const CFX_Matrix* pObject2Device, | 95 const CFX_Matrix* pObject2Device, |
| 96 FX_FLOAT font_size, | 96 FX_FLOAT font_size, |
| 97 uint32_t color) override; | 97 uint32_t color) override; |
| 98 int GetDriverType() const override; | 98 int GetDriverType() const override; |
| 99 | 99 |
| 100 FX_BOOL RenderRasterizer(agg::rasterizer_scanline_aa& rasterizer, | 100 bool RenderRasterizer(agg::rasterizer_scanline_aa& rasterizer, |
| 101 uint32_t color, | 101 uint32_t color, |
| 102 FX_BOOL bFullCover, | 102 bool bFullCover, |
| 103 FX_BOOL bGroupKnockout, | 103 bool bGroupKnockout, |
| 104 int alpha_flag, | 104 int alpha_flag, |
| 105 void* pIccTransform); | 105 void* pIccTransform); |
| 106 | 106 |
| 107 void SetClipMask(agg::rasterizer_scanline_aa& rasterizer); | 107 void SetClipMask(agg::rasterizer_scanline_aa& rasterizer); |
| 108 | 108 |
| 109 virtual uint8_t* GetBuffer() const; | 109 virtual uint8_t* GetBuffer() const; |
| 110 | 110 |
| 111 private: | 111 private: |
| 112 CFX_DIBitmap* m_pBitmap; | 112 CFX_DIBitmap* m_pBitmap; |
| 113 std::unique_ptr<CFX_ClipRgn> m_pClipRgn; | 113 std::unique_ptr<CFX_ClipRgn> m_pClipRgn; |
| 114 std::vector<std::unique_ptr<CFX_ClipRgn>> m_StateStack; | 114 std::vector<std::unique_ptr<CFX_ClipRgn>> m_StateStack; |
| 115 #if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ | 115 #if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ |
| 116 void* m_pPlatformGraphics; | 116 void* m_pPlatformGraphics; |
| 117 #endif | 117 #endif |
| 118 int m_FillFlags; | 118 int m_FillFlags; |
| 119 FX_BOOL m_bRgbByteOrder; | 119 bool m_bRgbByteOrder; |
| 120 CFX_DIBitmap* m_pOriDevice; | 120 CFX_DIBitmap* m_pOriDevice; |
| 121 FX_BOOL m_bGroupKnockout; | 121 bool m_bGroupKnockout; |
| 122 }; | 122 }; |
| 123 | 123 |
| 124 #endif // CORE_FXGE_AGG_FX_AGG_DRIVER_H_ | 124 #endif // CORE_FXGE_AGG_FX_AGG_DRIVER_H_ |
| OLD | NEW |