File indexing completed on 2024-05-12 15:58:51

0001 /*
0002  *  SPDX-FileCopyrightText: 2017 Dmitry Kazakov <dimula73@gmail.com>
0003  *
0004  *  SPDX-License-Identifier: GPL-2.0-or-later
0005  */
0006 
0007 #ifndef KISFAKERUNNABLESTROKEJOBSEXECUTOR_H
0008 #define KISFAKERUNNABLESTROKEJOBSEXECUTOR_H
0009 
0010 #include "KisRunnableStrokeJobsInterface.h"
0011 
0012 
0013 class KRITAIMAGE_EXPORT KisFakeRunnableStrokeJobsExecutor : public KisRunnableStrokeJobsInterface
0014 {
0015 public:
0016 
0017     /**
0018      * Normally, barrier jobs are not allowed in the fake jobs executor,
0019      * because we cannot guarantee that all the update jobs are finished
0020      * on the scheduler, so their guarantee is kind of "broken".
0021      * Passing `AllowBarrierJobs` flag explicitly disables this check,
0022      * which passes responsibility for the broken guarantees to the caller.
0023      */
0024     enum Flag {
0025         None = 0x0,
0026         AllowBarrierJobs = 0x1
0027     };
0028     Q_DECLARE_FLAGS(Flags, Flag)
0029 
0030 public:
0031     KisFakeRunnableStrokeJobsExecutor();
0032     KisFakeRunnableStrokeJobsExecutor(Flags flags);
0033 
0034     void addRunnableJobs(const QVector<KisRunnableStrokeJobDataBase*> &list) override;
0035 
0036 private:
0037     Flags m_flags;
0038 };
0039 
0040 Q_DECLARE_OPERATORS_FOR_FLAGS(KisFakeRunnableStrokeJobsExecutor::Flags)
0041 
0042 
0043 #endif // KISFAKERUNNABLESTROKEJOBSEXECUTOR_H