summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--common/headless_view.cpp5
-rwxr-xr-xsetup-libraries.sh2
-rw-r--r--src/map/map.cpp13
-rw-r--r--test/headless.cpp2
4 files changed, 9 insertions, 13 deletions
diff --git a/common/headless_view.cpp b/common/headless_view.cpp
index 8ea1b13709..4ad22da9a5 100644
--- a/common/headless_view.cpp
+++ b/common/headless_view.cpp
@@ -106,10 +106,7 @@ void HeadlessView::resize(int width, int height) {
#if MBGL_USE_GLX
x_pixmap = XCreatePixmap(x_display, DefaultRootWindow(x_display), width, height, 32);
glx_pixmap = glXCreateGLXPixmap(x_display, x_info, x_pixmap);
-
- make_active();
#endif
-
}
void HeadlessView::clear_buffers() {
@@ -132,6 +129,8 @@ void HeadlessView::clear_buffers() {
glDeleteRenderbuffersEXT(1, &fbo_depth_stencil);
fbo_depth_stencil = 0;
}
+
+ make_inactive();
#endif
#if MBGL_USE_GLX
diff --git a/setup-libraries.sh b/setup-libraries.sh
index e955304985..7d205ac4ec 100755
--- a/setup-libraries.sh
+++ b/setup-libraries.sh
@@ -51,7 +51,7 @@ set -u
NODE=$(which node)
NPM=$(which npm)
-MP_HASH="d58d6f18b99e5283b43940882da9ea18deea1227"
+MP_HASH="8239a894fecdfc001016a4669bc5ca289763048f"
DIR_HASH=$(echo `pwd` | git hash-object --stdin)
if [ ! -d 'mapnik-packaging/' ]; then
git clone https://github.com/mapnik/mapnik-packaging.git
diff --git a/src/map/map.cpp b/src/map/map.cpp
index 64940af9e2..6db6fa2808 100644
--- a/src/map/map.cpp
+++ b/src/map/map.cpp
@@ -111,7 +111,6 @@ void Map::run() {
// If the map rendering wasn't started asynchronously, we perform one render
// *after* all events have been processed.
if (!async) {
- prepare();
render();
}
}
@@ -147,12 +146,10 @@ void Map::cleanup() {
void Map::cleanup(uv_async_t *async, int status) {
Map *map = static_cast<Map *>(async->data);
- map->view.make_active();
map->painter.cleanup();
}
void Map::terminate() {
- view.make_active();
painter.terminate();
}
@@ -189,8 +186,6 @@ void Map::terminate(uv_async_t *async, int status) {
#pragma mark - Setup
void Map::setup() {
- view.make_active();
-
painter.setup();
}
@@ -525,8 +520,6 @@ void Map::updateRenderState() {
}
void Map::prepare() {
- view.make_active();
-
// Update transform transitions.
animationTime = util::now();
if (transform.needsTransition()) {
@@ -544,11 +537,11 @@ void Map::prepare() {
spriteAtlas->update(*getSprite());
updateTiles();
-
- view.make_inactive();
}
void Map::render() {
+ view.make_active();
+
#if defined(DEBUG)
std::vector<std::string> debug;
#endif
@@ -583,6 +576,8 @@ void Map::render() {
}
glFlush();
+
+ view.make_inactive();
}
void Map::renderLayers(std::shared_ptr<StyleLayerGroup> group) {
diff --git a/test/headless.cpp b/test/headless.cpp
index 4299fd79b9..9a4857dd1a 100644
--- a/test/headless.cpp
+++ b/test/headless.cpp
@@ -91,7 +91,9 @@ TEST_P(HeadlessTest, render) {
map.run();
const std::unique_ptr<uint32_t[]> pixels(new uint32_t[width * height]);
+ map.view.make_active();
glReadPixels(0, 0, width, height, GL_RGBA, GL_UNSIGNED_BYTE, pixels.get());
+ map.view.make_inactive();
const std::string image = util::compress_png(width, height, pixels.get(), true);
util::write_file(actual_image, image);