| 1 | // Copyright (C) 2020 Klaralvdalens Datakonsult AB (KDAB). |
| 2 | // Copyright (C) 2016 Paul Lemire <paul.lemire350@gmail.com> |
| 3 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only |
| 4 | |
| 5 | #ifndef QT3DRENDER_DEBUG_COMMANDEXECUTER_H |
| 6 | #define QT3DRENDER_DEBUG_COMMANDEXECUTER_H |
| 7 | |
| 8 | // |
| 9 | // W A R N I N G |
| 10 | // ------------- |
| 11 | // |
| 12 | // This file is not part of the Qt API. It exists for the convenience |
| 13 | // of other Qt classes. This header file may change from version to |
| 14 | // version without notice, or even be removed. |
| 15 | // |
| 16 | // We mean it. |
| 17 | // |
| 18 | |
| 19 | #include <vector> |
| 20 | #include <QVariant> |
| 21 | #include <QMutex> |
| 22 | |
| 23 | QT_BEGIN_NAMESPACE |
| 24 | |
| 25 | namespace Qt3DCore { |
| 26 | |
| 27 | namespace Debug { |
| 28 | class AsynchronousCommandReply; |
| 29 | } // Debug |
| 30 | |
| 31 | } // Qt3DCore |
| 32 | |
| 33 | namespace Qt3DRender { |
| 34 | |
| 35 | namespace Render { |
| 36 | namespace Rhi { |
| 37 | class Renderer; |
| 38 | class RenderView; |
| 39 | } // Rhi |
| 40 | } // Render |
| 41 | |
| 42 | namespace DebugRhi { |
| 43 | |
| 44 | class CommandExecuter |
| 45 | { |
| 46 | public: |
| 47 | explicit CommandExecuter(Render::Rhi::Renderer *renderer); |
| 48 | |
| 49 | void performAsynchronousCommandExecution(const std::vector<Render::Rhi::RenderView *> &views); |
| 50 | |
| 51 | QVariant executeCommand(const QStringList &args); |
| 52 | |
| 53 | private: |
| 54 | Render::Rhi::Renderer *m_renderer; |
| 55 | std::vector<Qt3DCore::Debug::AsynchronousCommandReply *> m_pendingCommands; |
| 56 | QMutex m_pendingCommandsMutex; |
| 57 | }; |
| 58 | |
| 59 | } // DebugRhi |
| 60 | |
| 61 | } // Qt3DRender |
| 62 | |
| 63 | QT_END_NAMESPACE |
| 64 | |
| 65 | #endif // QT3DRENDER_DEBUG_COMMANDEXECUTER_H |
| 66 | |