summaryrefslogtreecommitdiffstats
path: root/examples/widgets/painting/shared/fbopaintdevice.h
diff options
context:
space:
mode:
authorVolker Hilsheimer <volker.hilsheimer@qt.io>2023-10-24 17:41:51 +0200
committerVolker Hilsheimer <volker.hilsheimer@qt.io>2023-10-27 16:22:59 +0200
commit7c59c5ed13dd796b4a77a56cb7badc34aead1adb (patch)
tree82e80c50bb3c3cdee77b0b1cdd486ccd43b629fd /examples/widgets/painting/shared/fbopaintdevice.h
parent333650c596890fb5117c3ab5c4295838600248f2 (diff)
Examples: remove OpenGL code paths from painting examples
The extra code for using the OpenGL paint engine is significant enough to be distracting from what the examples are supposed to show. If we want to show how to use QPainter on an OpenGL widget, then we can make dedicated and documented examples for that, in the OpenGL category. And we have such examples in the Qt OpenGL module anyway. As is, the examples feel more like manual tests of the OpenGL paint engine; if we need more coverage there, then we can add it there. Change-Id: I7b56ea6d08c02cd0a1050ab03991656a0538498d Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Diffstat (limited to 'examples/widgets/painting/shared/fbopaintdevice.h')
-rw-r--r--examples/widgets/painting/shared/fbopaintdevice.h46
1 files changed, 0 insertions, 46 deletions
diff --git a/examples/widgets/painting/shared/fbopaintdevice.h b/examples/widgets/painting/shared/fbopaintdevice.h
deleted file mode 100644
index b2e77a228a..0000000000
--- a/examples/widgets/painting/shared/fbopaintdevice.h
+++ /dev/null
@@ -1,46 +0,0 @@
-// Copyright (C) 2018 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
-
-#ifndef QFBOPAINTDEVICE_H
-#define QFBOPAINTDEVICE_H
-
-#ifndef QT_NO_OPENGL
-
-#include <QImage>
-#include <QOpenGLFramebufferObject>
-#include <QOpenGLPaintDevice>
-#include <QSurface>
-
-class QFboPaintDevice : public QOpenGLPaintDevice {
-public:
- QFboPaintDevice(const QSize &size, bool flipped = false, bool clearOnInit = true,
- QOpenGLFramebufferObject::Attachment = QOpenGLFramebufferObject::CombinedDepthStencil);
- ~QFboPaintDevice();
-
- // QOpenGLPaintDevice:
- void ensureActiveTarget() override;
-
- bool isValid() const { return m_framebufferObject->isValid(); }
- GLuint handle() const { return m_framebufferObject->handle(); }
- GLuint texture();
- GLuint takeTexture();
- QImage toImage() const;
-
- bool bind() { return m_framebufferObject->bind(); }
- bool release() { return m_framebufferObject->release(); }
- QSize size() const { return m_framebufferObject->size(); }
-
- QOpenGLFramebufferObject* framebufferObject() { return m_framebufferObject; }
- const QOpenGLFramebufferObject* framebufferObject() const { return m_framebufferObject; }
-
- static bool isSupported() { return QOpenGLFramebufferObject::hasOpenGLFramebufferObjects(); }
-
-private:
- QOpenGLFramebufferObject *m_framebufferObject;
- QOpenGLFramebufferObject *m_resolvedFbo;
- QSurface *m_surface;
-};
-
-#endif // QT_NO_OPENGL
-
-#endif // QFBOPAINTDEVICE_H