OLD | NEW |
1 // Copyright 2016 PDFium Authors. All rights reserved. | 1 // Copyright 2016 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_GE_CFX_CLIPRGN_H_ | 7 #ifndef CORE_FXGE_GE_CFX_CLIPRGN_H_ |
8 #define CORE_FXGE_GE_CFX_CLIPRGN_H_ | 8 #define CORE_FXGE_GE_CFX_CLIPRGN_H_ |
9 | 9 |
10 #include "core/fxge/include/fx_dib.h" | 10 #include "core/fxge/fx_dib.h" |
11 | 11 |
12 class CFX_ClipRgn { | 12 class CFX_ClipRgn { |
13 public: | 13 public: |
14 enum ClipType { RectI, MaskF }; | 14 enum ClipType { RectI, MaskF }; |
15 | 15 |
16 CFX_ClipRgn(int device_width, int device_height); | 16 CFX_ClipRgn(int device_width, int device_height); |
17 CFX_ClipRgn(const CFX_ClipRgn& src); | 17 CFX_ClipRgn(const CFX_ClipRgn& src); |
18 ~CFX_ClipRgn(); | 18 ~CFX_ClipRgn(); |
19 | 19 |
20 ClipType GetType() const { return m_Type; } | 20 ClipType GetType() const { return m_Type; } |
21 const FX_RECT& GetBox() const { return m_Box; } | 21 const FX_RECT& GetBox() const { return m_Box; } |
22 CFX_DIBitmapRef GetMask() const { return m_Mask; } | 22 CFX_DIBitmapRef GetMask() const { return m_Mask; } |
23 | 23 |
24 void Reset(const FX_RECT& rect); | 24 void Reset(const FX_RECT& rect); |
25 void IntersectRect(const FX_RECT& rect); | 25 void IntersectRect(const FX_RECT& rect); |
26 void IntersectMaskF(int left, int top, CFX_DIBitmapRef Mask); | 26 void IntersectMaskF(int left, int top, CFX_DIBitmapRef Mask); |
27 | 27 |
28 private: | 28 private: |
29 void IntersectMaskRect(FX_RECT rect, FX_RECT mask_box, CFX_DIBitmapRef Mask); | 29 void IntersectMaskRect(FX_RECT rect, FX_RECT mask_box, CFX_DIBitmapRef Mask); |
30 | 30 |
31 ClipType m_Type; | 31 ClipType m_Type; |
32 FX_RECT m_Box; | 32 FX_RECT m_Box; |
33 CFX_DIBitmapRef m_Mask; | 33 CFX_DIBitmapRef m_Mask; |
34 }; | 34 }; |
35 | 35 |
36 #endif // CORE_FXGE_GE_CFX_CLIPRGN_H_ | 36 #endif // CORE_FXGE_GE_CFX_CLIPRGN_H_ |
OLD | NEW |