05fc3aef53
Replace the current license disclaimer in files by a SPDX-License-Identifier. Files that have to be modified by hand are modified. License files are organized under LICENSES directory. Task-number: QTBUG-67283 Change-Id: Id880c92784c40f3bbde861c0d93f58151c18b9f1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
41 lines
1.2 KiB
C++
41 lines
1.2 KiB
C++
// Copyright (C) 2018 The Qt Company Ltd.
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
|
|
|
|
#ifndef QUADRENDERER_H
|
|
#define QUADRENDERER_H
|
|
|
|
#include <QtGui/private/qrhi_p.h>
|
|
|
|
class QuadRenderer
|
|
{
|
|
public:
|
|
void setRhi(QRhi *r) { m_r = r; }
|
|
void setSampleCount(int samples) { m_sampleCount = samples; }
|
|
int sampleCount() const { return m_sampleCount; }
|
|
void setTranslation(const QVector3D &v) { m_translation = v; }
|
|
void initResources(QRhiRenderPassDescriptor *rp);
|
|
void releaseResources();
|
|
void setPipeline(QRhiGraphicsPipeline *ps);
|
|
void resize(const QSize &pixelSize);
|
|
void queueResourceUpdates(QRhiResourceUpdateBatch *resourceUpdates);
|
|
void queueDraw(QRhiCommandBuffer *cb, const QSize &outputSizeInPixels);
|
|
|
|
private:
|
|
QRhi *m_r;
|
|
|
|
QRhiBuffer *m_vbuf = nullptr;
|
|
bool m_vbufReady = false;
|
|
QRhiBuffer *m_ibuf = nullptr;
|
|
bool m_opacityReady = false;
|
|
QRhiBuffer *m_ubuf = nullptr;
|
|
QRhiGraphicsPipeline *m_ps = nullptr;
|
|
QRhiShaderResourceBindings *m_srb = nullptr;
|
|
|
|
QVector3D m_translation;
|
|
QMatrix4x4 m_proj;
|
|
float m_rotation = 0;
|
|
int m_sampleCount = 1; // no MSAA by default
|
|
};
|
|
|
|
#endif
|