summaryrefslogtreecommitdiffstats
path: root/src/shared-main-lib/frametimerimpl.cpp
blob: 8457da95cf4e100353479365c72d95bd666fbc2e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// Copyright (C) 2023 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only

#include "frametimerimpl.h"
#include "frametimer.h"


QT_BEGIN_NAMESPACE_AM

std::function<FrameTimerImpl *(FrameTimer *)> FrameTimerImpl::s_factory;

FrameTimerImpl::FrameTimerImpl(FrameTimer *frameTimer)
    : m_frameTimer(frameTimer)
{ }

void FrameTimerImpl::setFactory(const std::function<FrameTimerImpl *(FrameTimer *)> &factory)
{
    s_factory = factory;
}

FrameTimerImpl *FrameTimerImpl::create(FrameTimer *window)
{
    return s_factory ? s_factory(window) : nullptr;
}

FrameTimer *FrameTimerImpl::frameTimer()
{
    return m_frameTimer;
}

void FrameTimerImpl::reportFrameSwap()
{

}

QT_END_NAMESPACE_AM