KWin
Loading...
Searching...
No Matches
glrendertimequery.h
Go to the documentation of this file.
1/*
2 KWin - the KDE window manager
3 This file is part of the KDE project.
4
5 SPDX-FileCopyrightText: 2023 Xaver Hugl <xaver.hugl@gmail.com>
6
7 SPDX-License-Identifier: GPL-2.0-or-later
8*/
9#pragma once
10
11#include <chrono>
12#include <epoxy/gl.h>
13
14#include "kwin_export.h"
15
16namespace KWin
17{
18
19class KWIN_EXPORT GLRenderTimeQuery
20{
21public:
22 explicit GLRenderTimeQuery();
24
25 void begin();
26 void end();
27
31 std::chrono::nanoseconds result();
32
33private:
34 GLuint m_query = 0;
35 bool m_hasResult = false;
36 std::chrono::nanoseconds m_cpuStart = std::chrono::nanoseconds::zero();
37 std::chrono::nanoseconds m_cpuEnd = std::chrono::nanoseconds::zero();
38};
39
40}