Dan Sinclair | 1770c02 | 2016-03-14 14:14:16 -0400 | [diff] [blame] | 1 | // Copyright 2014 PDFium Authors. All rights reserved. |
2 | // Use of this source code is governed by a BSD-style license that can be | ||||
3 | // found in the LICENSE file. | ||||
4 | |||||
5 | // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | ||||
6 | |||||
Dan Sinclair | d9828fd | 2017-03-30 10:58:49 -0400 | [diff] [blame] | 7 | #ifndef XFA_FDE_CFDE_RENDERDEVICE_H_ |
8 | #define XFA_FDE_CFDE_RENDERDEVICE_H_ | ||||
Dan Sinclair | 1770c02 | 2016-03-14 14:14:16 -0400 | [diff] [blame] | 9 | |
tsepez | 6db6fbc | 2017-01-20 12:22:16 -0800 | [diff] [blame] | 10 | #include <vector> |
11 | |||||
dsinclair | 74a34fc | 2016-09-29 16:41:42 -0700 | [diff] [blame] | 12 | #include "core/fxge/cfx_renderdevice.h" |
tsepez | e647799 | 2017-01-05 12:57:00 -0800 | [diff] [blame] | 13 | #include "xfa/fgas/font/cfgas_gefont.h" |
Dan Sinclair | 1770c02 | 2016-03-14 14:14:16 -0400 | [diff] [blame] | 14 | |
dsinclair | acd0d59 | 2016-04-21 11:06:27 -0700 | [diff] [blame] | 15 | class CFDE_Path; |
npm | 9ada2d8 | 2016-08-10 07:51:38 -0700 | [diff] [blame] | 16 | class CFX_GraphStateData; |
dsinclair | acd0d59 | 2016-04-21 11:06:27 -0700 | [diff] [blame] | 17 | |
Dan Sinclair | 0cb9b8c | 2017-01-10 16:38:10 -0500 | [diff] [blame] | 18 | class CFDE_RenderDevice { |
Dan Sinclair | 1770c02 | 2016-03-14 14:14:16 -0400 | [diff] [blame] | 19 | public: |
Tom Sepez | 3653335 | 2017-05-16 15:40:23 -0700 | [diff] [blame] | 20 | explicit CFDE_RenderDevice(CFX_RenderDevice* pDevice); |
Dan Sinclair | 0cb9b8c | 2017-01-10 16:38:10 -0500 | [diff] [blame] | 21 | ~CFDE_RenderDevice(); |
Dan Sinclair | 1770c02 | 2016-03-14 14:14:16 -0400 | [diff] [blame] | 22 | |
dsinclair | acd0d59 | 2016-04-21 11:06:27 -0700 | [diff] [blame] | 23 | int32_t GetWidth() const; |
24 | int32_t GetHeight() const; | ||||
Dan Sinclair | be993d2 | 2017-08-09 16:24:24 -0400 | [diff] [blame] | 25 | |
dsinclair | fe433f1 | 2016-06-06 12:03:31 -0700 | [diff] [blame] | 26 | void SaveState(); |
27 | void RestoreState(); | ||||
Dan Sinclair | be993d2 | 2017-08-09 16:24:24 -0400 | [diff] [blame] | 28 | |
tsepez | d19e912 | 2016-11-02 15:43:18 -0700 | [diff] [blame] | 29 | bool SetClipRect(const CFX_RectF& rtClip); |
dsinclair | acd0d59 | 2016-04-21 11:06:27 -0700 | [diff] [blame] | 30 | const CFX_RectF& GetClipRect(); |
Dan Sinclair | 1770c02 | 2016-03-14 14:14:16 -0400 | [diff] [blame] | 31 | |
Dan Sinclair | 17aa057 | 2017-08-09 16:09:51 -0400 | [diff] [blame] | 32 | bool DrawString(FX_ARGB color, |
tsepez | e647799 | 2017-01-05 12:57:00 -0800 | [diff] [blame] | 33 | const CFX_RetainPtr<CFGAS_GEFont>& pFont, |
tsepez | d19e912 | 2016-11-02 15:43:18 -0700 | [diff] [blame] | 34 | const FXTEXT_CHARPOS* pCharPos, |
35 | int32_t iCount, | ||||
Dan Sinclair | 05df075 | 2017-03-14 14:43:42 -0400 | [diff] [blame] | 36 | float fFontSize, |
Dan Sinclair | 4454ce7 | 2017-08-09 17:23:36 -0400 | [diff] [blame^] | 37 | const CFX_Matrix* pMatrix); |
Dan Sinclair | 17aa057 | 2017-08-09 16:09:51 -0400 | [diff] [blame] | 38 | bool DrawPath(FX_ARGB color, |
Dan Sinclair | 05df075 | 2017-03-14 14:43:42 -0400 | [diff] [blame] | 39 | float fPenWidth, |
tsepez | d19e912 | 2016-11-02 15:43:18 -0700 | [diff] [blame] | 40 | const CFDE_Path* pPath, |
Dan Sinclair | 4454ce7 | 2017-08-09 17:23:36 -0400 | [diff] [blame^] | 41 | const CFX_Matrix* pMatrix); |
Dan Sinclair | 1770c02 | 2016-03-14 14:14:16 -0400 | [diff] [blame] | 42 | |
Dan Sinclair | 17aa057 | 2017-08-09 16:09:51 -0400 | [diff] [blame] | 43 | private: |
weili | cddf825 | 2016-08-04 15:43:59 -0700 | [diff] [blame] | 44 | CFX_RenderDevice* const m_pDevice; |
Dan Sinclair | 1770c02 | 2016-03-14 14:14:16 -0400 | [diff] [blame] | 45 | CFX_RectF m_rtClip; |
Dan Sinclair | 1770c02 | 2016-03-14 14:14:16 -0400 | [diff] [blame] | 46 | }; |
47 | |||||
Dan Sinclair | d9828fd | 2017-03-30 10:58:49 -0400 | [diff] [blame] | 48 | #endif // XFA_FDE_CFDE_RENDERDEVICE_H_ |