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 #include "xfa/src/foxitlib.h" | 7 #include "xfa/src/foxitlib.h" |
8 #include "xfa/src/fwl/src/core/include/fwl_appimp.h" | 8 #include "xfa/src/fwl/src/core/include/fwl_appimp.h" |
9 #include "xfa/src/fwl/src/core/include/fwl_noteimp.h" | 9 #include "xfa/src/fwl/src/core/include/fwl_noteimp.h" |
10 #include "xfa/src/fwl/src/core/include/fwl_targetimp.h" | 10 #include "xfa/src/fwl/src/core/include/fwl_targetimp.h" |
(...skipping 838 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
849 CFWL_WidgetMgrItem* pItem = m_pWidgetMgr->GetWidgetMgrItem(pWidget); | 849 CFWL_WidgetMgrItem* pItem = m_pWidgetMgr->GetWidgetMgrItem(pWidget); |
850 pGraphics->Transfer(pItem->pOffscreen, rtClip.left, rtClip.top, rtClip, | 850 pGraphics->Transfer(pItem->pOffscreen, rtClip.left, rtClip.top, rtClip, |
851 pMatrix); | 851 pMatrix); |
852 #ifdef _WIN32 | 852 #ifdef _WIN32 |
853 pItem->pOffscreen->ClearClip(); | 853 pItem->pOffscreen->ClearClip(); |
854 #endif | 854 #endif |
855 } | 855 } |
856 CFWL_WidgetMgrItem* pItem = m_pWidgetMgr->GetWidgetMgrItem(pWidget); | 856 CFWL_WidgetMgrItem* pItem = m_pWidgetMgr->GetWidgetMgrItem(pWidget); |
857 pItem->iRedrawCounter = 0; | 857 pItem->iRedrawCounter = 0; |
858 } | 858 } |
| 859 |
859 #define FWL_NEEDREPAINTHIT_Point 12 | 860 #define FWL_NEEDREPAINTHIT_Point 12 |
860 #define FWL_NEEDREPAINTHIT_Piece 3 | 861 #define FWL_NEEDREPAINTHIT_Piece 3 |
861 typedef struct _FWL_NeedRepaintHitData { | 862 struct FWL_NEEDREPAINTHITDATA { |
862 CFX_PointF hitPoint; | 863 CFX_PointF hitPoint; |
863 FX_BOOL bNotNeedRepaint; | 864 FX_BOOL bNotNeedRepaint; |
864 FX_BOOL bNotContainByDirty; | 865 FX_BOOL bNotContainByDirty; |
865 } FWL_NeedRepaintHitData; | 866 }; |
| 867 |
866 FX_BOOL CFWL_WidgetMgrDelegate::IsNeedRepaint(IFWL_Widget* pWidget, | 868 FX_BOOL CFWL_WidgetMgrDelegate::IsNeedRepaint(IFWL_Widget* pWidget, |
867 CFX_Matrix* pMatrix, | 869 CFX_Matrix* pMatrix, |
868 const CFX_RectF& rtDirty) { | 870 const CFX_RectF& rtDirty) { |
869 CFWL_WidgetMgrItem* pItem = m_pWidgetMgr->GetWidgetMgrItem(pWidget); | 871 CFWL_WidgetMgrItem* pItem = m_pWidgetMgr->GetWidgetMgrItem(pWidget); |
870 if (pItem && pItem->iRedrawCounter > 0) { | 872 if (pItem && pItem->iRedrawCounter > 0) { |
871 pItem->iRedrawCounter = 0; | 873 pItem->iRedrawCounter = 0; |
872 return TRUE; | 874 return TRUE; |
873 } | 875 } |
874 CFX_RectF rtWidget; | 876 CFX_RectF rtWidget; |
875 pWidget->GetWidgetRect(rtWidget); | 877 pWidget->GetWidgetRect(rtWidget); |
(...skipping 17 matching lines...) Expand all Loading... |
893 return TRUE; | 895 return TRUE; |
894 } | 896 } |
895 } | 897 } |
896 } | 898 } |
897 CFX_RectF rtChilds; | 899 CFX_RectF rtChilds; |
898 rtChilds.Empty(); | 900 rtChilds.Empty(); |
899 FX_BOOL bChildIntersectWithDirty = FALSE; | 901 FX_BOOL bChildIntersectWithDirty = FALSE; |
900 FX_BOOL bOrginPtIntersectWidthChild = FALSE; | 902 FX_BOOL bOrginPtIntersectWidthChild = FALSE; |
901 FX_BOOL bOrginPtIntersectWidthDirty = | 903 FX_BOOL bOrginPtIntersectWidthDirty = |
902 rtDirty.Contains(rtWidget.left, rtWidget.top); | 904 rtDirty.Contains(rtWidget.left, rtWidget.top); |
903 static FWL_NeedRepaintHitData hitPoint[FWL_NEEDREPAINTHIT_Point]; | 905 static FWL_NEEDREPAINTHITDATA hitPoint[FWL_NEEDREPAINTHIT_Point]; |
904 static int32_t iSize = sizeof(FWL_NeedRepaintHitData); | 906 int32_t iSize = sizeof(FWL_NEEDREPAINTHITDATA); |
905 FXSYS_memset(hitPoint, 0, iSize); | 907 FXSYS_memset(hitPoint, 0, iSize); |
906 FX_FLOAT fxPiece = rtWidget.width / FWL_NEEDREPAINTHIT_Piece; | 908 FX_FLOAT fxPiece = rtWidget.width / FWL_NEEDREPAINTHIT_Piece; |
907 FX_FLOAT fyPiece = rtWidget.height / FWL_NEEDREPAINTHIT_Piece; | 909 FX_FLOAT fyPiece = rtWidget.height / FWL_NEEDREPAINTHIT_Piece; |
908 hitPoint[2].hitPoint.x = hitPoint[6].hitPoint.x = rtWidget.left; | 910 hitPoint[2].hitPoint.x = hitPoint[6].hitPoint.x = rtWidget.left; |
909 hitPoint[0].hitPoint.x = hitPoint[3].hitPoint.x = hitPoint[7].hitPoint.x = | 911 hitPoint[0].hitPoint.x = hitPoint[3].hitPoint.x = hitPoint[7].hitPoint.x = |
910 hitPoint[10].hitPoint.x = fxPiece + rtWidget.left; | 912 hitPoint[10].hitPoint.x = fxPiece + rtWidget.left; |
911 hitPoint[1].hitPoint.x = hitPoint[4].hitPoint.x = hitPoint[8].hitPoint.x = | 913 hitPoint[1].hitPoint.x = hitPoint[4].hitPoint.x = hitPoint[8].hitPoint.x = |
912 hitPoint[11].hitPoint.x = fxPiece * 2 + rtWidget.left; | 914 hitPoint[11].hitPoint.x = fxPiece * 2 + rtWidget.left; |
913 hitPoint[5].hitPoint.x = hitPoint[9].hitPoint.x = | 915 hitPoint[5].hitPoint.x = hitPoint[9].hitPoint.x = |
914 rtWidget.width + rtWidget.left; | 916 rtWidget.width + rtWidget.left; |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1059 if (child == find) { | 1061 if (child == find) { |
1060 return TRUE; | 1062 return TRUE; |
1061 } | 1063 } |
1062 if (FWL_WidgetIsChild(child, find)) { | 1064 if (FWL_WidgetIsChild(child, find)) { |
1063 return TRUE; | 1065 return TRUE; |
1064 } | 1066 } |
1065 child = FWL_GetWidgetMgr()->GetWidget(child, FWL_WGTRELATION_NextSibling); | 1067 child = FWL_GetWidgetMgr()->GetWidget(child, FWL_WGTRELATION_NextSibling); |
1066 } | 1068 } |
1067 return FALSE; | 1069 return FALSE; |
1068 } | 1070 } |
OLD | NEW |