summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorMike Morris <michael.patrick.morris@gmail.com>2014-09-24 15:58:52 -0400
committerMike Morris <michael.patrick.morris@gmail.com>2014-09-24 15:58:52 -0400
commit3dec4933a9525b74c06d739adc4fdd9050b3f25f (patch)
treea28f772fabbb9ef5ccf95f56131ff5420f256add /common
parent9b6cff43011f7a9bb8ff19a28aa549126e96e160 (diff)
parent8a19896c3a0e450ba498281b8879eb86060fa0cb (diff)
downloadqtlocation-mapboxgl-3dec4933a9525b74c06d739adc4fdd9050b3f25f.tar.gz
Merge branch 'libuv010' into libuv-0.10-fix-context-shutdown
Conflicts: common/headless_view.cpp test/headless.cpp
Diffstat (limited to 'common')
-rw-r--r--common/headless_view.cpp16
-rw-r--r--common/headless_view.hpp2
2 files changed, 16 insertions, 2 deletions
diff --git a/common/headless_view.cpp b/common/headless_view.cpp
index 4ad22da9a5..d3c6491d0d 100644
--- a/common/headless_view.cpp
+++ b/common/headless_view.cpp
@@ -2,6 +2,7 @@
#include <mbgl/util/timer.hpp>
#include <stdexcept>
+#include <iostream>
namespace mbgl {
@@ -65,9 +66,12 @@ HeadlessView::HeadlessView() {
}
-void HeadlessView::resize(int width, int height) {
+void HeadlessView::resize(uint16_t width, uint16_t height, float pixelRatio) {
clear_buffers();
+ width *= pixelRatio;
+ height *= pixelRatio;
+
#if MBGL_USE_CGL
make_active();
@@ -154,6 +158,11 @@ HeadlessView::~HeadlessView() {
#endif
#if MBGL_USE_GLX
+ std::cerr << "~HeadlessView()" << '\n';
+ std::cerr << "x_display: " << x_display << '\n';
+ std::cerr << "glx_pixmap: " << glx_pixmap << '\n';
+ std::cerr << "gl_context: " << gl_context << '\n';
+
glXDestroyContext(x_display, gl_context);
XFree(x_info);
XCloseDisplay(x_display);
@@ -173,6 +182,11 @@ void HeadlessView::make_active() {
#endif
#if MBGL_USE_GLX
+ std::cerr << "make_active()" << '\n';
+ std::cerr << "x_display: " << x_display << '\n';
+ std::cerr << "glx_pixmap: " << glx_pixmap << '\n';
+ std::cerr << "gl_context: " << gl_context << '\n';
+
if (!glXMakeCurrent(x_display, glx_pixmap, gl_context)) {
fprintf(stderr, "Switching OpenGL context failed\n");
}
diff --git a/common/headless_view.hpp b/common/headless_view.hpp
index a4432bbae3..c8475a2516 100644
--- a/common/headless_view.hpp
+++ b/common/headless_view.hpp
@@ -19,7 +19,7 @@ public:
HeadlessView();
~HeadlessView();
- void resize(int width, int height);
+ void resize(uint16_t width, uint16_t height, float pixelRatio);
void notify_map_change(MapChange change, timestamp delay = 0);
void make_active();