Commit ae388989 authored by Laszlo Agocs's avatar Laszlo Agocs

Add QRhiProfilerStreamReader skeleton

parent 2cee799a
......@@ -37,7 +37,9 @@
#include "qrhi_p.h"
#include <qmath.h>
#ifndef QT_NO_OPENGL
#include "qrhigles2_p.h"
#endif
#if QT_CONFIG(vulkan)
#include "qrhivulkan_p.h"
#endif
......@@ -418,8 +420,13 @@ QRhi *QRhi::create(Implementation impl, QRhiInitParams *params, Flags flags)
break;
#endif
case OpenGLES2:
#ifndef QT_NO_OPENGL
r->d = new QRhiGles2(params);
break;
#else
qWarning("This build of Qt has no OpenGL support");
break;
#endif
case D3D11:
#ifdef Q_OS_WIN
r->d = new QRhiD3D11(params);
......
......@@ -64,7 +64,6 @@ public:
FrameTime
};
QRhiProfiler();
~QRhiProfiler();
void setDevice(QIODevice *device);
......@@ -74,7 +73,10 @@ public:
void addVMemAllocatorStats();
private:
Q_DISABLE_COPY(QRhiProfiler)
QRhiProfiler();
QRhiProfilerPrivate *d;
friend class QRhiImplementation;
friend class QRhiProfilerPrivate;
};
......
/****************************************************************************
**
** Copyright (C) 2018 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/
**
** This file is part of the Qt RHI module
**
** $QT_BEGIN_LICENSE:LGPL3$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see http://www.qt.io/terms-conditions. For further
** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPLv3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
** will be met: https://www.gnu.org/licenses/lgpl.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 2.0 or later as published by the Free
** Software Foundation and appearing in the file LICENSE.GPL included in
** the packaging of this file. Please review the following information to
** ensure the GNU General Public License version 2.0 requirements will be
** met: http://www.gnu.org/licenses/gpl-2.0.html.
**
** $QT_END_LICENSE$
**
****************************************************************************/
#include "qrhiprofilerstreamreader_p.h"
QT_BEGIN_NAMESPACE
QRhiProfilerStreamReader::QRhiProfilerStreamReader()
: d(new QRhiProfilerStreamReaderPrivate)
{
}
QRhiProfilerStreamReader::QRhiProfilerStreamReader(QIODevice *device)
: d(new QRhiProfilerStreamReaderPrivate)
{
d->setDevice(device);
}
QRhiProfilerStreamReader::~QRhiProfilerStreamReader()
{
delete d;
}
void QRhiProfilerStreamReader::setDevice(QIODevice *device)
{
d->setDevice(device);
}
void QRhiProfilerStreamReaderPrivate::setDevice(QIODevice *device)
{
dev = device;
}
QT_END_NAMESPACE
/****************************************************************************
**
** Copyright (C) 2018 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/
**
** This file is part of the Qt RHI module
**
** $QT_BEGIN_LICENSE:LGPL3$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see http://www.qt.io/terms-conditions. For further
** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPLv3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
** will be met: https://www.gnu.org/licenses/lgpl.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 2.0 or later as published by the Free
** Software Foundation and appearing in the file LICENSE.GPL included in
** the packaging of this file. Please review the following information to
** ensure the GNU General Public License version 2.0 requirements will be
** met: http://www.gnu.org/licenses/gpl-2.0.html.
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef QRHIPROFILERSTREAMREADER_H
#define QRHIPROFILERSTREAMREADER_H
#include <QtRhi/qrhi.h>
QT_BEGIN_NAMESPACE
class QRhiProfilerStreamReaderPrivate;
class QIODevice;
class Q_RHI_EXPORT QRhiProfilerStreamReader
{
public:
QRhiProfilerStreamReader();
QRhiProfilerStreamReader(QIODevice *device);
~QRhiProfilerStreamReader();
void setDevice(QIODevice *device);
private:
Q_DISABLE_COPY(QRhiProfilerStreamReader)
QRhiProfilerStreamReaderPrivate *d;
friend class QRhiProfilerStreamReaderPrivate;
};
QT_END_NAMESPACE
#endif
/****************************************************************************
**
** Copyright (C) 2018 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/
**
** This file is part of the Qt RHI module
**
** $QT_BEGIN_LICENSE:GPL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3 or (at your option) any later version
** approved by the KDE Free Qt Foundation. The licenses are as published by
** the Free Software Foundation and appearing in the file LICENSE.GPL3
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef QRHIPROFILERSTREAMREADER_P_H
#define QRHIPROFILERSTREAMREADER_P_H
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists purely as an
// implementation detail. This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//
#include "qtrhiglobal_p.h"
#include "qrhiprofilerstreamreader.h"
QT_BEGIN_NAMESPACE
class QRhiProfilerStreamReaderPrivate
{
public:
void setDevice(QIODevice *device);
QIODevice *dev = nullptr;
};
QT_END_NAMESPACE
#endif
......@@ -13,13 +13,21 @@ HEADERS += \
qrhi_p.h \
qrhiprofiler.h \
qrhiprofiler_p.h \
qrhigles2.h \
qrhigles2_p.h
qrhiprofilerstreamreader.h \
qrhiprofilerstreamreader_p.h
SOURCES += \
qrhi.cpp \
qrhiprofiler.cpp \
qrhigles2.cpp
qrhiprofilerstreamreader.cpp
qtConfig(opengl) {
HEADERS += \
qrhigles2.h \
qrhigles2_p.h
SOURCES += \
qrhigles2.cpp
}
qtConfig(vulkan) {
HEADERS += \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment