summaryrefslogtreecommitdiff
path: root/xfa/fde/cfde_renderdevice.h
blob: 0f0ce9e1cd5663f0ce323e45b07bfc7101357c24 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
// Copyright 2014 PDFium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com

#ifndef XFA_FDE_CFDE_RENDERDEVICE_H_
#define XFA_FDE_CFDE_RENDERDEVICE_H_

#include <vector>

#include "core/fxge/cfx_renderdevice.h"
#include "xfa/fgas/font/cfgas_gefont.h"

class CFDE_Path;
class CFX_GraphStateData;

class CFDE_RenderDevice {
 public:
  explicit CFDE_RenderDevice(CFX_RenderDevice* pDevice);
  ~CFDE_RenderDevice();

  int32_t GetWidth() const;
  int32_t GetHeight() const;

  void SaveState();
  void RestoreState();

  bool SetClipRect(const CFX_RectF& rtClip);
  const CFX_RectF& GetClipRect();

  bool DrawString(FX_ARGB color,
                  const CFX_RetainPtr<CFGAS_GEFont>& pFont,
                  const FXTEXT_CHARPOS* pCharPos,
                  int32_t iCount,
                  float fFontSize,
                  const CFX_Matrix* pMatrix = nullptr);
  bool DrawPath(FX_ARGB color,
                float fPenWidth,
                const CFDE_Path* pPath,
                const CFX_Matrix* pMatrix = nullptr);

 private:
  CFX_RenderDevice* const m_pDevice;
  CFX_RectF m_rtClip;
};

#endif  // XFA_FDE_CFDE_RENDERDEVICE_H_