From 65df83ce4c0ccb410f3d6a9841aeea621483f0be Mon Sep 17 00:00:00 2001 From: Mike Morris Date: Fri, 19 Sep 2014 16:16:44 -0400 Subject: [PATCH] bump mapnik-packaging, remove unnecessary view.make_active calls --- common/headless_view.cpp | 5 ++--- setup-libraries.sh | 2 +- src/map/map.cpp | 13 ++++--------- test/headless.cpp | 2 ++ 4 files changed, 9 insertions(+), 13 deletions(-) diff --git a/common/headless_view.cpp b/common/headless_view.cpp index 8ea1b1370..4ad22da9a 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 e95530498..7d205ac4e 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 64940af9e..6db6fa280 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(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 debug; #endif @@ -583,6 +576,8 @@ void Map::render() { } glFlush(); + + view.make_inactive(); } void Map::renderLayers(std::shared_ptr group) { diff --git a/test/headless.cpp b/test/headless.cpp index 4299fd79b..9a4857dd1 100644 --- a/test/headless.cpp +++ b/test/headless.cpp @@ -91,7 +91,9 @@ TEST_P(HeadlessTest, render) { map.run(); const std::unique_ptr 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);