summaryrefslogtreecommitdiff
path: root/platform/qt
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2017-11-27 16:34:52 +0100
committerKonstantin Käfer <mail@kkaefer.com>2017-11-29 15:48:51 +0100
commit335f04f7e13422ce53cbbf13cebb8283149faba8 (patch)
tree4542c71910cea2f626ac37325a32f9432f1d908b /platform/qt
parent772b9090626731101b82eccacbc3adaa71cc428c (diff)
downloadqtlocation-mapboxgl-335f04f7e13422ce53cbbf13cebb8283149faba8.tar.gz
[core] fold HeadlessDisplay into the headless RenderBackend implementation
Diffstat (limited to 'platform/qt')
-rw-r--r--platform/qt/qt.cmake2
-rw-r--r--platform/qt/src/headless_backend_qt.cpp12
2 files changed, 6 insertions, 8 deletions
diff --git a/platform/qt/qt.cmake b/platform/qt/qt.cmake
index 1bcb869fc9..7b3c7fe1a2 100644
--- a/platform/qt/qt.cmake
+++ b/platform/qt/qt.cmake
@@ -17,8 +17,6 @@ set(MBGL_QT_CORE_FILES
PRIVATE platform/default/mbgl/gl/headless_frontend.hpp
PRIVATE platform/default/mbgl/gl/headless_backend.cpp
PRIVATE platform/default/mbgl/gl/headless_backend.hpp
- PRIVATE platform/default/mbgl/gl/headless_display.cpp
- PRIVATE platform/default/mbgl/gl/headless_display.hpp
PRIVATE platform/qt/src/headless_backend_qt.cpp
# Thread pool
diff --git a/platform/qt/src/headless_backend_qt.cpp b/platform/qt/src/headless_backend_qt.cpp
index 5f95b2f96a..7985ca9f2d 100644
--- a/platform/qt/src/headless_backend_qt.cpp
+++ b/platform/qt/src/headless_backend_qt.cpp
@@ -12,7 +12,10 @@
namespace mbgl {
-struct QtImpl : public HeadlessBackend::Impl {
+class QtImpl : public HeadlessBackend::Impl {
+public:
+ ~QtImpl() final = default;
+
void activateContext() final {
widget.makeCurrent();
}
@@ -21,6 +24,7 @@ struct QtImpl : public HeadlessBackend::Impl {
widget.doneCurrent();
}
+private:
QGLWidget widget;
};
@@ -34,13 +38,9 @@ gl::ProcAddress HeadlessBackend::initializeExtension(const char* name) {
#endif
}
-bool HeadlessBackend::hasDisplay() {
- return true;
-};
-
void HeadlessBackend::createContext() {
assert(!hasContext());
- impl.reset(new QtImpl);
+ impl = std::make_unique<QtImpl>();
}
} // namespace mbgl