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:
Konstantin Käfer
2014-10-22 15:14:21 +02:00
32 changed files with 895 additions and 143 deletions

View File

@@ -63,6 +63,9 @@ public:
// Triggers a cleanup that releases resources.
void cleanup();
// Releases resources immediately
void terminate();
// Controls buffer swapping.
bool needsSwap();
void swapped();

View File

@@ -35,11 +35,9 @@ public:
// renderer setup since the render thread doesn't switch the contexts.
virtual void make_active() = 0;
// Returns the base framebuffer object, if any, and 0 if using the system
// provided framebuffer.
virtual unsigned int root_fbo() {
return 0;
}
// Called from the render thread. Makes the GL context inactive in the current
// thread. This is called once just before the rendering thread terminates.
virtual void make_inactive() = 0;
virtual void notify() = 0;

View File

@@ -64,6 +64,7 @@ public:
// lazy initialization) in case rendering continues.
void cleanup();
void terminate();
// Renders the backdrop of the OpenGL view. This also paints in areas where we don't have any
// tiles whatsoever.
@@ -124,6 +125,7 @@ public:
private:
void setupShaders();
void deleteShaders();
mat4 translatedMatrix(const mat4& matrix, const std::array<float, 2> &translation, const Tile::ID &id, TranslateAnchorType anchor);
void prepareTile(const Tile& tile);

View File

@@ -14,17 +14,22 @@ enum class ClassID : uint32_t {
};
class ClassDictionary {
private:
ClassDictionary();
public:
static ClassDictionary &Get();
// Returns an ID for a class name. If the class name does not yet have an ID, one is
// auto-generated and stored for future reference.
static ClassID Lookup(const std::string &class_name);
ClassID lookup(const std::string &class_name);
// Returns either Fallback, Default or Named, depending on the type of the class id.
static ClassID Normalize(ClassID id);
ClassID normalize(ClassID id);
private:
static std::unordered_map<std::string, ClassID> store;
static uint32_t offset;
std::unordered_map<std::string, ClassID> store = { { "", ClassID::Default } };
uint32_t offset = 0;
};
}