Chromium Code Reviews| 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 XFA_FDE_FDE_GEDEVICE_H_ | 7 #ifndef XFA_FDE_FDE_GEDEVICE_H_ |
| 8 #define XFA_FDE_FDE_GEDEVICE_H_ | 8 #define XFA_FDE_FDE_GEDEVICE_H_ |
| 9 | 9 |
| 10 #include "core/fxge/cfx_renderdevice.h" | 10 #include "core/fxge/cfx_renderdevice.h" |
| 11 #include "xfa/fgas/crt/fgas_memory.h" | 11 #include "xfa/fgas/crt/fgas_memory.h" |
| 12 #include "xfa/fgas/font/cfgas_gefont.h" | |
| 12 | 13 |
| 13 class CFDE_Brush; | 14 class CFDE_Brush; |
| 14 class CFDE_Path; | 15 class CFDE_Path; |
| 15 class CFDE_Pen; | 16 class CFDE_Pen; |
| 16 class CFGAS_GEFont; | |
| 17 class CFX_GraphStateData; | 17 class CFX_GraphStateData; |
| 18 | 18 |
| 19 class CFDE_RenderDevice : public CFX_Target { | 19 class CFDE_RenderDevice : public CFX_Target { |
| 20 public: | 20 public: |
| 21 CFDE_RenderDevice(CFX_RenderDevice* pDevice, bool bOwnerDevice); | 21 CFDE_RenderDevice(CFX_RenderDevice* pDevice, bool bOwnerDevice); |
| 22 ~CFDE_RenderDevice() override; | 22 ~CFDE_RenderDevice() override; |
| 23 | 23 |
| 24 int32_t GetWidth() const; | 24 int32_t GetWidth() const; |
| 25 int32_t GetHeight() const; | 25 int32_t GetHeight() const; |
| 26 void SaveState(); | 26 void SaveState(); |
| 27 void RestoreState(); | 27 void RestoreState(); |
| 28 bool SetClipPath(const CFDE_Path* pClip); | 28 bool SetClipPath(const CFDE_Path* pClip); |
| 29 CFDE_Path* GetClipPath() const; | 29 CFDE_Path* GetClipPath() const; |
| 30 bool SetClipRect(const CFX_RectF& rtClip); | 30 bool SetClipRect(const CFX_RectF& rtClip); |
| 31 const CFX_RectF& GetClipRect(); | 31 const CFX_RectF& GetClipRect(); |
| 32 | 32 |
| 33 FX_FLOAT GetDpiX() const; | 33 FX_FLOAT GetDpiX() const; |
| 34 FX_FLOAT GetDpiY() const; | 34 FX_FLOAT GetDpiY() const; |
| 35 | 35 |
| 36 bool DrawImage(CFX_DIBSource* pDib, | 36 bool DrawImage(CFX_DIBSource* pDib, |
| 37 const CFX_RectF* pSrcRect, | 37 const CFX_RectF* pSrcRect, |
| 38 const CFX_RectF& dstRect, | 38 const CFX_RectF& dstRect, |
| 39 const CFX_Matrix* pImgMatrix = nullptr, | 39 const CFX_Matrix* pImgMatrix = nullptr, |
| 40 const CFX_Matrix* pDevMatrix = nullptr); | 40 const CFX_Matrix* pDevMatrix = nullptr); |
| 41 bool DrawString(CFDE_Brush* pBrush, | 41 bool DrawString(CFDE_Brush* pBrush, |
| 42 CFGAS_GEFont* pFont, | 42 const CFX_RetainPtr<CFGAS_GEFont>& pFont, |
| 43 const FXTEXT_CHARPOS* pCharPos, | 43 const FXTEXT_CHARPOS* pCharPos, |
| 44 int32_t iCount, | 44 int32_t iCount, |
| 45 FX_FLOAT fFontSize, | 45 FX_FLOAT fFontSize, |
| 46 const CFX_Matrix* pMatrix = nullptr); | 46 const CFX_Matrix* pMatrix = nullptr); |
| 47 bool DrawBezier(CFDE_Pen* pPen, | 47 bool DrawBezier(CFDE_Pen* pPen, |
| 48 FX_FLOAT fPenWidth, | 48 FX_FLOAT fPenWidth, |
| 49 const CFX_PointF& pt1, | 49 const CFX_PointF& pt1, |
| 50 const CFX_PointF& pt2, | 50 const CFX_PointF& pt2, |
| 51 const CFX_PointF& pt3, | 51 const CFX_PointF& pt3, |
| 52 const CFX_PointF& pt4, | 52 const CFX_PointF& pt4, |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 93 const CFDE_Path* pPath, | 93 const CFDE_Path* pPath, |
| 94 const CFX_Matrix* pMatrix = nullptr); | 94 const CFX_Matrix* pMatrix = nullptr); |
| 95 bool FillPolygon(CFDE_Brush* pBrush, | 95 bool FillPolygon(CFDE_Brush* pBrush, |
| 96 const CFX_PointsF& points, | 96 const CFX_PointsF& points, |
| 97 const CFX_Matrix* pMatrix = nullptr); | 97 const CFX_Matrix* pMatrix = nullptr); |
| 98 bool FillRectangle(CFDE_Brush* pBrush, | 98 bool FillRectangle(CFDE_Brush* pBrush, |
| 99 const CFX_RectF& rect, | 99 const CFX_RectF& rect, |
| 100 const CFX_Matrix* pMatrix = nullptr); | 100 const CFX_Matrix* pMatrix = nullptr); |
| 101 | 101 |
| 102 bool DrawSolidString(CFDE_Brush* pBrush, | 102 bool DrawSolidString(CFDE_Brush* pBrush, |
| 103 CFGAS_GEFont* pFont, | 103 const CFX_RetainPtr<CFGAS_GEFont>& pFont, |
|
dsinclair
2017/01/05 17:01:20
Do we expect these draw methods to store the point
Tom Sepez
2017/01/05 17:35:49
It allows us to be unconcerned about what the meth
| |
| 104 const FXTEXT_CHARPOS* pCharPos, | 104 const FXTEXT_CHARPOS* pCharPos, |
| 105 int32_t iCount, | 105 int32_t iCount, |
| 106 FX_FLOAT fFontSize, | 106 FX_FLOAT fFontSize, |
| 107 const CFX_Matrix* pMatrix); | 107 const CFX_Matrix* pMatrix); |
| 108 bool DrawStringPath(CFDE_Brush* pBrush, | 108 bool DrawStringPath(CFDE_Brush* pBrush, |
| 109 CFGAS_GEFont* pFont, | 109 const CFX_RetainPtr<CFGAS_GEFont>& pFont, |
| 110 const FXTEXT_CHARPOS* pCharPos, | 110 const FXTEXT_CHARPOS* pCharPos, |
| 111 int32_t iCount, | 111 int32_t iCount, |
| 112 FX_FLOAT fFontSize, | 112 FX_FLOAT fFontSize, |
| 113 const CFX_Matrix* pMatrix); | 113 const CFX_Matrix* pMatrix); |
| 114 | 114 |
| 115 protected: | 115 protected: |
| 116 bool CreatePen(CFDE_Pen* pPen, | 116 bool CreatePen(CFDE_Pen* pPen, |
| 117 FX_FLOAT fPenWidth, | 117 FX_FLOAT fPenWidth, |
| 118 CFX_GraphStateData& graphState); | 118 CFX_GraphStateData& graphState); |
| 119 | 119 |
| 120 CFX_RenderDevice* const m_pDevice; | 120 CFX_RenderDevice* const m_pDevice; |
| 121 CFX_RectF m_rtClip; | 121 CFX_RectF m_rtClip; |
| 122 bool m_bOwnerDevice; | 122 bool m_bOwnerDevice; |
| 123 int32_t m_iCharCount; | 123 int32_t m_iCharCount; |
| 124 }; | 124 }; |
| 125 | 125 |
| 126 #endif // XFA_FDE_FDE_GEDEVICE_H_ | 126 #endif // XFA_FDE_FDE_GEDEVICE_H_ |
| OLD | NEW |