| 1 |
// Copyright (C) 2016 The Qt Company Ltd. |
| 2 |
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only |
| 3 |
|
| 4 |
#ifndef QOPENGLTEXTUREBLITWINDOW_H |
| 5 |
#define QOPENGLTEXTUREBLITWINDOW_H |
| 6 |
|
| 7 |
#include <QtGui/QWindow> |
| 8 |
#include <QtGui/QOpenGLContext> |
| 9 |
#include <QtGui/QOpenGLTextureBlitter> |
| 10 |
|
| 11 |
class QOpenGLTextureBlitWindow : public QWindow |
| 12 |
{ |
| 13 |
Q_OBJECT |
| 14 |
public: |
| 15 |
QOpenGLTextureBlitWindow(); |
| 16 |
|
| 17 |
void render(); |
| 18 |
protected: |
| 19 |
void exposeEvent(QExposeEvent *event); |
| 20 |
void resizeEvent(QResizeEvent *event); |
| 21 |
|
| 22 |
private: |
| 23 |
qreal dWidth() const { return width() * devicePixelRatio(); } |
| 24 |
qreal dHeight() const { return height() * devicePixelRatio(); } |
| 25 |
|
| 26 |
QScopedPointer<QOpenGLContext> m_context; |
| 27 |
QOpenGLTextureBlitter m_blitter; |
| 28 |
QImage m_image; |
| 29 |
QImage m_image_mirrord; |
| 30 |
}; |
| 31 |
|
| 32 |
#endif |