summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
Diffstat (limited to 'common')
-rw-r--r--common/curl_request.cpp14
-rw-r--r--common/headless_view.cpp11
2 files changed, 18 insertions, 7 deletions
diff --git a/common/curl_request.cpp b/common/curl_request.cpp
index 416ed90cd1..3370c0a859 100644
--- a/common/curl_request.cpp
+++ b/common/curl_request.cpp
@@ -216,7 +216,7 @@ int handle_socket(CURL * /*easy*/, curl_socket_t s, int action, void * /*userp*/
return 0;
}
-void on_timeout(uv_timer_t * /*req*/) {
+void on_timeout(uv_timer_t *, int status /*req*/) {
int running_handles;
CURLMcode error =
curl_multi_socket_action(curl_multi, CURL_SOCKET_TIMEOUT, 0, &running_handles);
@@ -227,9 +227,9 @@ void on_timeout(uv_timer_t * /*req*/) {
void start_timeout(CURLM * /*multi*/, long timeout_ms, void * /*userp*/) {
if (timeout_ms <= 0) {
- on_timeout(&timeout);
+ on_timeout(&timeout, -1);
} else {
- uv_timer_start(&timeout, on_timeout, timeout_ms, 0);
+ uv_timer_start(&timeout, &on_timeout, timeout_ms, 0);
}
}
@@ -289,7 +289,7 @@ size_t curl_write_cb(void *contents, size_t size, size_t nmemb, void *userp) {
// This callback is called in the request event loop (on the request thread).
// It initializes newly queued up download requests and adds them to the CURL
// multi handle.
-void async_add_cb(uv_async_t * /*async*/) {
+void async_add_cb(uv_async_t *, int status /*async*/) {
std::shared_ptr<Request> *req = nullptr;
while (add_queue.pop(req)) {
// Make sure that we're not starting requests that have been cancelled
@@ -321,7 +321,7 @@ void async_add_cb(uv_async_t * /*async*/) {
}
}
-void async_cancel_cb(uv_async_t * /*async*/) {
+void async_cancel_cb(uv_async_t *, int status /*async*/) {
std::shared_ptr<Request> *req = nullptr;
while (cancel_queue.pop(req)) {
// It is possible that the request has not yet been started, but that it already has been
@@ -343,8 +343,8 @@ void thread_init_cb() {
curl_global_init(CURL_GLOBAL_ALL);
loop = uv_loop_new();
- uv_async_init(loop, &async_add, async_add_cb);
- uv_async_init(loop, &async_cancel, async_cancel_cb);
+ uv_async_init(loop, &async_add, &async_add_cb);
+ uv_async_init(loop, &async_cancel, &async_cancel_cb);
uv_thread_create(&thread, thread_init, nullptr);
}
} // end namespace request
diff --git a/common/headless_view.cpp b/common/headless_view.cpp
index ed00f48e82..94a6cd03bc 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 {
@@ -117,6 +118,8 @@ void HeadlessView::resize(uint16_t width, uint16_t height, float pixelRatio) {
void HeadlessView::clear_buffers() {
#if MBGL_USE_CGL
+ make_active();
+
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
if (fbo) {
@@ -156,6 +159,10 @@ 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';
glXMakeCurrent(x_display, None, NULL);
glXDestroyContext(x_display, gl_context);
XFree(x_info);
@@ -176,6 +183,10 @@ 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");
}