diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2025-05-15 09:34:25 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2025-05-15 16:22:00 +0200 |
commit | e60a92164ac2cc35f70efcbf20a7272be1e3f99d (patch) | |
tree | 674d062ff9c24257142a8d7acee5b91062831fe4 /include | |
parent | c3423850610b7fea7331647814e2719796fa088b (diff) |
cool#11942 svx lok: handle Writer idle status when starting the paint view idle
The bugdoc is similar to cool#11785, i.e. a document of 3-400 pages, but
the content is reasonably simple, mostly plain text and bullet points.
The document has a shape, though. Loading this document in COOL does a
full sync layout on load, which is reported to take ~9s on a slower
machine and it takes >1s for me locally (after doc load, before the
render of the first page).
It seems what happens is that idle layout is started, but it's not
interrupted, because moving content between pages in
SwLayAction::Action(), called from the SwLayIdle ctor calls into
SdrPaintView::Notify(), which starts a high priority "idle", so the LOK
client thinks it should not interrupt core jobs, so the idle layout
first completes, and only then we paint the first tile.
Fix the problem by adjusting the priority of
SdrPaintView::maComeBackIdle dynamically. Add a flag in the draw model
to know when we're inside the Writer idle layout and once the svx/ idle
is started, lower the priority in case that's invoked from inside the
Writer idle layout. This gives the LOK client a way to interrupt the
Writer idle layout (via the anyInput callback), now that it seems core
has no high priority jobs in the scheduler. Size of the time window
between the end of doc load and the start of the first tile render,
before: 1617 ms. After: 182 ms
An alternative approach I considered is to interact with the
SdrPaintView that belongs to the current Writer view, but that won't
work. There are typically 2 draw views active right after document
load, one created in SwViewShellImp::MakeDrawView(), but there is also
an additional hidden view created in the SvxDrawPage ctor for UNO
purposes, so if we don't go via SdrModel, we would have to notify both
views that we're entering / leaving the Writer idle layout, which looks
more complicated than what this patch does.
Change-Id: I115ba2c152fe7283804cde564afd511f9fbff707
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/185360
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/svx/svdmodel.hxx | 3 | ||||
-rw-r--r-- | include/svx/svdpntv.hxx | 1 |
2 files changed, 4 insertions, 0 deletions
diff --git a/include/svx/svdmodel.hxx b/include/svx/svdmodel.hxx index 2d7118be583f..15b756b1c9e1 100644 --- a/include/svx/svdmodel.hxx +++ b/include/svx/svdmodel.hxx @@ -182,6 +182,7 @@ protected: sal_uInt16 m_nPageNumsDirtyFrom = SAL_MAX_UINT16; sal_uInt16 m_nMasterPageNumsDirtyFrom = SAL_MAX_UINT16; bool m_bIsWriter:1; // to clean up pMyPool from 303a + bool m_bIsWriterIdle:1; bool m_bThemedControls:1; // If false UnoControls should not use theme colors bool mbUndoEnabled:1; // If false no undo is recorded or we are during the execution of an undo action bool mbChanged:1; @@ -567,6 +568,8 @@ public: void disposeOutliner( std::unique_ptr<SdrOutliner> pOutliner ); bool IsWriter() const { return m_bIsWriter; } + void SetWriterIdle(bool bIsWriterIdle) { m_bIsWriterIdle = bIsWriterIdle; } + bool IsWriterIdle() const { return m_bIsWriterIdle; } bool IsPDFDocument() const { return m_bIsPDFDocument; } void setPDFDocument(bool bIsPDFDocument) diff --git a/include/svx/svdpntv.hxx b/include/svx/svdpntv.hxx index e3c9fc1dcc03..4d641de4dc60 100644 --- a/include/svx/svdpntv.hxx +++ b/include/svx/svdpntv.hxx @@ -230,6 +230,7 @@ public: SdrPaintWindow* GetPaintWindow(sal_uInt32 nIndex) const; // Replacement for GetWin(0), may return 0L (!) OutputDevice* GetFirstOutputDevice() const; + const Idle& GetComeBackIdle() const { return maComeBackIdle; }; private: DECL_DLLPRIVATE_LINK(ImpComeBackHdl, Timer*, void); |