Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(322)

Side by Side Diff: core/fxge/include/fx_ge.h

Issue 2216853004: Refactor fx_ge part 2 (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Fixing build, comments Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « core/fxge/include/cfx_pathdata.h ('k') | core/fxge/skia/fx_skia_device.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_INCLUDE_FX_GE_H_ 7 #ifndef CORE_FXGE_INCLUDE_FX_GE_H_
8 #define CORE_FXGE_INCLUDE_FX_GE_H_ 8 #define CORE_FXGE_INCLUDE_FX_GE_H_
9 9
10 #include <memory> 10 #include <memory>
11 11
12 #include "core/fxge/include/cfx_fontmgr.h" 12 #include "core/fxge/include/cfx_fontmgr.h"
13 #include "core/fxge/include/fx_dib.h" 13 #include "core/fxge/include/fx_dib.h"
14 #include "core/fxge/include/fx_font.h" 14 #include "core/fxge/include/fx_font.h"
15 15
16 class CCodec_ModuleMgr; 16 class CCodec_ModuleMgr;
17 class CFX_FaceCache; 17 class CFX_FaceCache;
18 class CFX_Font; 18 class CFX_Font;
19 class CFX_FontCache; 19 class CFX_FontCache;
20 class CFX_FontMgr; 20 class CFX_FontMgr;
21 class CPDF_ShadingPattern; 21 class CPDF_ShadingPattern;
22 class IFX_RenderDeviceDriver; 22 class IFX_RenderDeviceDriver;
23 class SkPictureRecorder; 23 class SkPictureRecorder;
24 24
25 struct FX_PATHPOINT {
26 FX_FLOAT m_PointX;
27 FX_FLOAT m_PointY;
28 int m_Flag;
29 };
30
31 class CFX_ClipRgn {
32 public:
33 enum ClipType { RectI, MaskF };
34
35 CFX_ClipRgn(int device_width, int device_height);
36 explicit CFX_ClipRgn(const FX_RECT& rect);
37 CFX_ClipRgn(const CFX_ClipRgn& src);
38 ~CFX_ClipRgn();
39
40 ClipType GetType() const { return m_Type; }
41 const FX_RECT& GetBox() const { return m_Box; }
42 CFX_DIBitmapRef GetMask() const { return m_Mask; }
43
44 void Reset(const FX_RECT& rect);
45 void IntersectRect(const FX_RECT& rect);
46 void IntersectMaskF(int left, int top, CFX_DIBitmapRef Mask);
47
48 protected:
49 void IntersectMaskRect(FX_RECT rect, FX_RECT mask_box, CFX_DIBitmapRef Mask);
50
51 ClipType m_Type;
52 FX_RECT m_Box;
53 CFX_DIBitmapRef m_Mask;
54 };
55
56 class CFX_PathData {
57 public:
58 CFX_PathData();
59 CFX_PathData(const CFX_PathData& src);
60 ~CFX_PathData();
61
62 int GetPointCount() const { return m_PointCount; }
63 int GetFlag(int index) const { return m_pPoints[index].m_Flag; }
64 FX_FLOAT GetPointX(int index) const { return m_pPoints[index].m_PointX; }
65 FX_FLOAT GetPointY(int index) const { return m_pPoints[index].m_PointY; }
66 FX_PATHPOINT* GetPoints() const { return m_pPoints; }
67
68 void SetPointCount(int nPoints);
69 void AllocPointCount(int nPoints);
70 void AddPointCount(int addPoints);
71 CFX_FloatRect GetBoundingBox() const;
72 CFX_FloatRect GetBoundingBox(FX_FLOAT line_width, FX_FLOAT miter_limit) const;
73 void Transform(const CFX_Matrix* pMatrix);
74 FX_BOOL IsRect() const;
75 FX_BOOL GetZeroAreaPath(CFX_PathData& NewPath,
76 CFX_Matrix* pMatrix,
77 FX_BOOL& bThin,
78 FX_BOOL bAdjust) const;
79 FX_BOOL IsRect(const CFX_Matrix* pMatrix, CFX_FloatRect* rect) const;
80 void Append(const CFX_PathData* pSrc, const CFX_Matrix* pMatrix);
81 void AppendRect(FX_FLOAT left, FX_FLOAT bottom, FX_FLOAT right, FX_FLOAT top);
82 void SetPoint(int index, FX_FLOAT x, FX_FLOAT y, int flag);
83 void TrimPoints(int nPoints);
84 void Copy(const CFX_PathData& src);
85
86 protected:
87 friend class CPDF_Path;
88
89 int m_PointCount;
90 FX_PATHPOINT* m_pPoints;
91 int m_AllocCount;
92 };
93
94 class CFX_GraphStateData { 25 class CFX_GraphStateData {
95 public: 26 public:
96 enum LineCap { LineCapButt = 0, LineCapRound = 1, LineCapSquare = 2 }; 27 enum LineCap { LineCapButt = 0, LineCapRound = 1, LineCapSquare = 2 };
97 28
98 CFX_GraphStateData(); 29 CFX_GraphStateData();
99 CFX_GraphStateData(const CFX_GraphStateData& src); 30 CFX_GraphStateData(const CFX_GraphStateData& src);
100 ~CFX_GraphStateData(); 31 ~CFX_GraphStateData();
101 32
102 void Copy(const CFX_GraphStateData& src); 33 void Copy(const CFX_GraphStateData& src);
103 void SetDashCount(int count); 34 void SetDashCount(int count);
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after
394 bool AttachRecorder(SkPictureRecorder* recorder); 325 bool AttachRecorder(SkPictureRecorder* recorder);
395 SkPictureRecorder* CreateRecorder(int size_x, int size_y); 326 SkPictureRecorder* CreateRecorder(int size_x, int size_y);
396 void DebugVerifyBitmapIsPreMultiplied() const override; 327 void DebugVerifyBitmapIsPreMultiplied() const override;
397 #endif 328 #endif
398 329
399 protected: 330 protected:
400 bool m_bOwnedBitmap; 331 bool m_bOwnedBitmap;
401 }; 332 };
402 333
403 #endif // CORE_FXGE_INCLUDE_FX_GE_H_ 334 #endif // CORE_FXGE_INCLUDE_FX_GE_H_
OLDNEW
« no previous file with comments | « core/fxge/include/cfx_pathdata.h ('k') | core/fxge/skia/fx_skia_device.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698