Krita Source Code Documentation
Loading...
Searching...
No Matches
KisSelectionUpdateCompressor.cpp
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2018 Dmitry Kazakov <dimula73@gmail.com>
3 *
4 * SPDX-License-Identifier: GPL-2.0-or-later
5 */
6
7
9#include "kis_image.h"
10#include "kis_selection.h"
11#include "kis_layer_utils.h"
13
14
16 : m_parentSelection(selection)
17 , m_updateSignalCompressor(new KisThreadSafeSignalCompressor(100, KisSignalCompressor::POSTPONE))
18{
19 connect(m_updateSignalCompressor, SIGNAL(timeout()), this, SLOT(startUpdateJob()));
20
21 this->moveToThread(m_updateSignalCompressor->thread());
22}
23
28
30{
31 m_fullUpdateRequested |= updateRect.isEmpty();
32 m_updateRect = !m_fullUpdateRequested ? m_updateRect | updateRect : QRect();
34}
35
42
44{
46 if (!parentNode) {
47 m_hasStalledUpdate = true;
48 return;
49 }
50
51 // FIXME: we cannot use parentNode->image() here because masks don't
52 // have the pointer initialized for some reason.
54 if (!image) {
55 m_hasStalledUpdate = true;
56 return;
57 }
58
59 if (image) {
61 }
62 m_updateRect = QRect();
64 m_hasStalledUpdate = false;
65}
connect(this, SIGNAL(optionsChanged()), this, SLOT(saveOptions()))
void addSpontaneousJob(KisSpontaneousJob *spontaneousJob)
KisThreadSafeSignalCompressor * m_updateSignalCompressor
void requestUpdate(const QRect &updateRect)
KisSelectionUpdateCompressor(KisSelection *selection)
KisImageSP findImageByHierarchy(KisNodeSP node)
KisNodeWSP parentNode