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