| 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/fwl/core/cfwl_widgetmgr.h" | 7 #include "xfa/fwl/core/cfwl_widgetmgr.h" |
| 8 | 8 |
| 9 #include "xfa/fwl/core/cfwl_message.h" | 9 #include "xfa/fwl/core/cfwl_message.h" |
| 10 #include "xfa/fwl/core/fwl_noteimp.h" | 10 #include "xfa/fwl/core/fwl_noteimp.h" |
| (...skipping 595 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 606 pWidget->GetWidgetRect(clipCopy); | 606 pWidget->GetWidgetRect(clipCopy); |
| 607 clipCopy.left = clipCopy.top = 0; | 607 clipCopy.left = clipCopy.top = 0; |
| 608 if (bUseOffscreenDirect(pWidget)) { | 608 if (bUseOffscreenDirect(pWidget)) { |
| 609 DrawWidgetAfter(pWidget, pGraphics, clipCopy, pMatrix); | 609 DrawWidgetAfter(pWidget, pGraphics, clipCopy, pMatrix); |
| 610 return; | 610 return; |
| 611 } | 611 } |
| 612 CFX_RectF clipBounds; | 612 CFX_RectF clipBounds; |
| 613 | 613 |
| 614 #if _FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN64_ || \ | 614 #if _FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN64_ || \ |
| 615 _FX_OS_ == _FX_LINUX_DESKTOP_ || _FX_OS_ == _FX_ANDROID_ | 615 _FX_OS_ == _FX_LINUX_DESKTOP_ || _FX_OS_ == _FX_ANDROID_ |
| 616 pWidget->GetCurrentDelegate()->OnDrawWidget(pTemp, pMatrix); | 616 pWidget->GetDelegate()->OnDrawWidget(pTemp, pMatrix); |
| 617 pGraphics->GetClipRect(clipBounds); | 617 pGraphics->GetClipRect(clipBounds); |
| 618 clipCopy = clipBounds; | 618 clipCopy = clipBounds; |
| 619 #elif _FX_OS_ == _FX_MACOSX_ | 619 #elif _FX_OS_ == _FX_MACOSX_ |
| 620 if (m_pWidgetMgr->IsFormDisabled()) { | 620 if (m_pWidgetMgr->IsFormDisabled()) { |
| 621 pWidget->GetCurrentDelegate()->OnDrawWidget(pTemp, pMatrix); | 621 pWidget->GetDelegate()->OnDrawWidget(pTemp, pMatrix); |
| 622 pGraphics->GetClipRect(clipBounds); | 622 pGraphics->GetClipRect(clipBounds); |
| 623 clipCopy = clipBounds; | 623 clipCopy = clipBounds; |
| 624 } else { | 624 } else { |
| 625 clipBounds.Set(pMatrix->a, pMatrix->b, pMatrix->c, pMatrix->d); | 625 clipBounds.Set(pMatrix->a, pMatrix->b, pMatrix->c, pMatrix->d); |
| 626 const_cast<CFX_Matrix*>(pMatrix)->SetIdentity(); // FIXME: const cast. | 626 const_cast<CFX_Matrix*>(pMatrix)->SetIdentity(); // FIXME: const cast. |
| 627 pWidget->GetCurrentDelegate()->OnDrawWidget(pTemp, pMatrix); | 627 pWidget->GetDelegate()->OnDrawWidget(pTemp, pMatrix); |
| 628 } | 628 } |
| 629 #endif // _FX_OS_ == _FX_MACOSX_ | 629 #endif // _FX_OS_ == _FX_MACOSX_ |
| 630 | 630 |
| 631 if (!m_pWidgetMgr->IsFormDisabled()) { | 631 if (!m_pWidgetMgr->IsFormDisabled()) { |
| 632 CFX_RectF rtClient; | 632 CFX_RectF rtClient; |
| 633 pWidget->GetClientRect(rtClient); | 633 pWidget->GetClientRect(rtClient); |
| 634 clipBounds.Intersect(rtClient); | 634 clipBounds.Intersect(rtClient); |
| 635 } | 635 } |
| 636 if (!clipBounds.IsEmpty()) | 636 if (!clipBounds.IsEmpty()) |
| 637 DrawChild(pWidget, clipBounds, pTemp, pMatrix); | 637 DrawChild(pWidget, clipBounds, pTemp, pMatrix); |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 671 widgetMatrix.TransformPoint(clipBounds.left, clipBounds.top); | 671 widgetMatrix.TransformPoint(clipBounds.left, clipBounds.top); |
| 672 clipBounds.Intersect(rtClip); | 672 clipBounds.Intersect(rtClip); |
| 673 if (clipBounds.IsEmpty()) | 673 if (clipBounds.IsEmpty()) |
| 674 continue; | 674 continue; |
| 675 | 675 |
| 676 pGraphics->SaveGraphState(); | 676 pGraphics->SaveGraphState(); |
| 677 pGraphics->SetClipRect(clipBounds); | 677 pGraphics->SetClipRect(clipBounds); |
| 678 } | 678 } |
| 679 widgetMatrix.Translate(rtWidget.left, rtWidget.top, TRUE); | 679 widgetMatrix.Translate(rtWidget.left, rtWidget.top, TRUE); |
| 680 | 680 |
| 681 if (IFWL_WidgetDelegate* pDelegate = child->GetCurrentDelegate()) { | 681 if (IFWL_WidgetDelegate* pDelegate = child->GetDelegate()) { |
| 682 if (m_pWidgetMgr->IsFormDisabled() || | 682 if (m_pWidgetMgr->IsFormDisabled() || |
| 683 IsNeedRepaint(child, &widgetMatrix, rtClip)) { | 683 IsNeedRepaint(child, &widgetMatrix, rtClip)) { |
| 684 pDelegate->OnDrawWidget(pGraphics, &widgetMatrix); | 684 pDelegate->OnDrawWidget(pGraphics, &widgetMatrix); |
| 685 } | 685 } |
| 686 } | 686 } |
| 687 if (!bFormDisable) | 687 if (!bFormDisable) |
| 688 pGraphics->RestoreGraphState(); | 688 pGraphics->RestoreGraphState(); |
| 689 | 689 |
| 690 DrawChild(child, clipBounds, pGraphics, | 690 DrawChild(child, clipBounds, pGraphics, |
| 691 bFormDisable ? &widgetMatrix : pMatrix); | 691 bFormDisable ? &widgetMatrix : pMatrix); |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 861 pWidget(widget), | 861 pWidget(widget), |
| 862 iRedrawCounter(0) | 862 iRedrawCounter(0) |
| 863 #if (_FX_OS_ == _FX_WIN32_DESKTOP_) || (_FX_OS_ == _FX_WIN64_) | 863 #if (_FX_OS_ == _FX_WIN32_DESKTOP_) || (_FX_OS_ == _FX_WIN64_) |
| 864 , | 864 , |
| 865 bOutsideChanged(FALSE) | 865 bOutsideChanged(FALSE) |
| 866 #endif | 866 #endif |
| 867 { | 867 { |
| 868 } | 868 } |
| 869 | 869 |
| 870 CFWL_WidgetMgrItem::~CFWL_WidgetMgrItem() {} | 870 CFWL_WidgetMgrItem::~CFWL_WidgetMgrItem() {} |
| OLD | NEW |