blob: f1082fb39a37912b56df42055e99fac10eb4b9fa [file] [log] [blame]
Dan Sinclair1770c022016-03-14 14:14:16 -04001// 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 Sinclaird9828fd2017-03-30 10:58:49 -04007#ifndef XFA_FDE_CFDE_RENDERDEVICE_H_
8#define XFA_FDE_CFDE_RENDERDEVICE_H_
Dan Sinclair1770c022016-03-14 14:14:16 -04009
tsepez6db6fbc2017-01-20 12:22:16 -080010#include <vector>
11
dsinclair74a34fc2016-09-29 16:41:42 -070012#include "core/fxge/cfx_renderdevice.h"
tsepeze6477992017-01-05 12:57:00 -080013#include "xfa/fgas/font/cfgas_gefont.h"
Dan Sinclair1770c022016-03-14 14:14:16 -040014
dsinclairacd0d592016-04-21 11:06:27 -070015class CFDE_Path;
npm9ada2d82016-08-10 07:51:38 -070016class CFX_GraphStateData;
dsinclairacd0d592016-04-21 11:06:27 -070017
Dan Sinclair0cb9b8c2017-01-10 16:38:10 -050018class CFDE_RenderDevice {
Dan Sinclair1770c022016-03-14 14:14:16 -040019 public:
Tom Sepez36533352017-05-16 15:40:23 -070020 explicit CFDE_RenderDevice(CFX_RenderDevice* pDevice);
Dan Sinclair0cb9b8c2017-01-10 16:38:10 -050021 ~CFDE_RenderDevice();
Dan Sinclair1770c022016-03-14 14:14:16 -040022
dsinclairacd0d592016-04-21 11:06:27 -070023 int32_t GetWidth() const;
24 int32_t GetHeight() const;
Dan Sinclairbe993d22017-08-09 16:24:24 -040025
dsinclairfe433f12016-06-06 12:03:31 -070026 void SaveState();
27 void RestoreState();
Dan Sinclairbe993d22017-08-09 16:24:24 -040028
tsepezd19e9122016-11-02 15:43:18 -070029 bool SetClipRect(const CFX_RectF& rtClip);
dsinclairacd0d592016-04-21 11:06:27 -070030 const CFX_RectF& GetClipRect();
Dan Sinclair1770c022016-03-14 14:14:16 -040031
Dan Sinclair17aa0572017-08-09 16:09:51 -040032 bool DrawString(FX_ARGB color,
tsepeze6477992017-01-05 12:57:00 -080033 const CFX_RetainPtr<CFGAS_GEFont>& pFont,
tsepezd19e9122016-11-02 15:43:18 -070034 const FXTEXT_CHARPOS* pCharPos,
35 int32_t iCount,
Dan Sinclair05df0752017-03-14 14:43:42 -040036 float fFontSize,
Dan Sinclair4454ce72017-08-09 17:23:36 -040037 const CFX_Matrix* pMatrix);
Dan Sinclair17aa0572017-08-09 16:09:51 -040038 bool DrawPath(FX_ARGB color,
Dan Sinclair05df0752017-03-14 14:43:42 -040039 float fPenWidth,
tsepezd19e9122016-11-02 15:43:18 -070040 const CFDE_Path* pPath,
Dan Sinclair4454ce72017-08-09 17:23:36 -040041 const CFX_Matrix* pMatrix);
Dan Sinclair1770c022016-03-14 14:14:16 -040042
Dan Sinclair17aa0572017-08-09 16:09:51 -040043 private:
weilicddf8252016-08-04 15:43:59 -070044 CFX_RenderDevice* const m_pDevice;
Dan Sinclair1770c022016-03-14 14:14:16 -040045 CFX_RectF m_rtClip;
Dan Sinclair1770c022016-03-14 14:14:16 -040046};
47
Dan Sinclaird9828fd2017-03-30 10:58:49 -040048#endif // XFA_FDE_CFDE_RENDERDEVICE_H_