summaryrefslogtreecommitdiff
path: root/platform/qt/src/headless_backend_qt.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'platform/qt/src/headless_backend_qt.cpp')
-rw-r--r--platform/qt/src/headless_backend_qt.cpp36
1 files changed, 18 insertions, 18 deletions
diff --git a/platform/qt/src/headless_backend_qt.cpp b/platform/qt/src/headless_backend_qt.cpp
index 5f95b2f96a..ad3fa42290 100644
--- a/platform/qt/src/headless_backend_qt.cpp
+++ b/platform/qt/src/headless_backend_qt.cpp
@@ -12,19 +12,11 @@
namespace mbgl {
-struct QtImpl : public HeadlessBackend::Impl {
- void activateContext() final {
- widget.makeCurrent();
- }
+class QtBackendImpl : public HeadlessBackend::Impl {
+public:
+ ~QtBackendImpl() final = default;
- void deactivateContext() final {
- widget.doneCurrent();
- }
-
- QGLWidget widget;
-};
-
-gl::ProcAddress HeadlessBackend::initializeExtension(const char* name) {
+ gl::ProcAddress getExtensionFunctionPointer(const char* name) final {
#if QT_VERSION >= 0x050000
QOpenGLContext* thisContext = QOpenGLContext::currentContext();
return thisContext->getProcAddress(name);
@@ -32,15 +24,23 @@ gl::ProcAddress HeadlessBackend::initializeExtension(const char* name) {
const QGLContext* thisContext = QGLContext::currentContext();
return reinterpret_cast<gl::ProcAddress>(thisContext->getProcAddress(name));
#endif
-}
+ }
+
+ void activateContext() final {
+ widget.makeCurrent();
+ }
-bool HeadlessBackend::hasDisplay() {
- return true;
+ void deactivateContext() final {
+ widget.doneCurrent();
+ }
+
+private:
+ QGLWidget widget;
};
-void HeadlessBackend::createContext() {
- assert(!hasContext());
- impl.reset(new QtImpl);
+void HeadlessBackend::createImpl() {
+ assert(!impl);
+ impl = std::make_unique<QtBackendImpl>();
}
} // namespace mbgl