summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2021-07-22 22:07:42 +0200
committerLuboš Luňák <l.lunak@collabora.com>2021-09-08 10:31:32 +0200
commit9b73d3e8926d5f9b10464d19b539eef3eb088f50 (patch)
tree36267b000f4a0dd04e618f11b3d7952bd000795a
parent0f699173519176b9bd21761d553c34156c1ebd7d (diff)
avoid painting to windows in LOK mode
There are no actual toplevel windows in that case, and tiled rendering is used to paint whenever any painting is needed. The painting is already made useless by using (1,1)-sized Cairo surfaces for windows (SvpSalFrame::SetPosSize() calling SvpSalFrame::GetSurfaceFrameSize()), this should avoid it altogether. It is possible this commit causes regressions if some code relies on Paint() getting called at specific times (such as 2f961c7a811bdff66 doing relayout there, causing geometry changes), but those should be fixed. Change-Id: Ie4be16301fdddb7c1b0350e6458178efca88aa4d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119385 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
-rw-r--r--sd/qa/unit/tiledrendering/LOKitSearchTest.cxx4
-rw-r--r--vcl/source/window/paint.cxx21
2 files changed, 20 insertions, 5 deletions
diff --git a/sd/qa/unit/tiledrendering/LOKitSearchTest.cxx b/sd/qa/unit/tiledrendering/LOKitSearchTest.cxx
index 762faaac1b56..8bb2144bbe80 100644
--- a/sd/qa/unit/tiledrendering/LOKitSearchTest.cxx
+++ b/sd/qa/unit/tiledrendering/LOKitSearchTest.cxx
@@ -236,8 +236,8 @@ void LOKitSearchTest::testSearchAllSelections()
lcl_search("third", /*bFindAll=*/true);
// Make sure this is found on the 3rd slide.
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(2), mpCallbackRecorder->m_nPart);
-
- CPPUNIT_ASSERT_EQUAL(static_cast<std::size_t>(1), mpCallbackRecorder->m_aSelection.size());
+ // This was 1: only the first match was highlighted.
+ CPPUNIT_ASSERT_EQUAL(static_cast<std::size_t>(2), mpCallbackRecorder->m_aSelection.size());
}
void LOKitSearchTest::testSearchAllNotifications()
diff --git a/vcl/source/window/paint.cxx b/vcl/source/window/paint.cxx
index 734e4d8ed63b..4efb43c1bc1b 100644
--- a/vcl/source/window/paint.cxx
+++ b/vcl/source/window/paint.cxx
@@ -646,6 +646,12 @@ void Window::ImplCallOverlapPaint()
IMPL_LINK_NOARG(Window, ImplHandlePaintHdl, Timer *, void)
{
+ if (comphelper::LibreOfficeKit::isActive() && true)
+ {
+ // Tiled rendering is used, idle paint does not need to do anything.
+ mpWindowImpl->mpFrameData->maPaintIdle.Stop();
+ return;
+ }
#ifndef IOS
comphelper::ProfileZone aZone("VCL idle re-paint");
@@ -665,9 +671,6 @@ IMPL_LINK_NOARG(Window, ImplHandlePaintHdl, Timer *, void)
else if ( mpWindowImpl->mbReallyVisible )
{
ImplCallOverlapPaint();
- if (comphelper::LibreOfficeKit::isActive() &&
- mpWindowImpl->mpFrameData->maPaintIdle.IsActive())
- mpWindowImpl->mpFrameData->maPaintIdle.Stop();
}
#endif
}
@@ -689,6 +692,12 @@ IMPL_LINK_NOARG(Window, ImplHandleResizeTimerHdl, Timer *, void)
void Window::ImplInvalidateFrameRegion( const vcl::Region* pRegion, InvalidateFlags nFlags )
{
+ if (comphelper::LibreOfficeKit::isActive() && true)
+ {
+ // Tiled rendering is used, so there's no need to invalidate for idle painting.
+ return;
+ }
+
// set PAINTCHILDREN for all parent windows till the first OverlapWindow
if ( !ImplIsOverlapWindow() )
{
@@ -1270,6 +1279,12 @@ void Window::PaintImmediately()
if (!mpWindowImpl)
return;
+ if (comphelper::LibreOfficeKit::isActive() && true)
+ {
+ // Tiled rendering is used, direct paint does not need to do anything.
+ return;
+ }
+
if ( mpWindowImpl->mpBorderWindow )
{
mpWindowImpl->mpBorderWindow->PaintImmediately();