Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qwasmanimationdriver_p.h
Go to the documentation of this file.
1// Copyright (C) 2025 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3// Qt-Security score:significant reason:default
4
5#ifndef QWASMANIMATIONDRIVER_P_H
6#define QWASMANIMATIONDRIVER_P_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 purely as an
13// implementation detail. 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 <QtCore/private/qglobal_p.h>
20#include <QtCore/qabstractanimation.h>
21#include <QtCore/qtimer.h>
22
23#include <memory>
24
25QT_BEGIN_NAMESPACE
26
27class QUnifiedTimer;
28
29class Q_CORE_EXPORT QWasmAnimationDriver : public QAnimationDriver
30{
31 Q_OBJECT
32public:
33 QWasmAnimationDriver(QUnifiedTimer *unifiedTimer);
34 ~QWasmAnimationDriver() override;
35
36 qint64 elapsed() const override;
37
38protected:
39 void start() override;
40 void stop() override;
41
42private:
43 void handleAnimationFrame(double timestamp);
44 void handleFallbackTimeout();
45 double getCurrentTimeFromTimeline() const;
46
47 QTimer fallbackTimer;
48 uint32_t m_animateCallbackHandle = 0;
49 double m_startTimestamp = 0;
50 double m_currentTimestamp = 0;
51};
52
53QT_END_NAMESPACE
54
55#endif // QWASMANIMATIONDRIVER_P_H
constexpr int FallbackTimerInterval