Krita Source Code Documentation
Loading...
Searching...
No Matches
KisSuspendProjectionUpdatesStrokeStrategy::Private::StartBatchUIUpdatesCommand Struct Reference
+ Inheritance diagram for KisSuspendProjectionUpdatesStrokeStrategy::Private::StartBatchUIUpdatesCommand:

Public Member Functions

void redo () override
 
 StartBatchUIUpdatesCommand (KisSuspendProjectionUpdatesStrokeStrategy *strategy)
 
void undo () override
 
- Public Member Functions inherited from KisSuspendProjectionUpdatesStrokeStrategy::Private::StrokeJobCommand
 StrokeJobCommand (KisStrokeJobData::Sequentiality sequentiality=KisStrokeJobData::SEQUENTIAL, KisStrokeJobData::Exclusivity exclusivity=KisStrokeJobData::NORMAL)
 
- Public Member Functions inherited from KUndo2Command
QString actionText () const
 
virtual bool canAnnihilateWith (const KUndo2Command *other) const
 
const KUndo2Commandchild (int index) const
 
int childCount () const
 
virtual QTime endTime () const
 
KUndo2CommandExtraDataextraData () const
 
bool hasParent () const
 
virtual int id () const
 
virtual bool isMerged () const
 
 KUndo2Command (const KUndo2MagicString &text, KUndo2Command *parent=0)
 
 KUndo2Command (KUndo2Command *parent=0)
 
virtual QVector< KUndo2Command * > mergeCommandsVector () const
 
virtual bool mergeWith (const KUndo2Command *other)
 
virtual void redoMergedCommands ()
 
void setEndTime ()
 
virtual void setEndTime (const QTime &time)
 
void setExtraData (KUndo2CommandExtraData *data)
 
void setText (const KUndo2MagicString &text)
 
void setTime ()
 
virtual void setTime (const QTime &time)
 
virtual void setTimedID (int timedID)
 
KUndo2MagicString text () const
 
virtual QTime time () const
 
virtual int timedId () const
 
virtual bool timedMergeWith (KUndo2Command *other)
 
virtual void undoMergedCommands ()
 
virtual ~KUndo2Command ()
 

Public Attributes

KisSuspendProjectionUpdatesStrokeStrategym_strategy
 
- Public Attributes inherited from KisSuspendProjectionUpdatesStrokeStrategy::Private::StrokeJobCommand
KisStrokeJobData::Exclusivity m_exclusivity
 
KisStrokeJobData::Sequentiality m_sequentiality
 

Detailed Description

Constructor & Destructor Documentation

◆ StartBatchUIUpdatesCommand()

KisSuspendProjectionUpdatesStrokeStrategy::Private::StartBatchUIUpdatesCommand::StartBatchUIUpdatesCommand ( KisSuspendProjectionUpdatesStrokeStrategy * strategy)
inline

Definition at line 331 of file kis_suspend_projection_updates_stroke_strategy.cpp.

333 m_strategy(strategy) {}
StrokeJobCommand(KisStrokeJobData::Sequentiality sequentiality=KisStrokeJobData::SEQUENTIAL, KisStrokeJobData::Exclusivity exclusivity=KisStrokeJobData::NORMAL)

Member Function Documentation

◆ redo()

void KisSuspendProjectionUpdatesStrokeStrategy::Private::StartBatchUIUpdatesCommand::redo ( )
inlineoverridevirtual

Applies a change to the document. This function must be implemented in the derived class. Calling KUndo2QStack::push(), KUndo2QStack::undo() or KUndo2QStack::redo() from this function leads to undefined behavior.

The default implementation calls redo() on all child commands.

See also
undo()

We accumulate dirty rects from all(!) epochs, because some updates of the previous epochs might have been cancelled without doing any real work.

Reimplemented from KUndo2Command.

Definition at line 335 of file kis_suspend_projection_updates_stroke_strategy.cpp.

335 {
336 KisImageSP image = m_strategy->m_d->image.toStrongRef();
338
343 const QVector<QRect> totalDirtyRects =
344 image->enableUIUpdates() + m_strategy->m_d->accumulatedDirtyRects;
345
346 const QRect totalRect =
347 image->bounds() &
348 std::accumulate(totalDirtyRects.begin(), totalDirtyRects.end(), QRect(), std::bit_or<QRect>());
349
350 m_strategy->m_d->accumulatedDirtyRects =
352 totalDirtyRects,
354
356
358 Q_FOREACH (const QRect &rc, m_strategy->m_d->accumulatedDirtyRects) {
359 jobsData << new Private::UploadDataToUIData(rc, m_strategy->m_d->updatesEpoch, m_strategy);
360 }
361
363
364 }
QVector< QRect > enableUIUpdates() override
KisImageSignalRouter * signalRouter()
QRect bounds() const override
KisRunnableStrokeJobsInterface * runnableJobsInterface() const
virtual void addRunnableJobs(const QVector< KisRunnableStrokeJobDataBase * > &list)=0
#define KIS_SAFE_ASSERT_RECOVER_RETURN(cond)
Definition kis_assert.h:128
QVector< QRect > splitAndFilterDabRect(const QRect &totalRect, const QVector< QRect > &dabRects, int idealPatchSize)
QSize optimalPatchSize()

References KisRunnableStrokeJobsInterface::addRunnableJobs(), KisImage::bounds(), KisImageSignalRouter::emitNotifyBatchUpdateStarted(), KisImage::enableUIUpdates(), KisSuspendProjectionUpdatesStrokeStrategy::Private::image, KIS_SAFE_ASSERT_RECOVER_RETURN, KisSuspendProjectionUpdatesStrokeStrategy::m_d, m_strategy, KritaUtils::optimalPatchSize(), KisRunnableBasedStrokeStrategy::runnableJobsInterface(), KisImage::signalRouter(), and KisPaintOpUtils::splitAndFilterDabRect().

◆ undo()

void KisSuspendProjectionUpdatesStrokeStrategy::Private::StartBatchUIUpdatesCommand::undo ( )
inlineoverridevirtual

Reverts a change to the document. After undo() is called, the state of the document should be the same as before redo() was called. This function must be implemented in the derived class. Calling KUndo2QStack::push(), KUndo2QStack::undo() or KUndo2QStack::redo() from this function leads to undefined behavior.

The default implementation calls undo() on all child commands in reverse order.

See also
redo()

Reimplemented from KUndo2Command.

Definition at line 366 of file kis_suspend_projection_updates_stroke_strategy.cpp.

366 {
367 KisImageSP image = m_strategy->m_d->image.toStrongRef();
369
372 }
void disableUIUpdates() override

References KisImage::disableUIUpdates(), KisImageSignalRouter::emitNotifyBatchUpdateEnded(), KisSuspendProjectionUpdatesStrokeStrategy::Private::image, KIS_SAFE_ASSERT_RECOVER_RETURN, KisSuspendProjectionUpdatesStrokeStrategy::m_d, m_strategy, and KisImage::signalRouter().

Member Data Documentation

◆ m_strategy

KisSuspendProjectionUpdatesStrokeStrategy* KisSuspendProjectionUpdatesStrokeStrategy::Private::StartBatchUIUpdatesCommand::m_strategy

The documentation for this struct was generated from the following file: