diff options
author | Henrique Nakashima <hnakashima@chromium.org> | 2018-04-04 16:38:40 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-04-04 16:38:40 +0000 |
commit | dc566b0a76f9d2ad112c8cc35fa6dc8eaf942316 (patch) | |
tree | 60e72e3b14db2f3cb26fbd595ea84fed58bd9548 /xfa/fxfa/cxfa_ffdocview.cpp | |
parent | 1a2e4945f16f5dff4aba518a36edf938c9234ac3 (diff) | |
download | pdfium-dc566b0a76f9d2ad112c8cc35fa6dc8eaf942316.tar.xz |
Fix XFA caret blinking only while mouse moves.chromium/3389
Currently rect invalidations in XFA are only sent to the embedder
only when RunInvalidate() is executed.
For things which redraw on a timer, such as the caret, there was
no user event to call RunInvalidate() so the page would not redraw.
This CL changes the XFA code to send the invalidations to the
embedder immediately and expects the embedder to combine the
invalidations to limit overdraw.
Bug: chromium:828561
Change-Id: I298052fd7d0c373b029eec191cc6c74c63978348
Reviewed-on: https://pdfium-review.googlesource.com/29670
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa/fxfa/cxfa_ffdocview.cpp')
-rw-r--r-- | xfa/fxfa/cxfa_ffdocview.cpp | 20 |
1 files changed, 3 insertions, 17 deletions
diff --git a/xfa/fxfa/cxfa_ffdocview.cpp b/xfa/fxfa/cxfa_ffdocview.cpp index 43879af2dc..86a2a9fee9 100644 --- a/xfa/fxfa/cxfa_ffdocview.cpp +++ b/xfa/fxfa/cxfa_ffdocview.cpp @@ -185,7 +185,6 @@ void CXFA_FFDocView::UpdateDocView() { m_bLayoutEvent = false; m_CalculateNodes.clear(); - RunInvalidate(); UnlockUpdate(); } @@ -442,22 +441,9 @@ void CXFA_FFDocView::OnPageEvent(CXFA_ContainerLayoutItem* pSender, m_pDoc->GetDocEnvironment()->PageViewEvent(pFFPageView, dwEvent); } - -void CXFA_FFDocView::AddInvalidateRect(CXFA_FFPageView* pPageView, - const CFX_RectF& rtInvalidate) { - if (m_mapPageInvalidate[pPageView]) { - m_mapPageInvalidate[pPageView]->Union(rtInvalidate); - return; - } - - m_mapPageInvalidate[pPageView] = pdfium::MakeUnique<CFX_RectF>(rtInvalidate); -} - -void CXFA_FFDocView::RunInvalidate() { - for (const auto& pair : m_mapPageInvalidate) - m_pDoc->GetDocEnvironment()->InvalidateRect(pair.first, *pair.second); - - m_mapPageInvalidate.clear(); +void CXFA_FFDocView::InvalidateRect(CXFA_FFPageView* pPageView, + const CFX_RectF& rtInvalidate) { + m_pDoc->GetDocEnvironment()->InvalidateRect(pPageView, rtInvalidate); } bool CXFA_FFDocView::RunLayout() { |