Merge branch 'libuv-0.10-headless-display' into mason
Conflicts: common/http_request_baton_curl.cpp include/mbgl/map/map.hpp include/mbgl/util/uv_detail.hpp scripts/travis_before_install.sh setup-libraries.sh src/map/map.cpp src/storage/file_request_baton.cpp src/storage/http_request.cpp src/util/uv-messenger.c
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
#include <rapidjson/stringbuffer.h>
|
||||
|
||||
#include "../common/headless_view.hpp"
|
||||
#include "../common/headless_display.hpp"
|
||||
|
||||
#include "./fixtures/fixture_log.hpp"
|
||||
|
||||
@@ -22,6 +23,8 @@ const std::string base_directory = []{
|
||||
return fn + "/node_modules/mapbox-gl-test-suite/";
|
||||
}();
|
||||
|
||||
auto display_ = std::make_shared<mbgl::HeadlessDisplay>();
|
||||
|
||||
class HeadlessTest : public ::testing::TestWithParam<std::string> {};
|
||||
|
||||
TEST_P(HeadlessTest, render) {
|
||||
@@ -78,7 +81,7 @@ TEST_P(HeadlessTest, render) {
|
||||
}
|
||||
}
|
||||
|
||||
HeadlessView view;
|
||||
HeadlessView view(display_);
|
||||
Map map(view);
|
||||
|
||||
map.setStyleJSON(style, base_directory);
|
||||
@@ -95,10 +98,7 @@ TEST_P(HeadlessTest, render) {
|
||||
const unsigned int w = width * pixelRatio;
|
||||
const unsigned int h = height * pixelRatio;
|
||||
|
||||
const std::unique_ptr<uint32_t[]> pixels(new uint32_t[w * h]);
|
||||
glReadPixels(0, 0, w, h, GL_RGBA, GL_UNSIGNED_BYTE, pixels.get());
|
||||
|
||||
const std::string image = util::compress_png(w, h, pixels.get(), true);
|
||||
const std::string image = util::compress_png(w, h, view.readPixels().get(), true);
|
||||
util::write_file(actual_image, image);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user